Class KeyStoreConfig
java.lang.Object
no.digipost.signature.client.security.KeyStoreConfig
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKeyStoreConfig
(KeyStore keyStore, String alias, String keystorePassword, String privatekeyPassword) -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyStoreConfig
fromJavaKeyStore
(InputStream javaKeyStore, String alias, String keyStorePassword, String privatekeyPassword) Create aKeyStoreConfig
from a Java Key Store containing an Organization Certificate (Virksomhetssertifikat).static KeyStoreConfig
fromKeyStore
(InputStream javaKeyStore, String alias, String keyStorePassword, String privatekeyPassword) Deprecated.static KeyStoreConfig
fromOrganizationCertificate
(InputStream organizationCertificateStream, String privatekeyPassword) Create aKeyStoreConfig
from an Organization Certificate (Virksomhetssertifikat).
-
Field Details
-
keyStore
-
alias
-
keystorePassword
-
privatekeyPassword
-
-
Constructor Details
-
KeyStoreConfig
-
-
Method Details
-
getCertificateChain
-
getCertificate
-
getPrivateKey
-
fromKeyStore
@Deprecated public static KeyStoreConfig fromKeyStore(InputStream javaKeyStore, String alias, String keyStorePassword, String privatekeyPassword) Deprecated.as of 4.3, please usefromJavaKeyStore(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 aKeyStoreConfig
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 aKeyStoreConfig
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.
-
fromJavaKeyStore(InputStream, String, String, String)
(same functionality, different name), or load directly from organization certificate using {fromOrganizationCertificate(InputStream, String)
}