public interface PasswordEncoder
Modifier and Type | Method and Description |
---|---|
String |
encodePassword(String rawPass)
Encodes the specified raw password with an implementation specific algorithm.
|
boolean |
isPasswordValid(String encPass,
String rawPass)
Validates a specified "raw" password against an encoded password.
|
String encodePassword(String rawPass) throws EncodingException
This will generally be a one-way message digest such as MD5 or SHA, but may also be a plaintext variant which does no encoding at all, but rather returns the same password it was fed. The latter is useful to plug in when the original password must be stored as-is.
rawPass
- the password to encodeEncodingException
- if couldn't encode the raw passwordboolean isPasswordValid(String encPass, String rawPass) throws EncodingException
The encoded password
should have previously been generated by encodePassword(String)
. This method will
encode the rawPass
, and then compare it with the presented encPass
.
encPass
- a pre-encoded passwordrawPass
- a raw password to encode and compare against the pre-encoded passwordEncodingException
- if couldn't encode the raw password (see encodePassword(String)
)Copyright © GigaSpaces.