public class PasswordService extends Object
| Constructor and Description |
|---|
PasswordService() |
| Modifier and Type | Method and Description |
|---|---|
String |
digest(String password)
Create a digest of the provided password, adding the used digester ID as a prefix.
|
String |
digest(String password,
boolean strong)
Create a digest of the provided password, adding the used digester ID as a prefix.
|
protected PasswordDigester |
getDefaultDigester() |
static PasswordService |
getInstance()
Returns an instance of this service.
|
boolean |
matches(String password,
String prefixedDigest)
Checks, if the provided clear text password matches the specified digest, considering all aspects like salt, hashing iterations, etc.
|
void |
registerDigester(PasswordDigester digester)
Adds the password digester into the registry.
|
void |
setDefaultDigester(PasswordDigester defaultDigester) |
void |
setDigesters(List<PasswordDigester> digesters) |
void |
setStrongDigester(PasswordDigester strongDigester) |
void |
unregisterDigester(String digesterId)
Adds the password digester to unregister.
|
public static PasswordService getInstance()
public String digest(String password)
password - the clear text password to be hashedpublic String digest(String password, boolean strong)
password - the clear text password to be hashedstrong - if the configured string digester should be used (mainly for root user the stronger digester is used than the default one)protected PasswordDigester getDefaultDigester()
public boolean matches(String password, String prefixedDigest)
password - the clear text password to be checkedprefixedDigest - the digest against which the password will be matched; it is expected that the digest is prefixed with a digester ID to be
used to the checktrue, if the provided password matches its hashed equivalentpublic void registerDigester(PasswordDigester digester)
digester - the password digester to be registeredpublic void setDefaultDigester(PasswordDigester defaultDigester)
public void setDigesters(List<PasswordDigester> digesters)
public void setStrongDigester(PasswordDigester strongDigester)
public void unregisterDigester(String digesterId)
digesterId - the ID of the password digester to be removed from the registryCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.