Package org.apache.guacamole.net.auth
Class IdentifierGenerator
java.lang.Object
org.apache.guacamole.net.auth.IdentifierGenerator
Generator of unique and unpredictable identifiers. Each generated identifier
is an arbitrary, random string produced using a cryptographically-secure
random number generator.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Generates a unique and unpredictable identifier.static String
generateIdentifier
(int minBits) Generates a unique and unpredictable identifier having at least the given number of bits of entropy.static String
generateIdentifier
(int minBits, boolean caseSensitive) Generates a unique and unpredictable identifier having at least the given number of bits of entropy.
-
Method Details
-
generateIdentifier
Generates a unique and unpredictable identifier. Each identifier is at least 256-bit and produced using a cryptographically-secure random number generator. The identifier may contain characters that differ only in case.- Returns:
- A unique and unpredictable identifier with at least 256 bits of entropy.
-
generateIdentifier
Generates a unique and unpredictable identifier having at least the given number of bits of entropy. The resulting identifier may have more than the number of bits required. The identifier may contain characters that differ only in case.- Parameters:
minBits
- The number of bits of entropy that the identifier should contain.- Returns:
- A unique and unpredictable identifier with at least the given number of bits of entropy.
-
generateIdentifier
Generates a unique and unpredictable identifier having at least the given number of bits of entropy. The resulting identifier may have more than the number of bits required. The identifier may contain characters that differ only in case.- Parameters:
minBits
- The number of bits of entropy that the identifier should contain.caseSensitive
- Whether identifiers are permitted to contain characters that vary by case. If false, all characters that may vary by case will be lowercase, and the generated identifier will be longer.- Returns:
- A unique and unpredictable identifier with at least the given number of bits of entropy.
-