public class SaltingEncryptor extends Object implements Encryptor
The implementation works correctly with decrypting both salted and non-salted passwords, so after enabling no migration of the existing passwords will be needed. Nevertheless, new encrypted passwords will be salted.
Constructor and Description |
---|
SaltingEncryptor(Encryptor delegate) |
Modifier and Type | Method and Description |
---|---|
boolean |
changeEncryptionKey()
Generate new encryption key, which should be used to encrypt password in following calls to
Encryptor.encrypt(java.lang.String) . |
String |
decrypt(String encryptedPassword)
Decrypt encrypted password, and return its original value.
|
String |
encrypt(String password)
Encrypt plaintext password, and return encrypted value which can later be used in decrypt method to get plaintext password.
|
public SaltingEncryptor(Encryptor delegate)
public String encrypt(String password)
Encryptor
public String decrypt(String encryptedPassword)
Encryptor
In case of any error during decryption (such as missing decryption key) return encryptedPassword
.
public boolean changeEncryptionKey()
Encryptor
Encryptor.encrypt(java.lang.String)
.changeEncryptionKey
in interface Encryptor
Copyright © 2021 Atlassian. All rights reserved.