Class RawUnixSHACryptPassword
- java.lang.Object
-
- org.wildfly.security.password.interfaces.RawPassword
-
- org.wildfly.security.password.interfaces.RawUnixSHACryptPassword
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Key
,UnixSHACryptPassword
,OneWayPassword
,Password
class RawUnixSHACryptPassword extends RawPassword implements UnixSHACryptPassword
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
hash
private int
iterationCount
private byte[]
salt
private static long
serialVersionUID
-
Fields inherited from interface org.wildfly.security.password.interfaces.UnixSHACryptPassword
ALGORITHM_CRYPT_SHA_256, ALGORITHM_CRYPT_SHA_512, DEFAULT_ITERATION_COUNT, SALT_SIZE
-
-
Constructor Summary
Constructors Constructor Description RawUnixSHACryptPassword(String algorithm, byte[] salt, byte[] hash, int iterationCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RawUnixSHACryptPassword
clone()
Creates and returns a copy of thisPassword
.boolean
equals(Object obj)
byte[]
getHash()
The final hash, based on the password, salt and iteration countint
getIterationCount()
The number of iterations to perform when hashing the password.byte[]
getSalt()
The salt used during the hashing of this password.int
hashCode()
-
Methods inherited from class org.wildfly.security.password.interfaces.RawPassword
getAlgorithm, getEncoded, getFormat
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
-
Methods inherited from interface org.wildfly.security.password.Password
castAndApply, castAndApply, castAs, castAs
-
Methods inherited from interface org.wildfly.security.password.interfaces.UnixSHACryptPassword
getParameterSpec, impliesParameters
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
salt
private final byte[] salt
-
hash
private final byte[] hash
-
iterationCount
private final int iterationCount
-
-
Constructor Detail
-
RawUnixSHACryptPassword
RawUnixSHACryptPassword(String algorithm, byte[] salt, byte[] hash, int iterationCount)
-
-
Method Detail
-
getSalt
public byte[] getSalt()
Description copied from interface:UnixSHACryptPassword
The salt used during the hashing of this password. Should have at most 16 bytes.- Specified by:
getSalt
in interfaceUnixSHACryptPassword
- Returns:
- the salt
-
getHash
public byte[] getHash()
Description copied from interface:UnixSHACryptPassword
The final hash, based on the password, salt and iteration count- Specified by:
getHash
in interfaceUnixSHACryptPassword
- Returns:
- the hash
-
getIterationCount
public int getIterationCount()
Description copied from interface:UnixSHACryptPassword
The number of iterations to perform when hashing the password. Should be bigger than 1,000 and lower than 999,999,999. The default value is 5,000- Specified by:
getIterationCount
in interfaceUnixSHACryptPassword
- Returns:
- the number of iterations to perform
-
clone
public RawUnixSHACryptPassword clone()
Description copied from interface:Password
Creates and returns a copy of thisPassword
.- Specified by:
clone
in interfaceOneWayPassword
- Specified by:
clone
in interfacePassword
- Specified by:
clone
in interfaceUnixSHACryptPassword
- Specified by:
clone
in classRawPassword
- Returns:
- a copy of this
Password
.
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classRawPassword
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in classRawPassword
-
-