Class KeyStoreX509CredentialAdapter

  • All Implemented Interfaces:
    org.opensaml.security.credential.Credential, org.opensaml.security.x509.X509Credential

    public class KeyStoreX509CredentialAdapter
    extends org.opensaml.security.credential.AbstractCredential
    implements org.opensaml.security.x509.X509Credential
    A wrapper that changes a KeyStore in to a X509Credential.
    • Field Detail

      • log

        private org.slf4j.Logger log
        Class logger.
      • keyStore

        private final KeyStore keyStore
        Keystore that contains the credential to be exposed.
      • credentialAlias

        private final String credentialAlias
        Alias to the credential to be exposed.
      • keyPassword

        private final char[] keyPassword
        Password for the key to be exposed.
    • Constructor Detail

      • KeyStoreX509CredentialAdapter

        public KeyStoreX509CredentialAdapter​(@Nonnull @ParameterName(name="store")
                                             KeyStore store,
                                             @Nonnull @ParameterName(name="alias")
                                             String alias,
                                             @Nullable @ParameterName(name="password")
                                             char[] password)
        Constructor.
        Parameters:
        store - store containing key to be exposed
        alias - alias to the credential to be exposed
        password - password to the key to be exposed
    • Method Detail

      • getCRLs

        @Nullable
        public Collection<X509CRL> getCRLs()
        Specified by:
        getCRLs in interface org.opensaml.security.x509.X509Credential
      • getEntityCertificate

        @Nonnull
        public X509Certificate getEntityCertificate()
        Specified by:
        getEntityCertificate in interface org.opensaml.security.x509.X509Credential
      • getEntityCertificateChain

        @Nonnull
        public Collection<X509Certificate> getEntityCertificateChain()
        Specified by:
        getEntityCertificateChain in interface org.opensaml.security.x509.X509Credential
      • getPrivateKey

        @Nullable
        public PrivateKey getPrivateKey()
        Specified by:
        getPrivateKey in interface org.opensaml.security.credential.Credential
        Overrides:
        getPrivateKey in class org.opensaml.security.credential.AbstractCredential
      • getPublicKey

        @Nullable
        public PublicKey getPublicKey()
        Specified by:
        getPublicKey in interface org.opensaml.security.credential.Credential
        Overrides:
        getPublicKey in class org.opensaml.security.credential.AbstractCredential
      • getCredentialType

        @Nonnull
        public Class<? extends org.opensaml.security.credential.Credential> getCredentialType()
        Specified by:
        getCredentialType in interface org.opensaml.security.credential.Credential
      • setEntityId

        public void setEntityId​(@Nullable
                                String newEntityID)
        Overrides:
        setEntityId in class org.opensaml.security.credential.AbstractCredential
      • setUsageType

        public void setUsageType​(@Nonnull
                                 org.opensaml.security.credential.UsageType newUsageType)
        Overrides:
        setUsageType in class org.opensaml.security.credential.AbstractCredential