@Component(value="cuba_Sha1EncryptionModule") public class Sha1EncryptionModule extends java.lang.Object implements EncryptionModule
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ALGORITHM |
protected static int |
DERIVED_KEY_LENGTH_BITS |
protected static int |
ITERATIONS |
protected static java.lang.String |
RANDOMIZE_ALGORITHM |
protected static int |
SALT_LENGTH_BYTES |
protected static java.lang.String |
STATIC_SALT |
Constructor and Description |
---|
Sha1EncryptionModule() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
apply(java.lang.String content,
byte[] salt) |
boolean |
checkPassword(User user,
java.lang.String password) |
protected java.lang.String |
generateSalt() |
HashDescriptor |
getHash(java.lang.String content) |
java.lang.String |
getHash(java.lang.String content,
java.lang.String salt) |
java.lang.String |
getHashMethod() |
protected java.security.spec.KeySpec |
getKeySpec(java.lang.String content,
byte[] salt) |
java.lang.String |
getPasswordHash(java.util.UUID userId,
java.lang.String password) |
java.lang.String |
getPlainHash(java.lang.String content) |
protected static final java.lang.String ALGORITHM
protected static final java.lang.String RANDOMIZE_ALGORITHM
protected static final int DERIVED_KEY_LENGTH_BITS
protected static final int SALT_LENGTH_BYTES
protected static final int ITERATIONS
protected static final java.lang.String STATIC_SALT
public java.lang.String getHashMethod()
getHashMethod
in interface EncryptionModule
public HashDescriptor getHash(java.lang.String content)
getHash
in interface EncryptionModule
public java.lang.String getPasswordHash(java.util.UUID userId, java.lang.String password)
getPasswordHash
in interface EncryptionModule
public java.lang.String getHash(java.lang.String content, java.lang.String salt)
getHash
in interface EncryptionModule
public java.lang.String getPlainHash(java.lang.String content)
getPlainHash
in interface EncryptionModule
public boolean checkPassword(User user, java.lang.String password)
checkPassword
in interface EncryptionModule
protected java.lang.String generateSalt() throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException
protected java.security.spec.KeySpec getKeySpec(java.lang.String content, byte[] salt)
protected java.lang.String apply(java.lang.String content, byte[] salt) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException
java.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException