Class X509PemFilesSecret

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class X509PemFilesSecret
    extends AbstractX509PemSecret
    Secret based on PEM-encoded X.509 certificate files and key.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String cert
      The local certificate.
      protected java.lang.String key
      The local certificate key.
      static java.lang.String PREFIX
      Prefix used to encode secret type as strings.
    • Constructor Summary

      Constructors 
      Constructor Description
      X509PemFilesSecret​(java.lang.String encodedstring)  
      X509PemFilesSecret​(java.lang.String cert, java.lang.String key)
      Creates the secret.
    • Field Detail

      • PREFIX

        public static final java.lang.String PREFIX
        Prefix used to encode secret type as strings.
        See Also:
        Constant Field Values
      • cert

        protected java.lang.String cert
        The local certificate.
      • key

        protected java.lang.String key
        The local certificate key.
    • Constructor Detail

      • X509PemFilesSecret

        public X509PemFilesSecret​(java.lang.String encodedstring)
      • X509PemFilesSecret

        public X509PemFilesSecret​(java.lang.String cert,
                                  java.lang.String key)
        Creates the secret.
        Parameters:
        cacert - Path to the trust anchor certificate.
        cert - Path to the local certificate.
        key - Path to the local certificate key.
    • Method Detail

      • canSign

        public boolean canSign()
        Tests if the secret can be used for signing or, alternatively, verification only.
        Specified by:
        canSign in class AbstractAuthenticationSecret
        Returns:
        True, if the secret can be used for signing.
      • openCertificate

        public java.io.InputStream openCertificate()
        Opens the local certificate.
        Specified by:
        openCertificate in class AbstractX509PemSecret
        Returns:
        The local certificate.
      • openPrivateKey

        public java.io.InputStream openPrivateKey()
        Opens the private key used for signing.
        Specified by:
        openPrivateKey in class AbstractX509PemSecret
        Returns:
        The private key.
      • toString

        public java.lang.String toString()
        Converts to encoded string.
        Overrides:
        toString in class java.lang.Object