Package com.gigaspaces.security.encoding
Interface PasswordEncoder
- All Known Implementing Classes:
Md5PasswordEncoder
public interface PasswordEncoder
Interface for performing one-way encryption and authenticity validation on a password.
- Since:
- 7.0.1
- Author:
- Moran Avigdor
-
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.
-
Method Details
-
encodePassword
Encodes 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.
- Parameters:
rawPass- the password to encode- Returns:
- encoded password
- Throws:
EncodingException- if couldn't encode the raw password
-
isPasswordValid
Validates a specified "raw" password against an encoded password.The encoded password should have previously been generated by
encodePassword(String). This method will encode therawPass, and then compare it with the presentedencPass.- 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 (seeencodePassword(String))
-