@ThreadSafe public class PasswordHashCreatorManager extends Object
IPasswordHashCreator instances| Constructor and Description |
|---|
PasswordHashCreatorManager() |
| Modifier and Type | Method and Description |
|---|---|
PasswordHash |
createUserDefaultPasswordHash(IPasswordSalt aSalt,
String sPlainTextPassword)
Create the password hash from the passed plain text password, using the
default password hash creator.
|
PasswordHash |
createUserPasswordHash(String sAlgorithmName,
IPasswordSalt aSalt,
String sPlainTextPassword)
Create the password hash from the passed plain text password, using the
default password hash creator.
|
Set<String> |
getAllPasswordHashCreatorAlgorithms() |
Collection<IPasswordHashCreator> |
getAllPasswordHashCreators() |
IPasswordHashCreator |
getDefaultPasswordHashCreator() |
String |
getDefaultPasswordHashCreatorAlgorithmName() |
IPasswordHashCreator |
getPasswordHashCreatorOfAlgorithm(String sAlgorithmName)
Get the password hash creator of the specified algorithm name.
|
void |
registerPasswordHashCreator(IPasswordHashCreator aPasswordHashCreator)
Register a new password hash creator.
|
void |
setDefaultPasswordHashCreatorAlgorithm(String sAlgorithm)
Set the default password hash creator algorithm.
|
String |
toString() |
void |
unregisterPasswordHashCreator(IPasswordHashCreator aPasswordHashCreator) |
public void registerPasswordHashCreator(@Nonnull IPasswordHashCreator aPasswordHashCreator)
aPasswordHashCreator - The password hash creator to be registered. May not be
null.public void unregisterPasswordHashCreator(@Nullable IPasswordHashCreator aPasswordHashCreator)
@Nullable public IPasswordHashCreator getPasswordHashCreatorOfAlgorithm(@Nullable String sAlgorithmName)
sAlgorithmName - The algorithm name to query. May be null.null if no such hash creator is registered.@Nonnull @ReturnsMutableCopy public Set<String> getAllPasswordHashCreatorAlgorithms()
@Nonnull @ReturnsMutableCopy public Collection<IPasswordHashCreator> getAllPasswordHashCreators()
public void setDefaultPasswordHashCreatorAlgorithm(@Nonnull@Nonempty String sAlgorithm)
IPasswordHashCreator object must be registered previously using
registerPasswordHashCreator(IPasswordHashCreator).sAlgorithm - The name of the algorithm to use as the default. May neither be
null nor empty.@Nonnull public IPasswordHashCreator getDefaultPasswordHashCreator()
IPasswordHashCreator algorithm to use. Never
null.@Nonnull public String getDefaultPasswordHashCreatorAlgorithmName()
@Nonnull public PasswordHash createUserDefaultPasswordHash(@Nullable IPasswordSalt aSalt, @Nonnull String sPlainTextPassword)
aSalt - Optional salt to be used. This parameter is only null
for backwards compatibility reasons.sPlainTextPassword - Plain text password. May not be null.null.getDefaultPasswordHashCreator()@Nonnull public PasswordHash createUserPasswordHash(@Nonnull@Nonempty String sAlgorithmName, @Nullable IPasswordSalt aSalt, @Nonnull String sPlainTextPassword)
sAlgorithmName - The password hash creator algorithm name to query. May neither be
null nor empty.aSalt - Optional salt to be used. This parameter is only null
for backwards compatibility reasons.sPlainTextPassword - Plain text password. May not be null.null.getDefaultPasswordHashCreator()Copyright © 2014–2015 Philip Helger. All rights reserved.