Interface UnixDESCryptPassword

    • Method Detail

      • getSalt

        short getSalt()
        Get the salt of this password as a short.
        Returns:
        the salt
      • getHash

        byte[] getHash()
        Get the crypt bytes, not including the salt.
        Returns:
        the crypt bytes
      • getParameterSpec

        default SaltedPasswordAlgorithmSpec getParameterSpec()
        Description copied from interface: Password
        Get the applicable algorithm parameter specification for this password type.
        Specified by:
        getParameterSpec in interface Password
        Returns:
        the algorithm parameter specification, or null if this password type does not support algorithms
      • impliesParameters

        default boolean impliesParameters​(AlgorithmParameterSpec parameterSpec)
        Description copied from interface: Password
        Determine if this password is matched by the given parameter specification.
        Specified by:
        impliesParameters in interface Password
        Parameters:
        parameterSpec - the parameter specification (must not be null)
        Returns:
        true if the password is matched by the parameters, false otherwise
      • createRaw

        static UnixDESCryptPassword createRaw​(String algorithm,
                                              short salt,
                                              byte[] hash)
        Create a raw implementation of this password type. No validation of the content is performed, and the password must be "adopted" in to a PasswordFactory (via the PasswordFactory.translate(Password) method) before it can be validated and used to verify guesses.
        Parameters:
        algorithm - the algorithm name
        salt - the salt
        hash - the hash
        Returns:
        the raw password implementation