Package org.appng.core.security
Class SaltedDigestSha1
- java.lang.Object
-
- org.appng.core.security.SaltedDigestSha1
-
- All Implemented Interfaces:
SaltedDigest
public class SaltedDigestSha1 extends Object implements SaltedDigest
Provides methods required to create a salted hash of a given secret using the SHA-1 algorithm.- Author:
- Matthias Herlitzius
-
-
Constructor Summary
Constructors Constructor Description SaltedDigestSha1()
-
Method Summary
All Methods Instance Methods Concrete 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
public String getDigest(String secret, String salt)
Description copied from interface:SaltedDigest
Returns a salted hash of the submitted secret.- Specified by:
getDigest
in interfaceSaltedDigest
- Parameters:
secret
- The cleartext secret.salt
- The salt which should have been generated by theSaltedDigest.getSalt()
method of the respective implementation.- Returns:
- The salted hash (digest).
-
getSalt
public String getSalt()
Description copied from interface:SaltedDigest
Generates a random salt. Can be used together with theSaltedDigest.getDigest(String, String)
method of the respective implementation.- Specified by:
getSalt
in interfaceSaltedDigest
- Returns:
- the random salt
-
-