Class HashCreatorImplMultipleRounds

    • Constructor Detail

      • HashCreatorImplMultipleRounds

        public HashCreatorImplMultipleRounds​(String hashAlgorithm,
                                             SecurityProvider provider,
                                             int iterationCount)
        The constructor.
        Parameters:
        hashAlgorithm - the name of the hash algorithm to use (e.g. "SHA-256").
        iterationCount - AbstractGetIterationCount. Has to be greater than 1.
        provider - the SecurityProvider to use.
    • Method Detail

      • hash

        public byte[] hash​(boolean reset)
        Specified by:
        hash in interface HashCreator
        Overrides:
        hash in class HashCreatorImplDigest
        Parameters:
        reset - - true if this HashCreator shall be reset after the hash calculation, false otherwise. A design problem of MessageDigest is that it automatically resets itself on hashing what prevents calculating intermediate hashes but also continue the hash calculation. This API allows to workaround this limitation.
        Returns:
        the calculated hash of the current data.
        See Also:
        MessageDigest.digest()