public class BCryptPasswordHandler extends Object implements PasswordHandler
| Constructor and Description |
|---|
BCryptPasswordHandler(AuthSubject authSubject) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyPassword(String password)
Hashes and sets the password, clears the salt, sets the last changed date for the password
|
String |
calculatePasswordResetDigest()
Calculates, sets and returns a salted digest which can be used for the "Forgot password?" function.
|
static String |
getPrefix()
Returns the identifier of the bcrypt algorithm.
|
boolean |
isValidPassword(String password)
Checks whether the password is valid for the current
AuthSubject. |
boolean |
isValidPasswordResetDigest(String digest)
Checks whether the digest is valid for the current
AuthSubject. |
void |
migrate(CoreService service,
String password)
Migrates passwords of the current
PasswordHandler instance to passwords handled by
CoreService.getDefaultPasswordHandler(org.appng.api.model.AuthSubject). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPasswordResetDigest, savePassword, updateSubjectpublic BCryptPasswordHandler(AuthSubject authSubject)
public void applyPassword(String password)
PasswordHandlerapplyPassword in interface PasswordHandlerpassword - The cleartext password.AuthSubject.setDigest(String),
AuthSubject.setSalt(String),
AuthSubject.setPasswordLastChanged(java.util.Date)public boolean isValidPassword(String password)
PasswordHandlerAuthSubject.isValidPassword in interface PasswordHandlerpassword - The cleartext password.true if the password is valid, false if it is invalid.AuthSubject.getDigest()public String calculatePasswordResetDigest()
PasswordHandlercalculatePasswordResetDigest in interface PasswordHandlerAuthSubject.setSalt(String),
PasswordHandler.isValidPasswordResetDigest(String)public boolean isValidPasswordResetDigest(String digest)
PasswordHandlerAuthSubject.isValidPasswordResetDigest in interface PasswordHandlerdigest - The digest.true if the digest is valid, false if it is invalid.AuthSubject.getSalt(),
PasswordHandler.calculatePasswordResetDigest()public void migrate(CoreService service, String password)
PasswordHandlerPasswordHandler instance to passwords handled by
CoreService.getDefaultPasswordHandler(org.appng.api.model.AuthSubject).migrate in interface PasswordHandlerservice - Instance of CoreServicepassword - The current password.public static String getPrefix()
Copyright © 2011–2023 aiticon GmbH. All rights reserved.