Class SecretKeyCredentialHandler

    • Method Detail

      • getKeyLength

        public int getKeyLength()
      • setKeyLength

        public void setKeyLength​(int keyLength)
      • matches

        public boolean matches​(String inputCredentials,
                               String storedCredentials)
        Description copied from interface: CredentialHandler
        Checks to see if the input credentials match the stored credentials
        Parameters:
        inputCredentials - User provided credentials
        storedCredentials - Credentials stored in the Realm
        Returns:
        true if the inputCredentials match the storedCredentials, otherwise false
      • mutate

        protected String mutate​(String inputCredentials,
                                byte[] salt,
                                int iterations)
        Description copied from class: DigestCredentialHandlerBase
        Generates the equivalent stored credentials for the given input credentials, salt and iterations. If the algorithm requires a key length, the default will be used.
        Specified by:
        mutate in class DigestCredentialHandlerBase
        Parameters:
        inputCredentials - User provided credentials
        salt - Salt, if any
        iterations - Number of iterations of the algorithm associated with this CredentialHandler applied to the inputCredentials to generate the equivalent stored credentials
        Returns:
        The equivalent stored credentials for the given input credentials or null if the generation fails
      • mutate

        protected String mutate​(String inputCredentials,
                                byte[] salt,
                                int iterations,
                                int keyLength)
        Description copied from class: DigestCredentialHandlerBase
        Generates the equivalent stored credentials for the given input credentials, salt, iterations and key length. The default implementation calls ignores the key length and calls DigestCredentialHandlerBase.mutate(String, byte[], int). Sub-classes that use the key length should override this method.
        Overrides:
        mutate in class DigestCredentialHandlerBase
        Parameters:
        inputCredentials - User provided credentials
        salt - Salt, if any
        iterations - Number of iterations of the algorithm associated with this CredentialHandler applied to the inputCredentials to generate the equivalent stored credentials
        keyLength - Length of the produced digest in bits for implementations where it's applicable
        Returns:
        The equivalent stored credentials for the given input credentials or null if the generation fails