org.opensaml.provider
Class SecureRandomIDProvider

java.lang.Object
  extended byorg.opensaml.provider.SecureRandomIDProvider
All Implemented Interfaces:
SAMLIdentifier

public class SecureRandomIDProvider
extends Object
implements SAMLIdentifier

Generation of identifiers for SAML objects using SecureRandom

Author:
Scott Cantor

Constructor Summary
SecureRandomIDProvider()
           
 
Method Summary
 byte[] generateRandomBytes(int n)
          Generate a sequence of random bytes.
 byte[] generateRandomBytes(SecureRandom random, int n)
          Generate a sequence of random bytes using the given SecureRandom object.
 String getIdentifier()
          Obtains a new identifier in string form
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureRandomIDProvider

public SecureRandomIDProvider()
Method Detail

getIdentifier

public String getIdentifier()
                     throws SAMLException
Description copied from interface: SAMLIdentifier
Obtains a new identifier in string form

Specified by:
getIdentifier in interface SAMLIdentifier
Returns:
The identifier in string form
Throws:
SAMLException - Raised if a problem occurs while generating the value
See Also:
SAMLIdentifier.getIdentifier()

generateRandomBytes

public byte[] generateRandomBytes(SecureRandom random,
                                  int n)
Description copied from interface: SAMLIdentifier

Generate a sequence of random bytes using the given SecureRandom object.

Specified by:
generateRandomBytes in interface SAMLIdentifier
Parameters:
random - a secure random number generator
n - the number of random bytes to generate
Returns:
the random bytes or null if the random argument is null
See Also:
SAMLIdentifier.generateRandomBytes(java.security.SecureRandom, int)

generateRandomBytes

public byte[] generateRandomBytes(int n)
Description copied from interface: SAMLIdentifier

Generate a sequence of random bytes.

Specified by:
generateRandomBytes in interface SAMLIdentifier
Parameters:
n - the number of random bytes to generate
Returns:
the random bytes
See Also:
SAMLIdentifier.generateRandomBytes(int)


Copyright ? 2005 UCAID. All Rights Reserved.