java.security.MessageDigest : "Every implementation of the Java platform is required to support the
following standard MessageDigest algorithms: MD5, SHA-1, SHA-256".
javax.crypto.Mac : "Every implementation of the Java platform is required to support the following
standard Mac algorithms: HmacMD5, HmacSHA1, HmacSHA256".
| Modifier and Type | Field and Description |
|---|---|
| private static final Map | |
| private static final String | |
| private final boolean | |
| private final String | |
| private final String | |
| private final int | |
| private final String | |
| private static final String | |
| private final int | |
| private static final String | |
| public static final ScramMechanisms | |
| public static final ScramMechanisms | |
| public static final ScramMechanisms | |
| public static final ScramMechanisms |
| Access | Constructor and Description |
|---|---|
| private | ScramMechanisms(String name, String hashAlgorithmName, int keyLength, String hmacAlgorithmName, boolean channelBinding, int priority)
|
| Modifier and Type | Method and Description |
|---|---|
| public int | algorithmKeyLength()
Implements com. |
| public static ScramMechanisms | |
| public byte[] | digest(byte[]
the message message)Implements com. |
| protected String | Returns: The name of the hash algorithmMethod that returns the name of the hash algorithm. |
| protected String | Returns: The name of the HMAC algorithmMethod that returns the name of the HMAC algorithm. |
| public String | getName()
Implements com. |
| public byte[] | hmac(byte[]
the key key, byte[] the message message)Implements com. |
| public byte[] | saltedPassword(StringPreparation stringPreparation, String password, byte[] salt, int iterations)
Implements com. |
| public static ScramMechanism | Returns: The selected mechanism, or null if no mechanism matchedThe type of matching mechanism searched for channelBinding, String... The mechanisms supported by the other peer peerMechanisms)This class classifies SCRAM mechanisms by two properties: whether they support channel binding; and a priority, which is higher for safer algorithms (like SHA-256 vs SHA-1). |
| public boolean | supportsChannelBinding()
Implements com. |
| public static ScramMechanisms | |
| public static ScramMechanisms[] | |
| private static Map |
| BY_NAME_MAPPING | back to summary |
|---|---|
| private static final Map<String, ScramMechanisms> BY_NAME_MAPPING | |
| CHANNEL_BINDING_SUFFIX | back to summary |
|---|---|
| private static final String CHANNEL_BINDING_SUFFIX | |
| channelBinding | back to summary |
|---|---|
| private final boolean channelBinding | |
| hashAlgorithmName | back to summary |
|---|---|
| private final String hashAlgorithmName | |
| hmacAlgorithmName | back to summary |
|---|---|
| private final String hmacAlgorithmName | |
| keyLength | back to summary |
|---|---|
| private final int keyLength | |
| mechanismName | back to summary |
|---|---|
| private final String mechanismName | |
| PBKDF2_PREFIX_ALGORITHM_NAME | back to summary |
|---|---|
| private static final String PBKDF2_PREFIX_ALGORITHM_NAME | |
| priority | back to summary |
|---|---|
| private final int priority | |
| SCRAM_MECHANISM_NAME_PREFIX | back to summary |
|---|---|
| private static final String SCRAM_MECHANISM_NAME_PREFIX | |
| SCRAM_SHA_1 | back to summary |
|---|---|
| public static final ScramMechanisms SCRAM_SHA_1 | |
| SCRAM_SHA_1_PLUS | back to summary |
|---|---|
| public static final ScramMechanisms SCRAM_SHA_1_PLUS | |
| SCRAM_SHA_256 | back to summary |
|---|---|
| public static final ScramMechanisms SCRAM_SHA_256 | |
| SCRAM_SHA_256_PLUS | back to summary |
|---|---|
| public static final ScramMechanisms SCRAM_SHA_256_PLUS | |
| ScramMechanisms | back to summary |
|---|---|
| private ScramMechanisms(String name, String hashAlgorithmName, int keyLength, String hmacAlgorithmName, boolean channelBinding, int priority) | |
| algorithmKeyLength | back to summary |
|---|---|
| public int algorithmKeyLength() Implements com. Doc from com. Returns the length of the key length of the algorithm.
| |
| byName | back to summary |
|---|---|
| public static ScramMechanisms byName(String name) Gets a SCRAM mechanism, given its standard IANA name.
| |
| digest | back to summary |
|---|---|
| public byte[] digest(byte[] message) Implements com. Doc from com. Calculate a message digest, according to the algorithm of the SCRAM mechanism.
| |
| getHashAlgorithmName | back to summary |
|---|---|
| protected String getHashAlgorithmName() Method that returns the name of the hash algorithm. It is protected since should be of no interest for direct users. The instance is supposed to provide abstractions over the algorithm names, and are not meant to be directly exposed.
| |
| getHmacAlgorithmName | back to summary |
|---|---|
| protected String getHmacAlgorithmName() Method that returns the name of the HMAC algorithm. It is protected since should be of no interest for direct users. The instance is supposed to provide abstractions over the algorithm names, and are not meant to be directly exposed.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements com. Doc from com. The name of the mechanism, which must be a value registered under IANA: SASL SCRAM Family Mechanisms | |
| hmac | back to summary |
|---|---|
| public byte[] hmac(byte[] key, byte[] message) Implements com. Doc from com. Calculate the hmac of a key and a message, according to the algorithm of the SCRAM mechanism.
| |
| saltedPassword | back to summary |
|---|---|
| public byte[] saltedPassword(StringPreparation stringPreparation, String password, byte[] salt, int iterations) Implements com. Doc from com. Compute the salted password
| |
| selectMatchingMechanism | back to summary |
|---|---|
| public static ScramMechanism selectMatchingMechanism(boolean channelBinding, String... peerMechanisms) This class classifies SCRAM mechanisms by two properties: whether they support channel binding; and a priority, which is higher for safer algorithms (like SHA-256 vs SHA-1). Given a list of SCRAM mechanisms supported by the peer, pick one that matches the channel binding requirements and has the highest priority.
| |
| supportsChannelBinding | back to summary |
|---|---|
| public boolean supportsChannelBinding() Implements com. Doc from com. Whether this mechanism supports channel binding
| |
| valueOf | back to summary |
|---|---|
| public static ScramMechanisms valueOf(String name) | |
| values | back to summary |
|---|---|
| public static ScramMechanisms[] values() | |
| valuesAsMap | back to summary |
|---|---|
| private static Map | |