public final class JasyptPasswordEncryptor extends Object implements PasswordEncryptor, Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
checkPassword(char[] plainPassword,
String storedPassword)
Checks an unencrypted password against an encrypted one to see if they match.
|
String |
encryptPassword(char[] plainPassword)
Encrypts a password.
|
static JasyptPasswordEncryptor |
newInstance(String algorithm,
int iterations,
int saltSizeBytes)
Creates a password encryptor that uses the Jasypt digester for password hashing with the specified values for
algorithm, iterations and saltSizeBytes.
|
public static final String NAME
public static JasyptPasswordEncryptor newInstance(String algorithm, int iterations, int saltSizeBytes)
algorithm
- the name of the message digest algorithm to be used for password hashing.
See the MessageDigest section in the
Java Cryptography Architecture Standard Algorithm Name Documentation
for information about standard algorithm names.iterations
- the number of times the password hash function will be applied recursivelysaltSizeBytes
- the size of the salt to be used, in bytesJasyptPasswordEncryptor
instance.public String encryptPassword(char[] plainPassword)
PasswordEncryptor
encryptPassword
in interface PasswordEncryptor
plainPassword
- the plaintext password as a cleanable char[]public boolean checkPassword(char[] plainPassword, String storedPassword)
PasswordEncryptor
checkPassword
in interface PasswordEncryptor
plainPassword
- the plaintext password as a cleanable char[]storedPassword
- the (BASE-64) digest from an earlier encryption against which to check the plaintext password
OACC is a Java Application Security Framework developed by Acciente, LLC., released under Apache License 2.0.
Copyright 2009-2017, Acciente, LLC.