Class PrivateKeyCredentialReader

  • All Implemented Interfaces:
    CredentialReader<java.security.PrivateKey>

    public class PrivateKeyCredentialReader
    extends AbstractCredentialReader<java.security.PrivateKey>
    Reads private key credentials from classpath, filepath, or stream resource. Supported private key formats include: PKCS8.
    Author:
    Middleware Services
    • Constructor Detail

      • PrivateKeyCredentialReader

        public PrivateKeyCredentialReader()
    • Method Detail

      • read

        public java.security.PrivateKey read​(java.io.InputStream is,
                                             java.lang.String... params)
                                      throws java.io.IOException,
                                             java.security.GeneralSecurityException
        Reads a private key from an input stream.
        Parameters:
        is - Input stream from which to read private key.
        params - A single optional parameter, algorithm, may be specified. The default is RSA.
        Returns:
        Private key read from data in stream.
        Throws:
        java.io.IOException - On IO errors.
        java.security.GeneralSecurityException - On errors with the credential data.