@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 EncryptionModulepublic HashDescriptor getHash(java.lang.String content)
getHash in interface EncryptionModulepublic java.lang.String getPasswordHash(java.util.UUID userId,
java.lang.String password)
getPasswordHash in interface EncryptionModulepublic java.lang.String getHash(java.lang.String content,
java.lang.String salt)
getHash in interface EncryptionModulepublic java.lang.String getPlainHash(java.lang.String content)
getPlainHash in interface EncryptionModulepublic boolean checkPassword(User user, java.lang.String password)
checkPassword in interface EncryptionModuleprotected java.lang.String generateSalt()
throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmExceptionprotected 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.NoSuchAlgorithmExceptionjava.security.spec.InvalidKeySpecException