Class ScramBase

  • Direct Known Subclasses:
    ScramClient

    public abstract class ScramBase
    extends Object
    A base SCRAM implementation.
    • Method Detail

      • computeSaltedPassword

        public final byte[] computeSaltedPassword​(char[] password,
                                                  byte[] salt,
                                                  int iterationCount)
                                           throws InvalidKeyException,
                                                  NoSuchAlgorithmException
        Computes the salted password.
        Parameters:
        password - The password.
        salt - The salt.
        iterationCount - The iteration count.
        Returns:
        The salted password.
        Throws:
        InvalidKeyException - If the key is invalid.
        NoSuchAlgorithmException - If the hash algorithm does not exist.
      • computeStoredKey

        public final byte[] computeStoredKey​(byte[] clientKey)
                                      throws NoSuchAlgorithmException
        Computes the stored key.
        Parameters:
        clientKey - The client key.
        Returns:
        The stored key.
        Throws:
        NoSuchAlgorithmException - If the hash algorithm does not exist.
      • getMechanismName

        public final String getMechanismName()
        Gets the mechanism name, i.e "SCRAM-" + the hash algorithm name.
        Returns:
        The mechanism name.
      • isComplete

        public final boolean isComplete()
      • getNegotiatedProperty

        public final Object getNegotiatedProperty​(String propName)
      • dispose

        public final void dispose()