Class Md5PasswordEncoder
java.lang.Object
com.gigaspaces.security.encoding.md5.Md5PasswordEncoder
- All Implemented Interfaces:
PasswordEncoder
Encodes passwords using the MD5 algorithm. The encoded password is returned as Hex (32 char)
version of the hash bytes.
- Since:
- 7.0.1
- Author:
- Moran Avigdor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencodePassword(String rawPass) Encodes the specified raw password with an implementation specific algorithm.booleanisPasswordValid(String encPass, String rawPass) Validates a specified "raw" password against an encoded password.
-
Constructor Details
-
Md5PasswordEncoder
public Md5PasswordEncoder()
-
-
Method Details
-
encodePassword
Description copied from interface:PasswordEncoderEncodes the specified raw password with an implementation specific algorithm.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.
- Specified by:
encodePasswordin interfacePasswordEncoder- Parameters:
rawPass- the password to encode- Returns:
- encoded password
- Throws:
EncodingException- if couldn't encode the raw password
-
isPasswordValid
Description copied from interface:PasswordEncoderValidates a specified "raw" password against an encoded password.The encoded password should have previously been generated by
PasswordEncoder.encodePassword(String). This method will encode therawPass, and then compare it with the presentedencPass.- Specified by:
isPasswordValidin interfacePasswordEncoder- Parameters:
encPass- a pre-encoded passwordrawPass- a raw password to encode and compare against the pre-encoded password- Returns:
- true if the password is valid, false otherwise
- Throws:
EncodingException- if couldn't encode the raw password (seePasswordEncoder.encodePassword(String))
-