Package org.opensaml.security.x509
Class BasicX509Credential
java.lang.Object
org.opensaml.security.credential.AbstractCredential
org.opensaml.security.credential.BasicCredential
org.opensaml.security.x509.BasicX509Credential
- All Implemented Interfaces:
Credential
,MutableCredential
,X509Credential
A basic implementation of
X509Credential
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<X509CRL>
CRLs for this credential.private X509Certificate
Entity certificate.private Collection<X509Certificate>
Entity certificate chain, must include entity certificate. -
Constructor Summary
ConstructorsConstructorDescriptionBasicX509Credential
(X509Certificate entityCertificate) Constructor.BasicX509Credential
(X509Certificate entityCertificate, PrivateKey privateKey) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Credential>
Get the primary type of the credential instance.getCRLs()
Gets a collection of CRLs associated with the credential.Gets the public key certificate for the entity.Gets an immutable collection of certificates in the entity's trust chain.Gets the public key for the entity.This operation is unsupported for X.509 credentials.void
setCRLs
(Collection<X509CRL> newCRLs) Sets the CRLs for this credential.void
setEntityCertificate
(X509Certificate newEntityCertificate) Sets the entity certificate for this credential.void
setEntityCertificateChain
(Collection<X509Certificate> newCertificateChain) Sets the entity certificate chain for this credential.void
setPublicKey
(PublicKey newPublicKey) This operation is unsupported for X.509 credentials.void
setSecretKey
(SecretKey newSecretKey) This operation is unsupported for X.509 credentials.Methods inherited from class org.opensaml.security.credential.BasicCredential
setEntityId, setPrivateKey, setUsageType
Methods inherited from class org.opensaml.security.credential.AbstractCredential
getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getUsageType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensaml.security.credential.Credential
getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getUsageType
-
Field Details
-
entityCert
Entity certificate. -
entityCertChain
Entity certificate chain, must include entity certificate. -
crls
CRLs for this credential.
-
-
Constructor Details
-
BasicX509Credential
public BasicX509Credential(@Nonnull @ParameterName(name="entityCertificate") X509Certificate entityCertificate) Constructor.- Parameters:
entityCertificate
- the credential entity certificate
-
BasicX509Credential
public BasicX509Credential(@Nonnull @ParameterName(name="entityCertificate") X509Certificate entityCertificate, @ParameterName(name="privateKey") @Nonnull PrivateKey privateKey) Constructor.- Parameters:
entityCertificate
- the credential entity certificateprivateKey
- the credential private key
-
-
Method Details
-
getCredentialType
Get the primary type of the credential instance. This will usually be the primary sub-interface ofCredential
implemented by an implementation.- Specified by:
getCredentialType
in interfaceCredential
- Overrides:
getCredentialType
in classBasicCredential
- Returns:
- the credential type
-
getCRLs
Gets a collection of CRLs associated with the credential.- Specified by:
getCRLs
in interfaceX509Credential
- Returns:
- CRLs associated with the credential
-
setCRLs
Sets the CRLs for this credential.- Parameters:
newCRLs
- CRLs for this credential
-
getEntityCertificate
Gets the public key certificate for the entity. The public key of this certificate will be the same key obtained fromCredential.getPublicKey()
.- Specified by:
getEntityCertificate
in interfaceX509Credential
- Returns:
- the public key certificate for the entity
-
setEntityCertificate
Sets the entity certificate for this credential.- Parameters:
newEntityCertificate
- entity certificate for this credential
-
getPublicKey
Gets the public key for the entity.- Specified by:
getPublicKey
in interfaceCredential
- Overrides:
getPublicKey
in classAbstractCredential
- Returns:
- public key for the entity
-
setPublicKey
This operation is unsupported for X.509 credentials. The public key will be retrieved automatically from the entity certificate.- Specified by:
setPublicKey
in interfaceMutableCredential
- Overrides:
setPublicKey
in classBasicCredential
- Parameters:
newPublicKey
- not supported
-
getEntityCertificateChain
Gets an immutable collection of certificates in the entity's trust chain. The entity certificate is contained within this list. No specific ordering of the certificates is guaranteed.- Specified by:
getEntityCertificateChain
in interfaceX509Credential
- Returns:
- entities certificate chain
-
setEntityCertificateChain
Sets the entity certificate chain for this credential. This MUST include the entity certificate.- Parameters:
newCertificateChain
- entity certificate chain for this credential
-
getSecretKey
This operation is unsupported for X.509 credentials.- Specified by:
getSecretKey
in interfaceCredential
- Overrides:
getSecretKey
in classAbstractCredential
- Returns:
- null
-
setSecretKey
This operation is unsupported for X.509 credentials.- Specified by:
setSecretKey
in interfaceMutableCredential
- Overrides:
setSecretKey
in classBasicCredential
- Parameters:
newSecretKey
- unsupported
-