Class X509CertificatesCredentialReader

  • All Implemented Interfaces:
    CredentialReader<java.security.cert.X509Certificate[]>

    public class X509CertificatesCredentialReader
    extends AbstractCredentialReader<java.security.cert.X509Certificate[]>
    Loads X.509 certificate credentials from a classpath, filepath, or stream resource. When working with filepath, multiple files may be separated using a comma (i.e. cert1.pem,cert2.crt). Supported certificate formats include: PEM, DER, and PKCS7.
    Author:
    Middleware Services
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.security.cert.X509Certificate[] read​(java.io.InputStream is, java.lang.String... params)
      Reads a credential object from an input stream.
      java.security.cert.X509Certificate[] read​(java.lang.String path, java.lang.String... params)
      Reads a credential object from a path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • X509CertificatesCredentialReader

        public X509CertificatesCredentialReader()
    • Method Detail

      • read

        public java.security.cert.X509Certificate[] read​(java.lang.String path,
                                                         java.lang.String... params)
                                                  throws java.io.IOException,
                                                         java.security.GeneralSecurityException
        Description copied from interface: CredentialReader
        Reads a credential object from a path.
        Specified by:
        read in interface CredentialReader<java.security.cert.X509Certificate[]>
        Overrides:
        read in class AbstractCredentialReader<java.security.cert.X509Certificate[]>
        Parameters:
        path - from which to read credential.
        params - Arbitrary string parameters, e.g. password, needed to read the credential.
        Returns:
        credential read from data at path.
        Throws:
        java.io.IOException - On IO errors.
        java.security.GeneralSecurityException - On errors with the credential data.
      • read

        public java.security.cert.X509Certificate[] read​(java.io.InputStream is,
                                                         java.lang.String... params)
                                                  throws java.io.IOException,
                                                         java.security.GeneralSecurityException
        Description copied from interface: CredentialReader
        Reads a credential object from an input stream.
        Parameters:
        is - input stream from which to read credential.
        params - Arbitrary string parameters, e.g. password, needed to read the credential.
        Returns:
        credential read from data in stream.
        Throws:
        java.io.IOException - On IO errors.
        java.security.GeneralSecurityException - On errors with the credential data.