|
|||||||||
| Home >> All >> org >> acegisecurity >> providers >> [ encoding overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.acegisecurity.providers.encoding
Class Md5PasswordEncoder

java.lang.Objectorg.acegisecurity.providers.encoding.BasePasswordEncoder
org.acegisecurity.providers.encoding.BaseDigestPasswordEncoder
org.acegisecurity.providers.encoding.Md5PasswordEncoder
- All Implemented Interfaces:
- PasswordEncoder
- public class Md5PasswordEncoder
- extends BaseDigestPasswordEncoder
- implements PasswordEncoder
- extends BaseDigestPasswordEncoder
MD5 implementation of PasswordEncoder.
If a null password is presented, it will be treated as an empty
String ("") password.
As MD5 is a one-way hash, the salt can contain any characters.
- Version:
- $Id: Md5PasswordEncoder.java,v 1.4 2005/11/17 00:55:49 benalex Exp $
| Field Summary |
| Fields inherited from class org.acegisecurity.providers.encoding.BaseDigestPasswordEncoder |
|
| Constructor Summary | |
Md5PasswordEncoder()
|
|
| Method Summary | |
private java.lang.String |
encodeInternal(java.lang.String input)
|
java.lang.String |
encodePassword(java.lang.String rawPass,
java.lang.Object salt)
Encodes the specified raw password with an implementation specific algorithm. |
boolean |
isPasswordValid(java.lang.String encPass,
java.lang.String rawPass,
java.lang.Object salt)
Validates a specified "raw" password against an encoded password. |
| Methods inherited from class org.acegisecurity.providers.encoding.BaseDigestPasswordEncoder |
getEncodeHashAsBase64, setEncodeHashAsBase64 |
| Methods inherited from class org.acegisecurity.providers.encoding.BasePasswordEncoder |
demergePasswordAndSalt, mergePasswordAndSalt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
Md5PasswordEncoder
public Md5PasswordEncoder()
| Method Detail |
isPasswordValid
public boolean isPasswordValid(java.lang.String encPass, java.lang.String rawPass, java.lang.Object salt)
- Description copied from interface:
PasswordEncoder Validates a specified "raw" password against an encoded password.
The encoded password should have previously been generated by
PasswordEncoder.encodePassword(String, Object)55 . This method will encode therawPass(using the optionalsalt), and then compared it with the presentedencPass.For a discussion of salts, please refer to
PasswordEncoder.encodePassword(String, Object)55 .- Specified by:
isPasswordValidin interfacePasswordEncoder
encodePassword
public java.lang.String encodePassword(java.lang.String rawPass, java.lang.Object salt)
- Description copied from interface:
PasswordEncoder 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.
The specified salt will potentially be used by the implementation to "salt" the initial value before encoding. A salt is usually a user-specific value which is added to the password before the digest is computed. This means that computation of digests for common dictionary words will be different than those in the backend store, because the dictionary word digests will not reflect the addition of the salt. If a per-user salt is used (rather than a system-wide salt), it also means users with the same password will have different digest encoded passwords in the backend store.
If a salt value is provided, the same salt value must be use when calling the
PasswordEncoder.isPasswordValid(String, String, Object)55 method. Note that a specific implementation may choose to ignore the salt value (vianull), or provide its own.- Specified by:
encodePasswordin interfacePasswordEncoder
encodeInternal
private java.lang.String encodeInternal(java.lang.String input)
|
|||||||||
| Home >> All >> org >> acegisecurity >> providers >> [ encoding overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC