Class DERCredential

    • Constructor Detail

      • DERCredential

        public DERCredential​(java.io.InputStream privateKeyStream,
                             java.io.InputStream certificateStream,
                             char[] keyPasswd)
                      throws java.io.IOException,
                             java.security.KeyStoreException,
                             java.security.cert.CertificateException
        Constructs the object from two InputStreams which can be used to read a private key and certificate in DER PKCS8 format.

        The streams are closed after constructing the object.

        Parameters:
        privateKeyStream - InputStream which can be used to read the private key in DER format
        certificateStream - certificate input stream in DER format
        keyPasswd - key password or null if the key is not encrypted
        Throws:
        java.io.IOException - if any of streams can not be read
        java.security.KeyStoreException - if private key can not be parsed
        java.security.cert.CertificateException - if certificate can not be parsed
      • DERCredential

        public DERCredential​(java.lang.String keyPath,
                             java.lang.String certificatePath,
                             char[] keyPasswd)
                      throws java.io.IOException,
                             java.security.KeyStoreException,
                             java.security.cert.CertificateException
        Constructs the object from two files containing private key and certificate in DER PKCS8 format.

        The streams are closed after constructing the object.

        Parameters:
        keyPath - private key file path in DER format
        certificatePath - certificate file path in DER format
        keyPasswd - key password or null if the key is not encrypted
        Throws:
        java.io.IOException - if any of files can not be read
        java.security.KeyStoreException - if private key can not be parsed
        java.security.cert.CertificateException - if certificate can not be parsed