Class SimpleDigestPasswordImpl
- java.lang.Object
 - 
- org.wildfly.security.password.impl.AbstractPasswordImpl
 - 
- org.wildfly.security.password.impl.SimpleDigestPasswordImpl
 
 
 
- 
- All Implemented Interfaces:
 Serializable,Cloneable,Key,SimpleDigestPassword,OneWayPassword,Password
class SimpleDigestPasswordImpl extends AbstractPasswordImpl implements SimpleDigestPassword
- Author:
 - David M. Lloyd
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description private Stringalgorithmprivate byte[]digestprivate static longserialVersionUID- 
Fields inherited from interface org.wildfly.security.password.interfaces.SimpleDigestPassword
ALGORITHM_SIMPLE_DIGEST_MD2, ALGORITHM_SIMPLE_DIGEST_MD5, ALGORITHM_SIMPLE_DIGEST_SHA_1, ALGORITHM_SIMPLE_DIGEST_SHA_256, ALGORITHM_SIMPLE_DIGEST_SHA_384, ALGORITHM_SIMPLE_DIGEST_SHA_512 
 - 
 
- 
Constructor Summary
Constructors Constructor Description SimpleDigestPasswordImpl(String algorithm, byte[] digest)SimpleDigestPasswordImpl(String algorithm, char[] chars, Charset hashCharset)SimpleDigestPasswordImpl(String algorithm, ClearPasswordSpec spec)SimpleDigestPasswordImpl(String algorithm, HashPasswordSpec spec)SimpleDigestPasswordImpl(SimpleDigestPassword password) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleDigestPasswordImplclone()Creates and returns a copy of thisPassword.(package private) <T extends KeySpec>
booleanconvertibleTo(Class<T> keySpecType)booleanequals(Object obj)StringgetAlgorithm()byte[]getDigest()Get the digest of this password.(package private) static byte[]getDigestOf(String algorithm, char[] chars, Charset hashCharset)(package private) static byte[]getDigestOfKS(String algorithm, char[] chars, Charset hashCharset)(package private) <S extends KeySpec>
SgetKeySpec(Class<S> keySpecType)(package private) static MessageDigestgetMessageDigest(String algorithm)inthashCode()private voidreadObject(ObjectInputStream ignored)(package private) booleanverify(char[] guess)(package private) booleanverify(char[] guess, Charset hashCharset)(package private) ObjectwriteReplace()- 
Methods inherited from class org.wildfly.security.password.impl.AbstractPasswordImpl
getEncoded, getFormat, getNormalizedPasswordBytes, getNormalizedPasswordBytes, translate 
- 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface java.security.Key
getEncoded, getFormat 
- 
Methods inherited from interface org.wildfly.security.password.Password
castAndApply, castAndApply, castAs, castAs, getParameterSpec, impliesParameters 
 - 
 
 - 
 
- 
- 
Field Detail
- 
serialVersionUID
private static final long serialVersionUID
- See Also:
 - Constant Field Values
 
 
- 
algorithm
private final String algorithm
 
- 
digest
private final byte[] digest
 
 - 
 
- 
Constructor Detail
- 
SimpleDigestPasswordImpl
SimpleDigestPasswordImpl(String algorithm, byte[] digest)
 
- 
SimpleDigestPasswordImpl
SimpleDigestPasswordImpl(String algorithm, HashPasswordSpec spec)
 
- 
SimpleDigestPasswordImpl
SimpleDigestPasswordImpl(SimpleDigestPassword password)
 
- 
SimpleDigestPasswordImpl
SimpleDigestPasswordImpl(String algorithm, ClearPasswordSpec spec) throws InvalidKeySpecException
- Throws:
 InvalidKeySpecException
 
- 
SimpleDigestPasswordImpl
SimpleDigestPasswordImpl(String algorithm, char[] chars, Charset hashCharset) throws InvalidKeySpecException
- Throws:
 InvalidKeySpecException
 
 - 
 
- 
Method Detail
- 
getKeySpec
<S extends KeySpec> S getKeySpec(Class<S> keySpecType) throws InvalidKeySpecException
- Specified by:
 getKeySpecin classAbstractPasswordImpl- Throws:
 InvalidKeySpecException
 
- 
getDigestOfKS
static byte[] getDigestOfKS(String algorithm, char[] chars, Charset hashCharset) throws InvalidKeySpecException
- Throws:
 InvalidKeySpecException
 
- 
getDigestOf
static byte[] getDigestOf(String algorithm, char[] chars, Charset hashCharset) throws NoSuchAlgorithmException
- Throws:
 NoSuchAlgorithmException
 
- 
getMessageDigest
static MessageDigest getMessageDigest(String algorithm) throws NoSuchAlgorithmException
- Throws:
 NoSuchAlgorithmException
 
- 
verify
boolean verify(char[] guess) throws InvalidKeyException- Specified by:
 verifyin classAbstractPasswordImpl- Throws:
 InvalidKeyException
 
- 
verify
boolean verify(char[] guess, Charset hashCharset) throws InvalidKeyException- Overrides:
 verifyin classAbstractPasswordImpl- Throws:
 InvalidKeyException
 
- 
convertibleTo
<T extends KeySpec> boolean convertibleTo(Class<T> keySpecType)
- Specified by:
 convertibleToin classAbstractPasswordImpl
 
- 
getAlgorithm
public String getAlgorithm()
- Specified by:
 getAlgorithmin interfaceKey
 
- 
getDigest
public byte[] getDigest()
Description copied from interface:SimpleDigestPasswordGet the digest of this password.- Specified by:
 getDigestin interfaceSimpleDigestPassword- Returns:
 - the digest
 
 
- 
hashCode
public int hashCode()
- Specified by:
 hashCodein classAbstractPasswordImpl
 
- 
equals
public boolean equals(Object obj)
- Specified by:
 equalsin classAbstractPasswordImpl
 
- 
readObject
private void readObject(ObjectInputStream ignored) throws NotSerializableException
- Throws:
 NotSerializableException
 
- 
writeReplace
Object writeReplace()
 
- 
clone
public SimpleDigestPasswordImpl clone()
Description copied from interface:PasswordCreates and returns a copy of thisPassword.- Specified by:
 clonein interfaceOneWayPassword- Specified by:
 clonein interfacePassword- Specified by:
 clonein interfaceSimpleDigestPassword- Specified by:
 clonein classAbstractPasswordImpl- Returns:
 - a copy of this 
Password. 
 
 - 
 
 -