Package org.wildfly.security.password
Interface Password
- All Superinterfaces:
Cloneable,Key,Serializable
- All Known Subinterfaces:
BCryptPassword,BSDUnixDESCryptPassword,ClearPassword,DigestPassword,MaskedPassword,OneTimePassword,OneWayPassword,SaltedSimpleDigestPassword,ScramDigestPassword,SimpleDigestPassword,SunUnixMD5CryptPassword,TwoWayPassword,UnixDESCryptPassword,UnixMD5CryptPassword,UnixSHACryptPassword
A password key.
- Author:
- David M. Lloyd
-
Field Summary
Fields inherited from interface java.security.Key
serialVersionUID -
Method Summary
Modifier and TypeMethodDescriptiondefault <P extends Password,R>
RcastAndApply(Class<P> passwordType, String algorithmName, Function<P, R> function) Cast this password type and apply a function if the type matches.default <P extends Password,R>
RcastAndApply(Class<P> passwordType, Function<P, R> function) Cast this password type and apply a function if the type matches.default <P extends Password>
PCast this password type if the type matches.default <P extends Password>
PCast this password type if the type and algorithm matches.clone()Creates and returns a copy of thisPassword.default AlgorithmParameterSpecGet the applicable algorithm parameter specification for this password type.default booleanimpliesParameters(AlgorithmParameterSpec parameterSpec) Determine if this password is matched by the given parameter specification.Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
-
Method Details
-
castAs
Cast this password type if the type and algorithm matches.- Type Parameters:
P- the password type- Parameters:
passwordType- the password type class to checkalgorithmName- the name of the algorithm ornullif any algorithm is acceptable- Returns:
- the password cast as the target type, or
nullif the password does not match the criteria
-
castAs
Cast this password type if the type matches.- Type Parameters:
P- the password type- Parameters:
passwordType- the password type class to check- Returns:
- the password cast as the target type, or
nullif the password does not match the criteria
-
castAndApply
default <P extends Password,R> R castAndApply(Class<P> passwordType, String algorithmName, Function<P, R> function) Cast this password type and apply a function if the type matches.- Type Parameters:
P- the password typeR- the return type- Parameters:
passwordType- the password type class to checkalgorithmName- the name of the algorithm ornullif any algorithm is acceptablefunction- the function to apply- Returns:
- the result of the function, or
nullif the password is not of the given type
-
castAndApply
Cast this password type and apply a function if the type matches.- Type Parameters:
P- the password typeR- the return type- Parameters:
passwordType- the password type class to checkfunction- the function to apply- Returns:
- the result of the function, or
nullif the password is not of the given type
-
getParameterSpec
Get the applicable algorithm parameter specification for this password type.- Returns:
- the algorithm parameter specification, or
nullif this password type does not support algorithms
-
impliesParameters
Determine if this password is matched by the given parameter specification.- Parameters:
parameterSpec- the parameter specification (must not benull)- Returns:
trueif the password is matched by the parameters,falseotherwise
-
clone
Password clone()Creates and returns a copy of thisPassword.- Returns:
- a copy of this
Password.
-