|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.security.CmsDefaultPasswordHandler
public class CmsDefaultPasswordHandler
Default implementation for OpenCms password validation, just checks if a password is at last 4 characters long.
Field Summary | |
---|---|
static int |
PASSWORD_MIN_LENGTH
The minimum length of a password. |
Fields inherited from interface org.opencms.security.I_CmsPasswordHandler |
---|
CONVERT_DIGEST_ENCODING, DIGEST_TYPE_MD5, DIGEST_TYPE_PLAIN, DIGEST_TYPE_SHA, DIGEST_TYPE_SSHA |
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler |
---|
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD |
Constructor Summary | |
---|---|
CmsDefaultPasswordHandler()
The constructor does not perform any operation. |
Method Summary | |
---|---|
void |
addConfigurationParameter(java.lang.String paramName,
java.lang.String paramValue)
Adds a configuration parameter to this parameter configurable class instance. |
java.lang.String |
digest(java.lang.String password)
Creates an OpenCms password digest according to the default setting for method/encodings. |
java.lang.String |
digest(java.lang.String password,
java.lang.String digestType,
java.lang.String inputEncoding)
Creates an OpenCms password digest. |
java.util.Map |
getConfiguration()
Returns the configuration of this parameter configurable class instance, or null if the class does not need to be configured. |
java.lang.String |
getDigestType()
Returns the digestType. |
java.lang.String |
getInputEncoding()
Returns the input encoding. |
void |
initConfiguration()
Initializes a configuration after all parameters have been added. |
void |
setDigestType(java.lang.String digestType)
Sets the digestType. |
void |
setInputEncoding(java.lang.String inputEncoding)
Sets the input encoding. |
void |
validatePassword(java.lang.String password)
This method checks if a new password follows the rules for new passwords, which are defined by a Class configured in the opencms.properties file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PASSWORD_MIN_LENGTH
Constructor Detail |
---|
public CmsDefaultPasswordHandler()
Method Detail |
---|
public void addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
I_CmsConfigurationParameterHandler
addConfigurationParameter
in interface I_CmsConfigurationParameterHandler
paramName
- the name of the parameterparamValue
- the value for the parameterI_CmsConfigurationParameterHandler.addConfigurationParameter(java.lang.String, java.lang.String)
public java.lang.String digest(java.lang.String password) throws CmsPasswordEncryptionException
I_CmsPasswordHandler
digest
in interface I_CmsPasswordHandler
password
- the password to encrypt
CmsPasswordEncryptionException
- if something goes wrongI_CmsPasswordHandler.digest(java.lang.String)
public java.lang.String digest(java.lang.String password, java.lang.String digestType, java.lang.String inputEncoding) throws CmsPasswordEncryptionException
I_CmsPasswordHandler
digest
in interface I_CmsPasswordHandler
password
- the password to encryptdigestType
- the algorithm used for encryption (i.e. MD5, SHA ...)inputEncoding
- the encoding used when converting the password to bytes (i.e. UTF-8)
CmsPasswordEncryptionException
- if something goes wrongI_CmsPasswordHandler.digest(java.lang.String, java.lang.String, java.lang.String)
public java.util.Map getConfiguration()
I_CmsConfigurationParameterHandler
null
if the class does not need to be configured.
All elements in the configuration are key, value String pairs,
set using the I_CmsConfigurationParameterHandler.addConfigurationParameter(String, String)
method
during initialization of the loader.
Implementations will (should) not to return a direct reference to the internal configuration but just a copy of it, to avoid unwanted external manipulation.
getConfiguration
in interface I_CmsConfigurationParameterHandler
null
I_CmsConfigurationParameterHandler.getConfiguration()
public java.lang.String getDigestType()
getDigestType
in interface I_CmsPasswordHandler
public java.lang.String getInputEncoding()
getInputEncoding
in interface I_CmsPasswordHandler
public void initConfiguration() throws CmsConfigurationException
I_CmsConfigurationParameterHandler
initConfiguration
in interface I_CmsConfigurationParameterHandler
CmsConfigurationException
- if something goes wrongI_CmsConfigurationParameterHandler.initConfiguration()
public void setDigestType(java.lang.String digestType)
setDigestType
in interface I_CmsPasswordHandler
digestType
- the digestType to setpublic void setInputEncoding(java.lang.String inputEncoding)
setInputEncoding
in interface I_CmsPasswordHandler
inputEncoding
- the input encoding to setpublic void validatePassword(java.lang.String password) throws CmsSecurityException
I_CmsPasswordHandler
If this method throws no exception the password is valid.
validatePassword
in interface I_CmsPasswordHandler
password
- the password to check
CmsSecurityException
- if validation of the password failedI_CmsPasswordHandler.validatePassword(java.lang.String)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |