public class Pkcs12KeyStore extends Object
java.security.KeyStore that holds certificates and keys
used for signing http messages (QSEAL) and client tls authentication (QWAC).
By default a key store is expected to have two bags named "default_qwac" and
"default_qseal" and an empty password.
A key store file may be created using openssl and keytool
command line tools. First create a p12 file for each certificate/key pair
with a specific alias.
openssl pkcs12 -export -out <p12_file> -in <cert_file> -inkey <key_file> -name <alias>And then combine all p12 files into one.
keytool -importkeystore -srckeystore <src_p12> -destkeystore <dest_p12> -srcstorepass '' -deststorepass ''
| Constructor and Description |
|---|
Pkcs12KeyStore(InputStream keyStore) |
Pkcs12KeyStore(InputStream keyStore,
char[] password,
String defaultQwacAlias,
String defaultQsealAlias) |
Pkcs12KeyStore(String filename) |
Pkcs12KeyStore(String filename,
char[] password) |
Pkcs12KeyStore(String filename,
char[] password,
String defaultQwacAlias,
String defaultQsealAlias) |
| Modifier and Type | Method and Description |
|---|---|
String |
getOrganizationIdentifier() |
String |
getOrganizationIdentifier(String qsealAlias) |
X509Certificate |
getQsealCertificate() |
X509Certificate |
getQsealCertificate(String qsealAlias) |
PrivateKey |
getQsealPrivateKey() |
PrivateKey |
getQsealPrivateKey(String qsealAlias) |
SSLContext |
getSslContext() |
SSLContext |
getSslContext(String qwacAlias) |
public Pkcs12KeyStore(String filename) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException
public Pkcs12KeyStore(String filename, char[] password) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException
public Pkcs12KeyStore(String filename, char[] password, String defaultQwacAlias, String defaultQsealAlias) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException
public Pkcs12KeyStore(InputStream keyStore, char[] password, String defaultQwacAlias, String defaultQsealAlias) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException
public Pkcs12KeyStore(InputStream keyStore) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException
public SSLContext getSslContext() throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableEntryException, KeyManagementException, IOException, CertificateException
public SSLContext getSslContext(String qwacAlias) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnrecoverableEntryException, KeyManagementException
public X509Certificate getQsealCertificate() throws KeyStoreException
KeyStoreExceptionpublic X509Certificate getQsealCertificate(String qsealAlias) throws KeyStoreException
KeyStoreExceptionpublic PrivateKey getQsealPrivateKey() throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException
public PrivateKey getQsealPrivateKey(String qsealAlias) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException
public String getOrganizationIdentifier() throws KeyStoreException
KeyStoreExceptionpublic String getOrganizationIdentifier(String qsealAlias) throws KeyStoreException
KeyStoreExceptionCopyright © 2021. All rights reserved.