Class ShaPasswordEncoderImpl
- java.lang.Object
-
- net.sf.acegisecurity.providers.encoding.BasePasswordEncoder
-
- net.sf.acegisecurity.providers.encoding.BaseDigestPasswordEncoder
-
- org.alfresco.repo.security.authentication.MessageDigestPasswordEncoder
-
- org.alfresco.repo.security.authentication.ShaPasswordEncoderImpl
-
- All Implemented Interfaces:
net.sf.acegisecurity.providers.encoding.PasswordEncoder
public class ShaPasswordEncoderImpl extends MessageDigestPasswordEncoder
SHA implementation of PasswordEncoder.
If a
nullpassword is presented, it will be treated as an emptyString("") password.As SHA is a one-way hash, the salt can contain any characters. The default strength for the SHA encoding is SHA-1. If you wish to use higher strengths use the argumented constructor.
ShaPasswordEncoderImpl(int)The applicationContext example...
<bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder"> <constructor-arg value="256"/> </bean>
-
-
Constructor Summary
Constructors Constructor Description ShaPasswordEncoderImpl()Initializes the ShaPasswordEncoder for SHA-1 strengthShaPasswordEncoderImpl(int strength)Initialize the ShaPasswordEncoder with a given SHA stength as supported by the JVM EX:ShaPasswordEncoder encoder = new ShaPasswordEncoder(256);initializes with SHA-256
-
Method Summary
-
Methods inherited from class org.alfresco.repo.security.authentication.MessageDigestPasswordEncoder
encodePassword, getAlgorithm, getMessageDigest, isPasswordValid
-
Methods inherited from class net.sf.acegisecurity.providers.encoding.BaseDigestPasswordEncoder
getEncodeHashAsBase64, setEncodeHashAsBase64
-
-
-
-
Constructor Detail
-
ShaPasswordEncoderImpl
public ShaPasswordEncoderImpl()
Initializes the ShaPasswordEncoder for SHA-1 strength
-
ShaPasswordEncoderImpl
public ShaPasswordEncoderImpl(int strength)
Initialize the ShaPasswordEncoder with a given SHA stength as supported by the JVM EX:ShaPasswordEncoder encoder = new ShaPasswordEncoder(256);initializes with SHA-256- Parameters:
strength- EX: 1, 256, 384, 512
-
-