Package org.wildfly.security.credential
Class KeyPairCredential
- java.lang.Object
-
- org.wildfly.security.credential.KeyPairCredential
-
- All Implemented Interfaces:
Cloneable
,AlgorithmCredential
,Credential
public final class KeyPairCredential extends Object implements AlgorithmCredential
A public/private key pair credential.
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.credential.Credential
NO_CREDENTIALS
-
-
Constructor Summary
Constructors Constructor Description KeyPairCredential(KeyPair keyPair)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyPairCredential
clone()
Creates and returns a copy of thisCredential
.boolean
equals(Object obj)
String
getAlgorithm()
Get the algorithm name associated with this credential (will never benull
).KeyPair
getKeyPair()
Get the key pair.<P extends AlgorithmParameterSpec>
PgetParameters(Class<P> paramSpecClass)
Get the algorithm parameters of the given type from this credential.int
hashCode()
boolean
impliesSameParameters(AlgorithmCredential other)
Determine whether the other credential's parameters are implied by this one.boolean
supportsParameters(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
-
KeyPairCredential
public KeyPairCredential(KeyPair keyPair)
Construct a new instance.- Parameters:
keyPair
- the key pair (may not benull
)
-
-
Method Detail
-
getKeyPair
public KeyPair getKeyPair()
Get the key pair.- Returns:
- the key pair (not
null
)
-
supportsParameters
public boolean supportsParameters(Class<? extends AlgorithmParameterSpec> paramSpecClass)
Description copied from interface:AlgorithmCredential
Determine whether this credential instance supports the given algorithm parameter type.- Specified by:
supportsParameters
in interfaceAlgorithmCredential
- Parameters:
paramSpecClass
- the parameter specification class (must not benull
)- Returns:
true
if the parameter type is supported,false
otherwise
-
getParameters
public <P extends AlgorithmParameterSpec> P getParameters(Class<P> paramSpecClass)
Description copied from interface:AlgorithmCredential
Get the algorithm parameters of the given type from this credential.- Specified by:
getParameters
in interfaceAlgorithmCredential
- 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
-
impliesSameParameters
public boolean impliesSameParameters(AlgorithmCredential other)
Description copied from interface:AlgorithmCredential
Determine whether the other credential's parameters are implied by this one.- Specified by:
impliesSameParameters
in interfaceAlgorithmCredential
- Parameters:
other
- the other credential (must not benull
)- Returns:
true
if the credentials have matching parameters,false
otherwise
-
getAlgorithm
public String getAlgorithm()
Description copied from interface:AlgorithmCredential
Get the algorithm name associated with this credential (will never benull
).- Specified by:
getAlgorithm
in interfaceAlgorithmCredential
- Returns:
- the algorithm name
-
clone
public KeyPairCredential clone()
Description copied from interface:AlgorithmCredential
Creates and returns a copy of thisCredential
.- Specified by:
clone
in interfaceAlgorithmCredential
- Specified by:
clone
in interfaceCredential
- Overrides:
clone
in classObject
- Returns:
- a copy of this
Credential
.
-
-