Package org.wildfly.security.credential
Class SecretKeyCredential
- java.lang.Object
-
- org.wildfly.security.credential.SecretKeyCredential
-
- All Implemented Interfaces:
Cloneable,AlgorithmCredential,Credential
public final class SecretKeyCredential extends Object implements AlgorithmCredential
A secret key credential.
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.credential.Credential
NO_CREDENTIALS
-
-
Constructor Summary
Constructors Constructor Description SecretKeyCredential(SecretKey secretKey)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecretKeyCredentialclone()Creates and returns a copy of thisCredential.booleanequals(Object obj)StringgetAlgorithm()Get the algorithm name associated with this credential (will never benull).<P extends AlgorithmParameterSpec>
PgetParameters(Class<P> paramSpecClass)Get the algorithm parameters of the given type from this credential.SecretKeygetSecretKey()Get the secret key.inthashCode()booleanimpliesSameParameters(AlgorithmCredential other)Determine whether the other credential's parameters are implied by this one.booleansupportsParameters(Class<? extends AlgorithmParameterSpec> paramSpecClass)Determine whether this credential instance supports the given algorithm parameter type.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.credential.AlgorithmCredential
getParameters, impliesParameters, matches, matches, matches, supportsParameters
-
Methods inherited from interface org.wildfly.security.credential.Credential
canVerify, canVerify, castAndApply, castAndApply, castAndApply, castAs, castAs, castAs, verify, verify
-
-
-
-
Constructor Detail
-
SecretKeyCredential
public SecretKeyCredential(SecretKey secretKey)
Construct a new instance.- Parameters:
secretKey- the secret key (may not benull)
-
-
Method Detail
-
getSecretKey
public SecretKey getSecretKey()
Get the secret key.- Returns:
- the secret key (not
null)
-
supportsParameters
public boolean supportsParameters(Class<? extends AlgorithmParameterSpec> paramSpecClass)
Description copied from interface:AlgorithmCredentialDetermine whether this credential instance supports the given algorithm parameter type.- Specified by:
supportsParametersin interfaceAlgorithmCredential- Parameters:
paramSpecClass- the parameter specification class (must not benull)- Returns:
trueif the parameter type is supported,falseotherwise
-
getParameters
public <P extends AlgorithmParameterSpec> P getParameters(Class<P> paramSpecClass)
Description copied from interface:AlgorithmCredentialGet the algorithm parameters of the given type from this credential.- Specified by:
getParametersin interfaceAlgorithmCredential- Parameters:
paramSpecClass- the parameter specification class (must not benull)- Returns:
- the parameter specification, or
nullif no parameters are present or available or the given type was not supported by this credential
-
impliesSameParameters
public boolean impliesSameParameters(AlgorithmCredential other)
Description copied from interface:AlgorithmCredentialDetermine whether the other credential's parameters are implied by this one.- Specified by:
impliesSameParametersin interfaceAlgorithmCredential- Parameters:
other- the other credential (must not benull)- Returns:
trueif the credentials have matching parameters,falseotherwise
-
getAlgorithm
public String getAlgorithm()
Description copied from interface:AlgorithmCredentialGet the algorithm name associated with this credential (will never benull).- Specified by:
getAlgorithmin interfaceAlgorithmCredential- Returns:
- the algorithm name
-
clone
public SecretKeyCredential clone()
Description copied from interface:AlgorithmCredentialCreates and returns a copy of thisCredential.- Specified by:
clonein interfaceAlgorithmCredential- Specified by:
clonein interfaceCredential- Overrides:
clonein classObject- Returns:
- a copy of this
Credential.
-
-