public class PBKDF2PasswordEncoder extends Object implements PasswordEncoder
PasswordEncoder that uses PBKDF2| Constructor and Description |
|---|
PBKDF2PasswordEncoder(byte[] salt,
int iterationCount,
int keyLength) |
| Modifier and Type | Method and Description |
|---|---|
String |
encode(String rawPassword)
Encodes given password.
|
String |
encode(String rawPassword,
byte[] salt,
boolean appendSalt) |
protected byte[] |
fromHex(String hex)
Converts a string of hexadecimal characters into a byte array.
|
protected String |
generateSalt() |
protected String |
toHex(byte[] array)
Converts a byte array into a hexadecimal string.
|
boolean |
verify(String rawPassword,
String encodedPassword)
Checks if the
rawPassword and encodedPassword matches. |
public static final String ALGO
public PBKDF2PasswordEncoder(byte[] salt,
int iterationCount,
int keyLength)
public String encode(String rawPassword)
PasswordEncoderEncodes given password.
encode in interface PasswordEncoderpublic boolean verify(String rawPassword, String encodedPassword)
PasswordEncoderChecks if the rawPassword and encodedPassword matches.
verify in interface PasswordEncoderprotected byte[] fromHex(String hex)
hex - the hex stringprotected String toHex(byte[] array)
array - the byte array to convertprotected String generateSalt()
Copyright © 2021. All rights reserved.