public class GenericSaltedPasswordEncoder extends Object implements PasswordEncoder
SaltEncodingPolicy
and digest algorithm name. Algorithm name must be supported by MessageDigest| Constructor and Description |
|---|
GenericSaltedPasswordEncoder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(String uid,
String encoded,
String password)
Calculates the hash of 'plain' and compare it with the value of 'encoded'.
|
String |
decode(String encoded)
Decode the given
encoded password. |
String |
encode(String uid,
String password)
This method add salt to the password and then calculates digest
|
String |
getAlgorithm() |
void |
setAlgorithm(String algorithm)
Sets
MessageDigest algorithm used by this bean |
void |
setSaltEncodingPolicy(SaltEncodingPolicy saltEncodingPolicy) |
public String encode(String uid, String password)
encode in interface PasswordEncoderuid - the user idpassword - the user passwordSaltedMD5PasswordEncoder,
PlainTextPasswordEncoderpublic boolean check(String uid, String encoded, String password)
check in interface PasswordEncoderuid - the user idencoded - could be 'null'password - could be 'null'MD5PasswordEncoderpublic final String decode(String encoded) throws EJBCannotDecodePasswordException
PasswordEncoderencoded password. Throws exception if this is not possible.decode in interface PasswordEncoderencoded - the encoded passwordEJBCannotDecodePasswordException - if the password cannot be decoded. (MD5 passwords cannot be decoded)MD5PasswordEncoderpublic String getAlgorithm()
public void setAlgorithm(String algorithm)
MessageDigest algorithm used by this beanalgorithm - message digest algorithmpublic void setSaltEncodingPolicy(SaltEncodingPolicy saltEncodingPolicy)
Copyright © 2017 SAP SE. All Rights Reserved.