|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.utilities.java.support.security.RandomIdentifierGenerationStrategy
public class RandomIdentifierGenerationStrategy
Generates a random number of bytes via a Random source and encodes them into a string using a
BinaryEncoder (Hex by default).
| Field Summary | |
|---|---|
private org.apache.commons.codec.BinaryEncoder |
encoder
Encoder used to convert the random bytes in to a string. |
private Random |
random
Random number generator. |
private int |
sizeOfIdentifier
Number of random bytes in the identifier. |
| Constructor Summary | |
|---|---|
RandomIdentifierGenerationStrategy()
Constructor. |
|
RandomIdentifierGenerationStrategy(int identifierSize)
Constructor. |
|
RandomIdentifierGenerationStrategy(Random source,
int identifierSize,
org.apache.commons.codec.BinaryEncoder identifierEncoder)
Constructor. |
|
| Method Summary | |
|---|---|
String |
generateIdentifier()
Generates an identifier. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Random random
private final int sizeOfIdentifier
private final org.apache.commons.codec.BinaryEncoder encoder
| Constructor Detail |
|---|
public RandomIdentifierGenerationStrategy()
SecureRandom, size of identifier is set to 16
bytes, and the encoder is set to a Hex.
public RandomIdentifierGenerationStrategy(int identifierSize)
SecureRandom and the encoder is set to a
Hex.
identifierSize - number of random bytes in identifier
public RandomIdentifierGenerationStrategy(@Nonnull
Random source,
int identifierSize,
@Nonnull
org.apache.commons.codec.BinaryEncoder identifierEncoder)
source - source of random bytesidentifierSize - number of random bytes in the identifieridentifierEncoder - encoder used to convert random bytes to string identifier| Method Detail |
|---|
@Nonnull public String generateIdentifier()
generateIdentifier in interface IdentifierGenerationStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||