public class Md5PasswordEncoder extends Object implements PasswordEncoder
|Constructor and Description|
|Modifier and Type||Method and Description|
Encodes the specified raw password with an implementation specific algorithm.
Validates a specified "raw" password against an encoded password.
public 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 encode
EncodingException- if couldn't encode the raw password
public boolean isPasswordValid(String encPass, String rawPass) throws EncodingException
The encoded password
should have previously been generated by
PasswordEncoder.encodePassword(String) . This method will
rawPass, and then compare it with the presented
encPass- a pre-encoded password
rawPass- a raw password to encode and compare against the pre-encoded password
EncodingException- if couldn't encode the raw password (see
Copyright © GigaSpaces.