Package org.apache.shiro.crypto.hash
Interface Hash
-
- All Superinterfaces:
org.apache.shiro.util.ByteSource
- All Known Implementing Classes:
AbstractHash,Md2Hash,Md5Hash,Sha1Hash,Sha256Hash,Sha384Hash,Sha512Hash,SimpleHash
public interface Hash extends org.apache.shiro.util.ByteSourceA CryptographicHashrepresents a one-way conversion algorithm that transforms an input source to an underlying byte array. Hex and Base64-encoding output of the hashed bytes are automatically supported by the inheritedtoHex()andtoBase64()methods. The bytes returned by the parent interface'sgetBytes()are the hashed value of the original input source, also known as the 'checksum' or 'digest'.- Since:
- 0.9
- See Also:
Md2Hash,Md5Hash,Sha1Hash,Sha256Hash,Sha384Hash,Sha512Hash
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAlgorithmName()Returns the name of the algorithm used to hash the input source, for example,SHA-256,MD5, etc.intgetIterations()Returns the number of hash iterations used to compute the hash.org.apache.shiro.util.ByteSourcegetSalt()Returns a salt used to compute the hash ornullif no salt was used.
-
-
-
Method Detail
-
getAlgorithmName
String getAlgorithmName()
Returns the name of the algorithm used to hash the input source, for example,SHA-256,MD5, etc. The name is expected to be aMessageDigestalgorithm name.- Returns:
- the the name of the algorithm used to hash the input source, for example,
SHA-256,MD5, etc. - Since:
- 1.1
-
getSalt
org.apache.shiro.util.ByteSource getSalt()
Returns a salt used to compute the hash ornullif no salt was used.- Returns:
- a salt used to compute the hash or
nullif no salt was used. - Since:
- 1.2
-
getIterations
int getIterations()
Returns the number of hash iterations used to compute the hash.- Returns:
- the number of hash iterations used to compute the hash.
- Since:
- 1.2
-
-