Package org.wildfly.security.credential
Interface AlgorithmCredential
-
- All Superinterfaces:
Cloneable
,Credential
- All Known Subinterfaces:
X509CertificateChainCredential
- All Known Implementing Classes:
KeyPairCredential
,PasswordCredential
,PublicKeyCredential
,SecretKeyCredential
,X509CertificateChainPrivateCredential
,X509CertificateChainPublicCredential
public interface AlgorithmCredential extends Credential
A credential which has an associated algorithm name.
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.credential.Credential
NO_CREDENTIALS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AlgorithmCredential
clone()
Creates and returns a copy of thisCredential
.String
getAlgorithm()
Get the algorithm name associated with this credential (will never benull
).default AlgorithmParameterSpec
getParameters()
Get the default algorithm parameters of the any type from this credential.default <P extends AlgorithmParameterSpec>
PgetParameters(Class<P> paramSpecClass)
Get the algorithm parameters of the given type from this credential.default boolean
impliesParameters(AlgorithmParameterSpec parameterSpec)
Determine whether this credential implies the given parameters.default boolean
impliesSameParameters(AlgorithmCredential other)
Determine whether the other credential's parameters are implied by this one.default boolean
matches(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Determine if this credential matches the given criteria.default boolean
matches(AlgorithmCredential other)
Determine if this credential is the same kind of credential as the given credential.default boolean
matches(Credential other)
Determine if this credential is the same kind of credential as the given credential.default boolean
supportsParameters()
Determine whether this credential instance supports any algorithm parameter type.default boolean
supportsParameters(Class<? extends AlgorithmParameterSpec> paramSpecClass)
Determine whether this credential instance supports the given algorithm parameter type.-
Methods inherited from interface org.wildfly.security.credential.Credential
canVerify, canVerify, castAndApply, castAndApply, castAndApply, castAs, castAs, castAs, verify, verify
-
-
-
-
Method Detail
-
getAlgorithm
String getAlgorithm()
Get the algorithm name associated with this credential (will never benull
).- Returns:
- the algorithm name
-
getParameters
default AlgorithmParameterSpec getParameters()
Get the default algorithm parameters of the any type from this credential.- Returns:
- the parameter specification, or
null
if no parameters are present or available or the given type was not supported by this credential
-
getParameters
default <P extends AlgorithmParameterSpec> P getParameters(Class<P> paramSpecClass)
Get the algorithm parameters of the given type from this credential.- Parameters:
paramSpecClass
- the parameter specification class (must not benull
)- Returns:
- the parameter specification, or
null
if no parameters are present or available or the given type was not supported by this credential
-
supportsParameters
default boolean supportsParameters()
Determine whether this credential instance supports any algorithm parameter type.- Returns:
true
if parameters are supported,false
otherwise
-
supportsParameters
default boolean supportsParameters(Class<? extends AlgorithmParameterSpec> paramSpecClass)
Determine whether this credential instance supports the given algorithm parameter type.- Parameters:
paramSpecClass
- the parameter specification class (must not benull
)- Returns:
true
if the parameter type is supported,false
otherwise
-
impliesParameters
default boolean impliesParameters(AlgorithmParameterSpec parameterSpec)
Determine whether this credential implies the given parameters. The default implementation returnsfalse
always.- Parameters:
parameterSpec
- the parameters to test for (must not benull
)- Returns:
true
if the given parameters match this credential,false
otherwise
-
impliesSameParameters
default boolean impliesSameParameters(AlgorithmCredential other)
Determine whether the other credential's parameters are implied by this one.- Parameters:
other
- the other credential (must not benull
)- Returns:
true
if the credentials have matching parameters,false
otherwise
-
clone
AlgorithmCredential clone()
Creates and returns a copy of thisCredential
.- Specified by:
clone
in interfaceCredential
- Returns:
- a copy of this
Credential
.
-
matches
default boolean matches(Credential other)
Description copied from interface:Credential
Determine if this credential is the same kind of credential as the given credential.- Specified by:
matches
in interfaceCredential
- Parameters:
other
- the other credential- Returns:
true
if the credentials are of the same kind,false
otherwise
-
matches
default boolean matches(AlgorithmCredential other)
Description copied from interface:Credential
Determine if this credential is the same kind of credential as the given credential.- Specified by:
matches
in interfaceCredential
- Parameters:
other
- the other credential- Returns:
true
if the credentials are of the same kind,false
otherwise
-
matches
default boolean matches(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Description copied from interface:Credential
Determine if this credential matches the given criteria.- Specified by:
matches
in interfaceCredential
- Parameters:
credentialType
- the credential type class to checkalgorithmName
- the name of the algorithm ornull
if any algorithm is acceptableparameterSpec
- the parameter specification ornull
if any parameter specification is acceptable- Returns:
true
if the credential matches the specification,false
otherwise
-
-