Class KeyStoreConfig

java.lang.Object
no.digipost.signature.client.security.KeyStoreConfig

public class KeyStoreConfig extends Object
  • Field Details

    • keyStore

      public final KeyStore keyStore
    • alias

      public final String alias
    • keystorePassword

      public final String keystorePassword
    • privatekeyPassword

      public final String privatekeyPassword
  • Constructor Details

  • Method Details

    • getCertificateChain

      public Certificate[] getCertificateChain()
    • getCertificate

      public X509Certificate getCertificate()
    • getPrivateKey

      public PrivateKey getPrivateKey()
    • fromKeyStore

      @Deprecated public static KeyStoreConfig fromKeyStore(InputStream javaKeyStore, String alias, String keyStorePassword, String privatekeyPassword)
      Deprecated.
      as of 4.3, please use fromJavaKeyStore(InputStream, String, String, String)(same functionality, different name), or load directly from organization certificate using {fromOrganizationCertificate(InputStream, String)}
    • fromJavaKeyStore

      public static KeyStoreConfig fromJavaKeyStore(InputStream javaKeyStore, String alias, String keyStorePassword, String privatekeyPassword)
      Create a KeyStoreConfig from a Java Key Store containing an Organization Certificate (Virksomhetssertifikat).
      Parameters:
      javaKeyStore - A stream of the certificate in JCEKS format.
      alias - The alias of the organization certificate in the key store.
      keyStorePassword - The password for the key store itself.
      privatekeyPassword - The password for the private key of the organization certificate within the key store.
      Returns:
      The config, containing the certificate, the private key and the certificate chain.
    • fromOrganizationCertificate

      public static KeyStoreConfig fromOrganizationCertificate(InputStream organizationCertificateStream, String privatekeyPassword)
      Create a KeyStoreConfig from an Organization Certificate (Virksomhetssertifikat).
      Parameters:
      organizationCertificateStream - A stream of the certificate in PKCS12 format. The file should have .p12-file ending.
      privatekeyPassword - The password for the private key of the organization certificate.
      Returns:
      The config, containing the certificate, the private key and the certificate chain.