Interface OneTimePassword

    • Method Detail

      • getHash

        byte[] getHash()
        Get the hash represented by this password.
        Returns:
        the hash represented by this password
      • getSeed

        String getSeed()
        Get the seed used to generate the hash.
        Returns:
        the seed used to generate the hash
      • getSequenceNumber

        int getSequenceNumber()
        Get the sequence number used to generate the hash.
        Returns:
        the sequence number used to generate the hash
      • getParameterSpec

        default OneTimePasswordAlgorithmSpec 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 OneTimePassword createRaw​(String algorithm,
                                         byte[] hash,
                                         String seed,
                                         int sequenceNumber)
        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
        hash - the hash
        seed - the seed
        sequenceNumber - the sequence number
        Returns:
        the raw password implementation