@Component(value="cuba_PasswordEncryption") public class PasswordEncryptionImpl extends java.lang.Object implements PasswordEncryption
Modifier and Type | Field and Description |
---|---|
protected EncryptionModule |
encryptionModule |
protected EncryptionModule |
legacyEncryptionModule |
NAME
Constructor and Description |
---|
PasswordEncryptionImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkPassword(User user,
java.lang.String password)
Check password for a user.
|
java.lang.String |
generateRandomPassword() |
protected EncryptionModule |
getEncryptionModule(java.lang.String encryptionMethod) |
HashDescriptor |
getHash(java.lang.String content)
Hashing string with salt.
|
java.lang.String |
getHash(java.lang.String content,
java.lang.String salt)
Hashing string.
|
java.lang.String |
getHashMethod() |
java.lang.String |
getPasswordHash(java.util.UUID userId,
java.lang.String password)
Hashing password to store it into DB.
|
java.lang.String |
getPlainHash(java.lang.String content)
Deprecated.
|
void |
setEncryptionModule(EncryptionModule encryptionModule) |
void |
setLegacyEncryptionModule(EncryptionModule legacyEncryptionModule) |
protected EncryptionModule encryptionModule
protected EncryptionModule legacyEncryptionModule
public void setEncryptionModule(EncryptionModule encryptionModule)
public void setLegacyEncryptionModule(EncryptionModule legacyEncryptionModule)
public java.lang.String generateRandomPassword()
generateRandomPassword
in interface PasswordEncryption
public java.lang.String getHashMethod()
getHashMethod
in interface PasswordEncryption
public HashDescriptor getHash(java.lang.String content)
PasswordEncryption
getHash
in interface PasswordEncryption
content
- string for hashingpublic java.lang.String getPasswordHash(java.util.UUID userId, java.lang.String password)
PasswordEncryption
getPasswordHash
in interface PasswordEncryption
userId
- user idpassword
- content for hashingpublic java.lang.String getHash(java.lang.String content, java.lang.String salt)
PasswordEncryption
getHash
in interface PasswordEncryption
content
- content for hashingsalt
- salt@Deprecated public java.lang.String getPlainHash(java.lang.String content)
PasswordEncryption
getPlainHash
in interface PasswordEncryption
content
- content for hashingpublic boolean checkPassword(User user, java.lang.String password)
PasswordEncryption
checkPassword
in interface PasswordEncryption
user
- userpassword
- password to check.protected EncryptionModule getEncryptionModule(java.lang.String encryptionMethod)