Package org.apache.shiro.crypto.hash
Class SimpleHashProvider
java.lang.Object
org.apache.shiro.crypto.hash.SimpleHashProvider
- All Implemented Interfaces:
HashSpi
Creates a hash provider for salt (+pepper) and Hash-based KDFs, i.e. where the algorithm name
is a SHA algorithm or similar.
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.shiro.crypto.hash.HashSpi
HashSpi.HashFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromString(String format) Creates a Hash instance from the given format string recognized by this provider.A list of algorithms recognized by this implementation.newHashFactory(Random random) A factory class for the hash of the type<T>.
-
Constructor Details
-
SimpleHashProvider
public SimpleHashProvider()
-
-
Method Details
-
getImplementedAlgorithms
Description copied from interface:HashSpiA list of algorithms recognized by this implementation.Example values are
argon2idandargon2ifor the Argon2 service provider and2yand2afor the BCrypt service provider.- Specified by:
getImplementedAlgorithmsin interfaceHashSpi- Returns:
- a set of recognized algorithms.
-
fromString
Description copied from interface:HashSpiCreates a Hash instance from the given format string recognized by this provider.There is no global format which this provider must accept. Each provider can define their own format, but they are usually based on the
crypt(3)formats used in/etc/shadowfiles.Implementations should overwrite this javadoc to add examples of the accepted formats.
- Specified by:
fromStringin interfaceHashSpi- Parameters:
format- the format string to be parsed by this implementation.- Returns:
- a class extending Hash.
-
newHashFactory
Description copied from interface:HashSpiA factory class for the hash of the type<T>.Implementations are highly encouraged to use the given random parameter as source of random bytes (e.g. for seeds).
- Specified by:
newHashFactoryin interfaceHashSpi- Parameters:
random- a source ofRandom, usuallySecureRandom.- Returns:
- a factory class for creating instances of
<T>.
-