public final class PasswordCredential extends Object implements AlgorithmCredential
NO_CREDENTIALS
Constructor and Description |
---|
PasswordCredential(Password password)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canVerify(Class<? extends Evidence> evidenceClass,
String algorithmName)
Determine whether this credential can, generally speaking, verify the given evidence type.
|
static boolean |
canVerifyEvidence(Class<? extends Evidence> evidenceClass,
String algorithmName)
Determine whether this credential type can, generally speaking, verify the given evidence type.
|
PasswordCredential |
clone()
Creates and returns a copy of this
Credential . |
boolean |
equals(Object obj) |
String |
getAlgorithm()
Get the algorithm name associated with this credential (will never be
null ). |
<P extends AlgorithmParameterSpec> |
getParameters(Class<P> paramSpecClass)
Get the algorithm parameters of the given type from this credential.
|
Password |
getPassword()
Get the password.
|
<P extends Password> |
getPassword(Class<P> type)
Get the password if it is of the given type; otherwise return
null . |
int |
hashCode() |
boolean |
impliesParameters(AlgorithmParameterSpec parameterSpec)
Determine whether this credential implies the given parameters.
|
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.
|
boolean |
verify(Supplier<Provider[]> providerSupplier,
Evidence evidence)
Verify the given evidence.
|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getParameters, matches, matches, matches, supportsParameters
canVerify, castAndApply, castAndApply, castAndApply, castAs, castAs, castAs, fromKeyStoreEntry, verify
public PasswordCredential(Password password)
password
- the password (must not be null
)public Password getPassword()
null
)public <P extends Password> P getPassword(Class<P> type)
null
.P
- the password typetype
- the password type classnull
if the password is not of the given typepublic String getAlgorithm()
AlgorithmCredential
null
).getAlgorithm
in interface AlgorithmCredential
public boolean supportsParameters(Class<? extends AlgorithmParameterSpec> paramSpecClass)
AlgorithmCredential
supportsParameters
in interface AlgorithmCredential
paramSpecClass
- the parameter specification class (must not be null
)true
if the parameter type is supported, false
otherwisepublic <P extends AlgorithmParameterSpec> P getParameters(Class<P> paramSpecClass)
AlgorithmCredential
getParameters
in interface AlgorithmCredential
paramSpecClass
- the parameter specification class (must not be null
)null
if no parameters are present or available or the given type
was not supported by this credentialpublic boolean impliesParameters(AlgorithmParameterSpec parameterSpec)
AlgorithmCredential
false
always.impliesParameters
in interface AlgorithmCredential
parameterSpec
- the parameters to test for (must not be null
)true
if the given parameters match this credential, false
otherwisepublic boolean impliesSameParameters(AlgorithmCredential other)
AlgorithmCredential
impliesSameParameters
in interface AlgorithmCredential
other
- the other credential (must not be null
)true
if the credentials have matching parameters, false
otherwisepublic boolean canVerify(Class<? extends Evidence> evidenceClass, String algorithmName)
Credential
canVerify
in interface Credential
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
otherwisepublic static boolean canVerifyEvidence(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
otherwisepublic boolean verify(Supplier<Provider[]> providerSupplier, Evidence evidence)
Credential
verify
in interface Credential
providerSupplier
- the provider supplier to use for verification purposesevidence
- the evidence to verify (must not be null
)true
if the evidence is verified, false
otherwisepublic PasswordCredential clone()
AlgorithmCredential
Credential
.clone
in interface AlgorithmCredential
clone
in interface Credential
clone
in class Object
Credential
.Copyright © 2020 JBoss by Red Hat. All rights reserved.