Package org.appng.core.security
Interface SaltedDigest
-
- All Known Implementing Classes:
SaltedDigestSha1
public interface SaltedDigest
Provides methods required to create a salted hash of a given secret. Different implementations may provide stronger or weaker algorithms as well as better or poorer performance.- Author:
- Matthias Herlitzius
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getDigest(String secret, String salt)
Returns a salted hash of the submitted secret.String
getSalt()
Generates a random salt.
-
-
-
Method Detail
-
getDigest
String getDigest(String secret, String salt)
Returns a salted hash of the submitted secret.- Parameters:
secret
- The cleartext secret.salt
- The salt which should have been generated by thegetSalt()
method of the respective implementation.- Returns:
- The salted hash (digest).
-
getSalt
String getSalt()
Generates a random salt. Can be used together with thegetDigest(String, String)
method of the respective implementation.- Returns:
- the random salt
-
-