Package com.ongres.scram.common
Enum ScramMechanism
- All Implemented Interfaces:
Serializable,Comparable<ScramMechanism>
SCRAM Mechanisms supported by this library. At least,
SCRAM-SHA-1 and
SCRAM-SHA-256 are provided, since both the hash and the HMAC implementations are provided
by the Java JDK version 8 or greater.
MessageDigest: "Every implementation of the Java platform is required to
support the following standard MessageDigest algorithms: SHA-1, SHA-256".
Mac: "Every implementation of the Java platform is required to support
the following standard Mac algorithms: HmacSHA1, HmacSHA256".
- See Also:
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSCRAM-SHA-1 mechanism, defined in RFC-5802.SCRAM-SHA-1-PLUS mechanism, defined in RFC-5802.SCRAM-SHA-224 mechanism, not defined in an RFC.SCRAM-SHA-224-PLUS mechanism, not defined in an RFC.SCRAM-SHA-256 mechanism, defined in RFC-7677.SCRAM-SHA-256-PLUS mechanism, defined in RFC-7677.SCRAM-SHA-384 mechanism, not defined in an RFC.SCRAM-SHA-384-PLUS mechanism, not defined in an RFC.SCRAM-SHA-512 mechanism.SCRAM-SHA-512-PLUS mechanism. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ScramMechanismGets a SCRAM mechanism given its standard IANA name, supported by the Java security provider.@NotNull StringgetName()The name of the mechanism.booleanisPlus()The mechanism-PLUSrequire channel binding.List all the supported SCRAM mechanisms by this client implementation.static ScramMechanismReturns the enum constant of this type with the specified name.static ScramMechanism[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SCRAM_SHA_1
SCRAM-SHA-1 mechanism, defined in RFC-5802. -
SCRAM_SHA_1_PLUS
SCRAM-SHA-1-PLUS mechanism, defined in RFC-5802. -
SCRAM_SHA_224
SCRAM-SHA-224 mechanism, not defined in an RFC. -
SCRAM_SHA_224_PLUS
SCRAM-SHA-224-PLUS mechanism, not defined in an RFC. -
SCRAM_SHA_256
SCRAM-SHA-256 mechanism, defined in RFC-7677. -
SCRAM_SHA_256_PLUS
SCRAM-SHA-256-PLUS mechanism, defined in RFC-7677. -
SCRAM_SHA_384
SCRAM-SHA-384 mechanism, not defined in an RFC. -
SCRAM_SHA_384_PLUS
SCRAM-SHA-384-PLUS mechanism, not defined in an RFC. -
SCRAM_SHA_512
SCRAM-SHA-512 mechanism. -
SCRAM_SHA_512_PLUS
SCRAM-SHA-512-PLUS mechanism.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getName
The name of the mechanism.Must be a value registered under IANA: SASL SCRAM Family Mechanisms
- Returns:
- The mechanism name
-
isPlus
public boolean isPlus()The mechanism-PLUSrequire channel binding.- Returns:
- true if the mechanism requires channel binding
-
byName
Gets a SCRAM mechanism given its standard IANA name, supported by the Java security provider.- Parameters:
name- The standard IANA full name of the mechanism.- Returns:
- An instance that contains the ScramMechanism if it was found, or null otherwise.
- API Note:
- This will get only the mechanims supported by the Java security provider, if the
configured security provider lacks the algorithm this method will return
null.
-
supportedMechanisms
List all the supported SCRAM mechanisms by this client implementation.- Returns:
- A unmodifiable list of the IANA-registered, SCRAM supported mechanisms
-