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 Details

    • credentialAlias

      private final String credentialAlias
      Alias used to reference the credential in the key manager.
    • keyManager

      private final X509KeyManager 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 manager
      alias - alias used to reference the credential in the key manager
  • Method Details

    • getCRLs

      @Nullable public Collection<X509CRL> getCRLs()
      Gets a collection of CRLs associated with the credential.
      Specified by:
      getCRLs in interface X509Credential
      Returns:
      CRLs associated with the credential
    • getEntityCertificate

      @Nonnull public X509Certificate getEntityCertificate()
      Gets the public key certificate for the entity. The public key of this certificate will be the same key obtained from Credential.getPublicKey().
      Specified by:
      getEntityCertificate in interface X509Credential
      Returns:
      the public key certificate for the entity
    • getEntityCertificateChain

      @Nonnull public Collection<X509Certificate> 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 interface X509Credential
      Returns:
      entities certificate chain
    • getPrivateKey

      @Nullable public PrivateKey getPrivateKey()
      Gets the private key for the entity if there is one.
      Specified by:
      getPrivateKey in interface Credential
      Overrides:
      getPrivateKey in class AbstractCredential
      Returns:
      the private key for the entity
    • getPublicKey

      @Nullable public PublicKey getPublicKey()
      Gets the public key for the entity.
      Specified by:
      getPublicKey in interface Credential
      Overrides:
      getPublicKey in class AbstractCredential
      Returns:
      public key for the entity
    • getCredentialType

      @Nonnull public Class<? extends Credential> getCredentialType()
      Get the primary type of the credential instance. This will usually be the primary sub-interface of Credential implemented by an implementation.
      Specified by:
      getCredentialType in interface Credential
      Returns:
      the credential type
    • setEntityId

      public void setEntityId(@Nullable String newEntityID)
      Sets the ID of the entity this credential is for.
      Overrides:
      setEntityId in class AbstractCredential
      Parameters:
      newEntityID - ID of the entity this credential is for
    • setUsageType

      public void setUsageType(@Nonnull UsageType newUsageType)
      Sets the usage type for this credential.
      Overrides:
      setUsageType in class AbstractCredential
      Parameters:
      newUsageType - usage type for this credential