Package org.wildfly.security.credential
Class X509CertificateChainPrivateCredential
java.lang.Object
org.wildfly.security.credential.X509CertificateChainPrivateCredential
- All Implemented Interfaces:
Cloneable,AlgorithmCredential,Credential,X509CertificateChainCredential
A credential containing a private key and an X.509 certificate chain.
- Author:
- David M. Lloyd
-
Field Summary
Fields inherited from interface org.wildfly.security.credential.Credential
NO_CREDENTIALS -
Constructor Summary
ConstructorsConstructorDescriptionX509CertificateChainPrivateCredential(PrivateKey privateKey, X509Certificate... certificateChain) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine whether this credential can, generally speaking, verify the given evidence type.clone()Creates and returns a copy of thisCredential.booleanGet the algorithm name associated with this credential (will never benull).Get a copy of the certificate chain.Get the first certificate in the chain.Get the last certificate in the chain.<P extends AlgorithmParameterSpec>
PgetParameters(Class<P> paramSpecClass) Get the algorithm parameters of the given type from this credential.Get the private key.inthashCode()booleanDetermine 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.booleanVerify the given evidence.booleanVerify the given evidence.Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.security.credential.AlgorithmCredential
getParameters, impliesParameters, matches, matches, matches, supportsParametersMethods inherited from interface org.wildfly.security.credential.Credential
canVerify, castAndApply, castAndApply, castAndApply, castAs, castAs, castAs
-
Constructor Details
-
X509CertificateChainPrivateCredential
public X509CertificateChainPrivateCredential(PrivateKey privateKey, X509Certificate... certificateChain) Construct a new instance.- Parameters:
privateKey- the private key (notnull)certificateChain- the certificate chain (notnull, cannot containnullelements)
-
-
Method Details
-
getPrivateKey
Get the private key.- Returns:
- the private key
-
clone
Description copied from interface:X509CertificateChainCredentialCreates and returns a copy of thisCredential.- Specified by:
clonein interfaceAlgorithmCredential- Specified by:
clonein interfaceCredential- Specified by:
clonein interfaceX509CertificateChainCredential- Returns:
- a copy of this
Credential.
-
hashCode
public int hashCode() -
equals
-
canVerify
Description copied from interface:CredentialDetermine whether this credential can, generally speaking, verify the given evidence type.- Specified by:
canVerifyin interfaceCredential- Parameters:
evidenceClass- the evidence type (must not benull)algorithmName- the evidence algorithm name (may benullif the type of evidence does not support algorithm names)- Returns:
trueif the evidence can be verified by this credential,falseotherwise
-
verify
Description copied from interface:CredentialVerify the given evidence.- Specified by:
verifyin interfaceCredential- Parameters:
evidence- the evidence to verify (must not benull)- Returns:
trueif the evidence is verified,falseotherwise
-
verify
Description copied from interface:CredentialVerify the given evidence.- Specified by:
verifyin interfaceCredential- Parameters:
providerSupplier- the provider supplier to use for verification purposesevidence- the evidence to verify (must not benull)- Returns:
trueif the evidence is verified,falseotherwise
-
getAlgorithm
Description copied from interface:AlgorithmCredentialGet the algorithm name associated with this credential (will never benull).- Specified by:
getAlgorithmin interfaceAlgorithmCredential- Returns:
- the algorithm name
-
supportsParameters
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
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
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
-
getCertificateChain
Description copied from interface:X509CertificateChainCredentialGet a copy of the certificate chain.- Specified by:
getCertificateChainin interfaceX509CertificateChainCredential- Returns:
- a copy of the certificate chain
-
getFirstCertificate
Description copied from interface:X509CertificateChainCredentialGet the first certificate in the chain. This corresponds to the subject certificate.- Specified by:
getFirstCertificatein interfaceX509CertificateChainCredential- Returns:
- the first certificate (not
null)
-
getLastCertificate
Description copied from interface:X509CertificateChainCredentialGet the last certificate in the chain. This corresponds to the ultimate issuer certificate.- Specified by:
getLastCertificatein interfaceX509CertificateChainCredential- Returns:
- the last certificate (not
null)
-