Class PasswordKeyMapper
java.lang.Object
org.wildfly.security.auth.realm.jdbc.mapper.PasswordKeyMapper
- All Implemented Interfaces:
ColumnMapper,KeyMapper
A KeyMapper that knows how to map columns from a SQL query to attributes of specific Password type
as defined by the algorithm.
- Author:
- Pedro Igor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder forPasswordKeyMapperinstances. -
Method Summary
Modifier and TypeMethodDescriptionstatic PasswordKeyMapper.Builderbuilder()Construct a builder for password key mappers.intGet the column index of the algorithm name column.getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) Determine whether a credential of the given type and algorithm is definitely obtainable, possibly obtainable (for] some identities), or definitely not obtainable.Returns the name of the algorithm being used.intGet the default iteration count.getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String algorithmName) Determine whether a given type of evidence is definitely verifiable, possibly verifiable (for some identities), or definitely not verifiable.intReturns an integer representing the column index from where the password in its clear, hash or encoded form is obtained.intReturns an integer representing the column index from where the iteration count (if supported) is obtained.intReturns an integer representing the column index from where the salt (if supported) is obtained.Maps the givenResultSetto some internal representation.
-
Method Details
-
getCredentialAcquireSupport
public SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) Description copied from interface:KeyMapperDetermine whether a credential of the given type and algorithm is definitely obtainable, possibly obtainable (for] some identities), or definitely not obtainable.- Specified by:
getCredentialAcquireSupportin interfaceKeyMapper- Parameters:
credentialType- the exact credential type (must not benull)algorithmName- the algorithm name, ornullif any algorithm is acceptable or the credential type does not support algorithm namesparameterSpec- the algorithm parameters to match, ornullif any parameters are acceptable or the credential type does not support algorithm parameters- Returns:
- the level of support for this credential
-
getEvidenceVerifySupport
public SupportLevel getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String algorithmName) Description copied from interface:KeyMapperDetermine whether a given type of evidence is definitely verifiable, possibly verifiable (for some identities), or definitely not verifiable.- Specified by:
getEvidenceVerifySupportin interfaceKeyMapper- Parameters:
evidenceType- the type of evidence to be verified (must not benull)algorithmName- the algorithm name, ornullif any algorithm is acceptable or the evidence type does not support algorithm names- Returns:
- the level of support for this evidence type
-
getDefaultAlgorithm
Returns the name of the algorithm being used.- Returns:
- the algorithm
-
getHashColumn
public int getHashColumn()Returns an integer representing the column index from where the password in its clear, hash or encoded form is obtained.- Returns:
- the column index
-
getSaltColumn
public int getSaltColumn()Returns an integer representing the column index from where the salt (if supported) is obtained.- Returns:
- the column index
-
getIterationCountColumn
public int getIterationCountColumn()Returns an integer representing the column index from where the iteration count (if supported) is obtained.- Returns:
- the column index
-
getDefaultIterationCount
public int getDefaultIterationCount()Get the default iteration count. This count is used if there is no iteration count column but the password algorithm uses an iteration count.- Returns:
- the default iteration count
-
getAlgorithmColumn
public int getAlgorithmColumn()Get the column index of the algorithm name column.- Returns:
- the column index of the algorithm name column, or -1 if there is no algorithm column defined
-
map
Description copied from interface:ColumnMapperMaps the givenResultSetto some internal representation.- Specified by:
mapin interfaceColumnMapper- Specified by:
mapin interfaceKeyMapper- Parameters:
resultSet- the result set previously created based on a queryproviders- the providers to use if required- Returns:
- the resulting object mapped from the given
ResultSet - Throws:
SQLException- if any error occurs when manipulating the givenResultSet
-
builder
Construct a builder for password key mappers.- Returns:
- the new builder (not
null)
-