Class AtlassianSHA1PasswordEncoder
java.lang.Object
com.atlassian.crowd.password.encoder.AtlassianSHA1PasswordEncoder
- All Implemented Interfaces:
InternalPasswordEncoder,PasswordEncoder
The Atlassian implementation of the SHA-1 password encoder, based on the OSUser implementation.
It uses the Bouncy Castle SHA-512 digest, followed by the commons-codec base64 encoding.
Note: the password String is converted to bytes using the platform encoding, to preserve the same behaviour as OSUser.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencodePassword(String password, Object salt) This method will handle the hashing of the passed inpasswordparamgetKey()The key to define this password encoderbooleanisPasswordValid(String encPass, String rawPass, Object salt) Validates a specified "raw" password against an encoded password.
-
Field Details
-
ATLASSIAN_SHA1_KEY
- See Also:
-
-
Constructor Details
-
AtlassianSHA1PasswordEncoder
public AtlassianSHA1PasswordEncoder()
-
-
Method Details
-
encodePassword
This method will handle the hashing of the passed inpasswordparam- Specified by:
encodePasswordin interfacePasswordEncoder- Parameters:
password- the password to encryptsalt- can be null, and is not currently used by the underlying implementation- Returns:
- java.util.String the hashed 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, Object). 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).- Specified by:
isPasswordValidin interfacePasswordEncoder- Parameters:
encPass- a pre-encoded passwordrawPass- a raw password to encode and compare against the pre-encoded passwordsalt- optionally used by the implementation to "salt" the raw password before encoding. Anullvalue is legal.- Returns:
- true if the password is valid , false otherwise
- See Also:
-
org.springframework.security.providers.encoding.PasswordEncoder#isPasswordValid(String, String, Object)
-
getKey
Description copied from interface:PasswordEncoderThe key to define this password encoder- Specified by:
getKeyin interfacePasswordEncoder
-