Package org.wildfly.security.password
Class PasswordFactorySpi
- java.lang.Object
- 
- org.wildfly.security.password.PasswordFactorySpi
 
- 
- Direct Known Subclasses:
- PasswordFactorySpiImpl
 
 public abstract class PasswordFactorySpi extends Object The SPI for password factories to implement.- Author:
- David M. Lloyd
 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedPasswordFactorySpi()Construct a new instance.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract <S extends KeySpec>
 booleanengineConvertibleToKeySpec(String algorithm, Password password, Class<S> keySpecType)Determine whether the given password object is convertible to the given key specification type.protected abstract PasswordengineGeneratePassword(String algorithm, KeySpec keySpec)Generate a password from the given key specification.protected abstract <S extends KeySpec>
 SengineGetKeySpec(String algorithm, Password password, Class<S> keySpecType)Get a key specification for the given password object.protected abstract booleanengineIsTranslatablePassword(String algorithm, Password password)Determine whether the given password can be translated into one which is consumable by this factory.protected abstract PasswordengineTransform(String algorithm, Password password, AlgorithmParameterSpec parameterSpec)Transform a password with new parameters.protected abstract PasswordengineTranslatePassword(String algorithm, Password password)Translate a password object into one which is supported by this engine.protected abstract booleanengineVerify(String algorithm, Password password, char[] guess)Perform password verification.protected booleanengineVerify(String algorithm, Password password, char[] guess, Charset hashCharset)Perform password verification.
 
- 
- 
- 
Method Detail- 
engineGeneratePasswordprotected abstract Password engineGeneratePassword(String algorithm, KeySpec keySpec) throws InvalidKeySpecException Generate a password from the given key specification.- Parameters:
- algorithm- the password algorithm
- keySpec- the key specification
- Returns:
- the password
- Throws:
- InvalidKeySpecException- if the key specification is not supported
 
 - 
engineGetKeySpecprotected abstract <S extends KeySpec> S engineGetKeySpec(String algorithm, Password password, Class<S> keySpecType) throws InvalidKeySpecException Get a key specification for the given password object.- Type Parameters:
- S- the key specification type
- Parameters:
- algorithm- the password algorithm
- password- the password object
- keySpecType- the key specification class
- Returns:
- the key specification
- Throws:
- InvalidKeySpecException- if the key specification type is not supported
 
 - 
engineIsTranslatablePasswordprotected abstract boolean engineIsTranslatablePassword(String algorithm, Password password) Determine whether the given password can be translated into one which is consumable by this factory. If this method returnstrue, thenengineTranslatePassword(String, Password)must succeed.- Parameters:
- password- the password object
- Returns:
- trueif the given password is supported by this algorithm,- falseotherwise
 
 - 
engineTranslatePasswordprotected abstract Password engineTranslatePassword(String algorithm, Password password) throws InvalidKeyException Translate a password object into one which is supported by this engine.- Parameters:
- algorithm- the password algorithm
- password- the password object
- Returns:
- the translated password
- Throws:
- InvalidKeyException- if the given password type is not supported
 
 - 
engineVerifyprotected abstract boolean engineVerify(String algorithm, Password password, char[] guess) throws InvalidKeyException Perform password verification.- Parameters:
- algorithm- the password algorithm
- password- the password object
- guess- the guessed password
- Returns:
- trueif the password matches,- falseotherwise
- Throws:
- InvalidKeyException- if the given password type is not supported
 
 - 
engineVerifyprotected boolean engineVerify(String algorithm, Password password, char[] guess, Charset hashCharset) throws InvalidKeyException Perform password verification.- Parameters:
- algorithm- the password algorithm
- password- the password object
- guess- the guessed password
- hashCharset- the character set used in the password object representation (must not be- null)
- Returns:
- trueif the password matches,- falseotherwise
- Throws:
- InvalidKeyException- if the given password type is not supported
- UnsupportedOperationException- if this method is not supported by the password factory implementation
 
 - 
engineConvertibleToKeySpecprotected abstract <S extends KeySpec> boolean engineConvertibleToKeySpec(String algorithm, Password password, Class<S> keySpecType) Determine whether the given password object is convertible to the given key specification type.- Type Parameters:
- S- the key specification type
- Parameters:
- algorithm- the password algorithm
- password- the password object
- keySpecType- the key specification class
- Returns:
- trueif the password is convertible,- falseotherwise
 
 - 
engineTransformprotected abstract Password engineTransform(String algorithm, Password password, AlgorithmParameterSpec parameterSpec) throws InvalidKeyException, InvalidAlgorithmParameterException Transform a password with new parameters. Not every transformation is allowed, but iterative password types generally should allow increasing the number of iterations.- Parameters:
- algorithm- the password algorithm
- password- the password
- parameterSpec- the new parameters
- Returns:
- the transformed password
- Throws:
- InvalidKeyException- if the given password is invalid
- InvalidAlgorithmParameterException- if the transformation cannot be applied to the given parameters
 
 
- 
 
-