Package org.opensaml.security.x509.impl
Class X509KeyManagerX509CredentialAdapter
java.lang.Object
org.opensaml.security.credential.AbstractCredential
org.opensaml.security.x509.impl.X509KeyManagerX509CredentialAdapter
- All Implemented Interfaces:
Credential
,X509Credential
public class X509KeyManagerX509CredentialAdapter
extends AbstractCredential
implements X509Credential
A class that wraps a
X509KeyManager
and exposes it as an X509Credential
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
Alias used to reference the credential in the key manager.private final X509KeyManager
Wrapped key manager. -
Constructor Summary
ConstructorsConstructorDescriptionX509KeyManagerX509CredentialAdapter
(X509KeyManager manager, String alias) 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 private key for the entity if there is one.Gets the public key for the entity.void
setEntityId
(String newEntityID) Sets the ID of the entity this credential is for.void
setUsageType
(UsageType newUsageType) Sets the usage type for this credential.Methods inherited from class org.opensaml.security.credential.AbstractCredential
getCredentialContextSet, getEntityId, getKeyNames, getSecretKey, getUsageType, setPrivateKey, setPublicKey, setSecretKey
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, getSecretKey, getUsageType
-
Field Details
-
credentialAlias
Alias used to reference the credential in the key manager. -
keyManager
Wrapped key manager.
-
-
Constructor Details
-
X509KeyManagerX509CredentialAdapter
public X509KeyManagerX509CredentialAdapter(@Nonnull @ParameterName(name="manager") X509KeyManager manager, @Nonnull @ParameterName(name="alias") String alias) Constructor.- Parameters:
manager
- wrapped key manageralias
- alias used to reference the credential in the key manager
-
-
Method Details
-
getCRLs
Gets a collection of CRLs associated with the credential.- Specified by:
getCRLs
in interfaceX509Credential
- Returns:
- CRLs associated with the 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
-
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
-
getPrivateKey
Gets the private key for the entity if there is one.- Specified by:
getPrivateKey
in interfaceCredential
- Overrides:
getPrivateKey
in classAbstractCredential
- Returns:
- the private key for the entity
-
getPublicKey
Gets the public key for the entity.- Specified by:
getPublicKey
in interfaceCredential
- Overrides:
getPublicKey
in classAbstractCredential
- Returns:
- public key for the entity
-
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
- Returns:
- the credential type
-
setEntityId
Sets the ID of the entity this credential is for.- Overrides:
setEntityId
in classAbstractCredential
- Parameters:
newEntityID
- ID of the entity this credential is for
-
setUsageType
Sets the usage type for this credential.- Overrides:
setUsageType
in classAbstractCredential
- Parameters:
newUsageType
- usage type for this credential
-