Interface MaskedPassword
-
- All Superinterfaces:
Cloneable
,Destroyable
,Key
,Password
,Serializable
,TwoWayPassword
- All Known Implementing Classes:
MaskedPasswordImpl
,RawMaskedPassword
public interface MaskedPassword extends TwoWayPassword
A password which has been masked, PicketBox style.- Author:
- David M. Lloyd
-
-
Field Summary
-
Fields inherited from interface java.security.Key
serialVersionUID
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MaskedPassword
clone()
Creates and returns a copy of thisPassword
.static MaskedPassword
createRaw(String algorithm, char[] initialKeyMaterial, int iterationCount, byte[] salt, byte[] maskedPasswordBytes)
Create a raw instance of this password type.static MaskedPassword
createRaw(String algorithm, char[] initialKeyMaterial, int iterationCount, byte[] salt, byte[] maskedPasswordBytes, byte[] initializationVector)
Create a raw instance of this password type.default byte[]
getInitializationVector()
Get the initialization vector.char[]
getInitialKeyMaterial()
Get the initial key material.int
getIterationCount()
Get the iteration count.byte[]
getMaskedPasswordBytes()
Get the masked password bytes.default MaskedPasswordAlgorithmSpec
getParameterSpec()
Get the applicable algorithm parameter specification for this password type.static String
getPBEName(String name)
Get the name of the PBE algorithm that goes with the given password algorithm name.byte[]
getSalt()
Get the salt bytes.default boolean
impliesParameters(AlgorithmParameterSpec parameterSpec)
Determine if this password is matched by the given parameter specification.static boolean
isMaskedAlgorithm(String name)
Determine if the given algorithm name is a valid masked password algorithm name.-
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
-
Methods inherited from interface org.wildfly.security.password.Password
castAndApply, castAndApply, castAs, castAs
-
-
-
-
Field Detail
-
ALGORITHM_MASKED_MD5_DES
static final String ALGORITHM_MASKED_MD5_DES
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_MD5_DES_CBC_PKCS5
static final String ALGORITHM_MASKED_MD5_DES_CBC_PKCS5
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_MD5_3DES
static final String ALGORITHM_MASKED_MD5_3DES
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_MD5_3DES_CBC_PKCS5
static final String ALGORITHM_MASKED_MD5_3DES_CBC_PKCS5
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_DES_EDE
static final String ALGORITHM_MASKED_SHA1_DES_EDE
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_DES_EDE_CBC_PKCS5
static final String ALGORITHM_MASKED_SHA1_DES_EDE_CBC_PKCS5
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA1_AES_128
static final String ALGORITHM_MASKED_HMAC_SHA1_AES_128
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA224_AES_128
static final String ALGORITHM_MASKED_HMAC_SHA224_AES_128
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA256_AES_128
static final String ALGORITHM_MASKED_HMAC_SHA256_AES_128
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA384_AES_128
static final String ALGORITHM_MASKED_HMAC_SHA384_AES_128
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA512_AES_128
static final String ALGORITHM_MASKED_HMAC_SHA512_AES_128
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA1_AES_256
static final String ALGORITHM_MASKED_HMAC_SHA1_AES_256
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA224_AES_256
static final String ALGORITHM_MASKED_HMAC_SHA224_AES_256
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA256_AES_256
static final String ALGORITHM_MASKED_HMAC_SHA256_AES_256
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA384_AES_256
static final String ALGORITHM_MASKED_HMAC_SHA384_AES_256
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_HMAC_SHA512_AES_256
static final String ALGORITHM_MASKED_HMAC_SHA512_AES_256
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_RC2_40
static final String ALGORITHM_MASKED_SHA1_RC2_40
The following algorithms are not supported with IBM JDK 8.- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_RC2_40_CBC_PKCS5
static final String ALGORITHM_MASKED_SHA1_RC2_40_CBC_PKCS5
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_RC2_128
static final String ALGORITHM_MASKED_SHA1_RC2_128
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_RC2_128_CBC_PKCS5
static final String ALGORITHM_MASKED_SHA1_RC2_128_CBC_PKCS5
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_RC4_40
static final String ALGORITHM_MASKED_SHA1_RC4_40
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_RC4_40_ECB
static final String ALGORITHM_MASKED_SHA1_RC4_40_ECB
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_RC4_128
static final String ALGORITHM_MASKED_SHA1_RC4_128
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_SHA1_RC4_128_ECB
static final String ALGORITHM_MASKED_SHA1_RC4_128_ECB
- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA1
@Deprecated static final String 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:
- Constant Field Values
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA224
@Deprecated static final String ALGORITHM_MASKED_PBKDF_HMAC_SHA224
Deprecated.- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA256
@Deprecated static final String ALGORITHM_MASKED_PBKDF_HMAC_SHA256
Deprecated.- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA384
@Deprecated static final String ALGORITHM_MASKED_PBKDF_HMAC_SHA384
Deprecated.- See Also:
- Constant Field Values
-
ALGORITHM_MASKED_PBKDF_HMAC_SHA512
@Deprecated static final String ALGORITHM_MASKED_PBKDF_HMAC_SHA512
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
isMaskedAlgorithm
static boolean isMaskedAlgorithm(String name)
Determine if the given algorithm name is a valid masked password algorithm name.- Parameters:
name
- the algorithm name- Returns:
true
if the algorithm name is valid for this password type,false
otherwise
-
getPBEName
static String getPBEName(String name)
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
null
if the password algorithm name wasnull
or 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 (
null
if not used)
-
getParameterSpec
default MaskedPasswordAlgorithmSpec getParameterSpec()
Description copied from interface:Password
Get the applicable algorithm parameter specification for this password type.- Specified by:
getParameterSpec
in interfacePassword
- Returns:
- the algorithm parameter specification, or
null
if this password type does not support algorithms
-
impliesParameters
default boolean impliesParameters(AlgorithmParameterSpec parameterSpec)
Description copied from interface:Password
Determine if this password is matched by the given parameter specification.- Specified by:
impliesParameters
in interfacePassword
- Parameters:
parameterSpec
- the parameter specification (must not benull
)- Returns:
true
if the password is matched by the parameters,false
otherwise
-
clone
MaskedPassword clone()
Description copied from interface:TwoWayPassword
Creates and returns a copy of thisPassword
.- Specified by:
clone
in interfacePassword
- Specified by:
clone
in 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
)
-
-