Interface MaskedPassword
- All Superinterfaces:
Cloneable,Destroyable,Key,Password,Serializable,TwoWayPassword
A password which has been masked, PicketBox style.
- Author:
- David M. Lloyd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringThe following algorithms are not supported with IBM JDK 8.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface java.security.Key
serialVersionUID -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of thisPassword.static MaskedPasswordcreateRaw(String algorithm, char[] initialKeyMaterial, int iterationCount, byte[] salt, byte[] maskedPasswordBytes) Create a raw instance of this password type.static MaskedPasswordcreateRaw(String algorithm, char[] initialKeyMaterial, int iterationCount, byte[] salt, byte[] maskedPasswordBytes, byte[] initializationVector) Create a raw instance of this password type.default byte[]Get the initialization vector.char[]Get the initial key material.intGet the iteration count.byte[]Get the masked password bytes.default MaskedPasswordAlgorithmSpecGet the applicable algorithm parameter specification for this password type.static StringgetPBEName(String name) Get the name of the PBE algorithm that goes with the given password algorithm name.byte[]getSalt()Get the salt bytes.default booleanimpliesParameters(AlgorithmParameterSpec parameterSpec) Determine if this password is matched by the given parameter specification.static booleanisMaskedAlgorithm(String name) Determine if the given algorithm name is a valid masked password algorithm name.Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyedMethods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormatMethods inherited from interface org.wildfly.security.password.Password
castAndApply, castAndApply, castAs, castAs
-
Field Details
-
ALGORITHM_MASKED_MD5_DES
- See Also:
-
ALGORITHM_MASKED_MD5_DES_CBC_PKCS5
- See Also:
-
ALGORITHM_MASKED_MD5_3DES
- See Also:
-
ALGORITHM_MASKED_MD5_3DES_CBC_PKCS5
- See Also:
-
ALGORITHM_MASKED_SHA1_DES_EDE
- See Also:
-
ALGORITHM_MASKED_SHA1_DES_EDE_CBC_PKCS5
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA1_AES_128
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA224_AES_128
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA256_AES_128
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA384_AES_128
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA512_AES_128
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA1_AES_256
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA224_AES_256
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA256_AES_256
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA384_AES_256
- See Also:
-
ALGORITHM_MASKED_HMAC_SHA512_AES_256
- See Also:
-
ALGORITHM_MASKED_SHA1_RC2_40
The following algorithms are not supported with IBM JDK 8.- See Also:
-
ALGORITHM_MASKED_SHA1_RC2_40_CBC_PKCS5
- See Also:
-
ALGORITHM_MASKED_SHA1_RC2_128
- See Also:
-
ALGORITHM_MASKED_SHA1_RC2_128_CBC_PKCS5
- See Also:
-
ALGORITHM_MASKED_SHA1_RC4_40
- See Also:
-
ALGORITHM_MASKED_SHA1_RC4_40_ECB
- See Also:
-
ALGORITHM_MASKED_SHA1_RC4_128
- See Also:
-
ALGORITHM_MASKED_SHA1_RC4_128_ECB
- See Also:
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA1
Deprecated.DEPRECATED - unusable for masked passwords as there is no encryption support in javax.crypto.Cipher for PKDBF2 family of algorithms, needs to be kept for compatibility- See Also:
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA224
Deprecated.- See Also:
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA256
Deprecated.- See Also:
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA384
Deprecated.- See Also:
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA512
Deprecated.- See Also:
-
-
Method Details
-
isMaskedAlgorithm
Determine if the given algorithm name is a valid masked password algorithm name.- Parameters:
name- the algorithm name- Returns:
trueif the algorithm name is valid for this password type,falseotherwise
-
getPBEName
Get the name of the PBE algorithm that goes with the given password algorithm name.- Parameters:
name- the password algorithm name- Returns:
- the PBE algorithm name, or
nullif the password algorithm name wasnullor not recognized
-
getInitialKeyMaterial
char[] getInitialKeyMaterial()Get the initial key material.- Returns:
- the initial key material (must not be
null)
-
getIterationCount
int getIterationCount()Get the iteration count.- Returns:
- the iteration count
-
getSalt
byte[] getSalt()Get the salt bytes.- Returns:
- the salt bytes (must not be
null)
-
getMaskedPasswordBytes
byte[] getMaskedPasswordBytes()Get the masked password bytes.- Returns:
- the masked password bytes (must not be
null)
-
getInitializationVector
default byte[] getInitializationVector()Get the initialization vector.- Returns:
- the initialization vector (
nullif not used)
-
getParameterSpec
Description copied from interface:PasswordGet the applicable algorithm parameter specification for this password type.- Specified by:
getParameterSpecin interfacePassword- Returns:
- the algorithm parameter specification, or
nullif this password type does not support algorithms
-
impliesParameters
Description copied from interface:PasswordDetermine if this password is matched by the given parameter specification.- Specified by:
impliesParametersin interfacePassword- Parameters:
parameterSpec- the parameter specification (must not benull)- Returns:
trueif the password is matched by the parameters,falseotherwise
-
clone
MaskedPassword clone()Description copied from interface:TwoWayPasswordCreates and returns a copy of thisPassword.- Specified by:
clonein interfacePassword- Specified by:
clonein interfaceTwoWayPassword- Returns:
- a copy of this
Password.
-
createRaw
static MaskedPassword createRaw(String algorithm, char[] initialKeyMaterial, int iterationCount, byte[] salt, byte[] maskedPasswordBytes) Create a raw instance of this password type.- Parameters:
algorithm- the algorithm name (must not benull)initialKeyMaterial- the initial key material (must not benull)iterationCount- the iteration countsalt- the salt (must not benull)maskedPasswordBytes- the masked password bytes (must not benull)- Returns:
- the raw instance (not
null)
-
createRaw
static MaskedPassword createRaw(String algorithm, char[] initialKeyMaterial, int iterationCount, byte[] salt, byte[] maskedPasswordBytes, byte[] initializationVector) Create a raw instance of this password type.- Parameters:
algorithm- the algorithm name (must not benull)initialKeyMaterial- the initial key material (must not benull)iterationCount- the iteration countsalt- the salt (must not benull)maskedPasswordBytes- the masked password bytes (must not benull)initializationVector- the initialization vector (can benull)- Returns:
- the raw instance (not
null)
-