public interface Credential extends Cloneable
Modifier and Type | Field and Description |
---|---|
static Credential[] |
NO_CREDENTIALS
An array with no credentials.
|
Modifier and Type | Method and Description |
---|---|
default boolean |
canVerify(Class<? extends Evidence> evidenceClass,
String algorithmName)
Determine whether this credential can, generally speaking, verify the given evidence type.
|
default boolean |
canVerify(Evidence evidence)
Determine whether this credential can verify the given evidence.
|
default <C extends Credential,R> |
castAndApply(Class<C> credentialType,
Function<C,R> function)
Cast this credential type and apply a function if the type matches.
|
default <C extends Credential,R> |
castAndApply(Class<C> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec,
Function<C,R> function)
Cast this credential type and apply a function if the type matches.
|
default <C extends Credential,R> |
castAndApply(Class<C> credentialType,
String algorithmName,
Function<C,R> function)
Cast this credential type and apply a function if the type matches.
|
default <C extends Credential> |
castAs(Class<C> credentialType)
Cast this credential type if the type matches.
|
default <C extends Credential> |
castAs(Class<C> credentialType,
String algorithmName)
Cast this credential type if the type and algorithm matches.
|
default <C extends Credential> |
castAs(Class<C> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec)
Cast this credential type if the type, algorithm, and parameters match.
|
Credential |
clone()
Creates and returns a copy of this
Credential . |
static Credential |
fromKeyStoreEntry(KeyStore.Entry keyStoreEntry)
Convert a key store entry into a credential object.
|
default boolean |
matches(AlgorithmCredential other)
Determine if this credential is the same kind of credential as the given credential.
|
default boolean |
matches(Class<? extends Credential> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec)
Determine if this credential matches the given criteria.
|
default boolean |
matches(Credential other)
Determine if this credential is the same kind of credential as the given credential.
|
default boolean |
verify(Evidence evidence)
Verify the given evidence.
|
default boolean |
verify(Supplier<Provider[]> providerSupplier,
Evidence evidence)
Verify the given evidence.
|
static final Credential[] NO_CREDENTIALS
default boolean canVerify(Class<? extends Evidence> evidenceClass, String algorithmName)
evidenceClass
- the evidence type (must not be null
)algorithmName
- the evidence algorithm name (may be null
if the type of evidence does not support
algorithm names)true
if the evidence can be verified by this credential, false
otherwisedefault boolean canVerify(Evidence evidence)
evidence
- the evidence (must not be null
)true
if the evidence can be verified by this credential, false
otherwisedefault boolean verify(Evidence evidence)
evidence
- the evidence to verify (must not be null
)true
if the evidence is verified, false
otherwisedefault boolean verify(Supplier<Provider[]> providerSupplier, Evidence evidence)
providerSupplier
- the provider supplier to use for verification purposesevidence
- the evidence to verify (must not be null
)true
if the evidence is verified, false
otherwisedefault <C extends Credential> C castAs(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
C
- the credential typecredentialType
- the credential type class to checkalgorithmName
- the name of the algorithm or null
if any algorithm is acceptableparameterSpec
- the parameter specification or null
if any parameter specification is acceptablenull
if the credential does not match the criteriadefault <C extends Credential> C castAs(Class<C> credentialType, String algorithmName)
C
- the credential typecredentialType
- the credential type class to checkalgorithmName
- the name of the algorithm or null
if any algorithm is acceptablenull
if the credential does not match the criteriadefault <C extends Credential> C castAs(Class<C> credentialType)
C
- the credential typecredentialType
- the credential type class to checknull
if the credential does not match the criteriadefault <C extends Credential,R> R castAndApply(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec, Function<C,R> function)
C
- the credential typeR
- the return typecredentialType
- the credential type class to checkalgorithmName
- the name of the algorithm or null
if any algorithm is acceptableparameterSpec
- the parameter specification or null
if any parameter specification is acceptablefunction
- the function to applynull
if the credential is not of the given typedefault <C extends Credential,R> R castAndApply(Class<C> credentialType, String algorithmName, Function<C,R> function)
C
- the credential typeR
- the return typecredentialType
- the credential type class to checkalgorithmName
- the name of the algorithm or null
if any algorithm is acceptablefunction
- the function to applynull
if the credential is not of the given typedefault <C extends Credential,R> R castAndApply(Class<C> credentialType, Function<C,R> function)
C
- the credential typeR
- the return typecredentialType
- the credential type class to checkfunction
- the function to applynull
if the credential is not of the given typeCredential clone()
Credential
.Credential
.default boolean matches(Credential other)
other
- the other credentialtrue
if the credentials are of the same kind, false
otherwisedefault boolean matches(AlgorithmCredential other)
other
- the other credentialtrue
if the credentials are of the same kind, false
otherwisedefault boolean matches(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
credentialType
- the credential type class to checkalgorithmName
- the name of the algorithm or null
if any algorithm is acceptableparameterSpec
- the parameter specification or null
if any parameter specification is acceptabletrue
if the credential matches the specification, false
otherwisestatic Credential fromKeyStoreEntry(KeyStore.Entry keyStoreEntry)
keyStoreEntry
- the key store entry to convert (must not be null
)null
if the entry type is unrecognizedCopyright © 2017 JBoss by Red Hat. All rights reserved.