|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.commons.connection.tls.KeyStoreFactory
public class KeyStoreFactory
Utility class, provides methods to create and tune key stores.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_CERT_ALIAS
Default entry alias used when creating KeyStore from *.PEM certificate and private key |
static char[] |
DEFAULT_PASSWORD
Default entry password used when creating KeyStore from *.PEM CA certificate |
static java.lang.String |
DEFAULT_TRUST_CERT_ALIAS
Default entry alias used when creating KeyStore from *.PEM CA certificate |
Constructor Summary | |
---|---|
KeyStoreFactory()
|
Method Summary | |
---|---|
static java.security.KeyStore |
createJKSKeyStore(java.io.InputStream jksStream,
char[] keyStorePassword)
Loads Java Key Store (JKS) from file. |
static java.security.KeyStore |
createMSCAPIMyStore(javax.security.auth.callback.CallbackHandler keyStoreCallbackHandler)
Creates instance of Windows Certificate Services (WCS) user personal certificates key store |
static java.security.KeyStore |
createMSCAPIRootStore(javax.security.auth.callback.CallbackHandler keyStoreCallbackHandler)
Creates instance of Windows Certificate Services (WCS) user trusted root key store |
static java.security.KeyStore |
createPEMCertKeyStore(java.security.cert.Certificate[] certChain,
java.security.PrivateKey key)
Creates instance of in-memory collection-based certificate/key key store |
static java.security.KeyStore |
createPEMTrustKeyStore(java.security.cert.Certificate trustCert)
Creates instance of in-memory collection-based trust key store |
static java.security.KeyStore |
createPKCS11KeyStore(javax.security.auth.callback.CallbackHandler keyStoreCallbackHandler)
Creates instance of PKCS#11 key store |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_CERT_ALIAS
public static final java.lang.String DEFAULT_TRUST_CERT_ALIAS
public static final char[] DEFAULT_PASSWORD
Constructor Detail |
---|
public KeyStoreFactory()
Method Detail |
---|
public static java.security.KeyStore createPKCS11KeyStore(javax.security.auth.callback.CallbackHandler keyStoreCallbackHandler) throws java.security.GeneralSecurityException, java.io.IOException
keyStoreCallbackHandler
- CallbackHandler instance used to provide password to access
key store.
java.security.GeneralSecurityException
- If there are problems accessing key store
java.io.IOException
- If there are problems accessing key storepublic static java.security.KeyStore createMSCAPIRootStore(javax.security.auth.callback.CallbackHandler keyStoreCallbackHandler) throws java.security.GeneralSecurityException, java.io.IOException
keyStoreCallbackHandler
- CallbackHandler instance used to provide password to access
key store.
java.security.GeneralSecurityException
- If there are problems accessing key store
java.io.IOException
- If there are problems accessing key storepublic static java.security.KeyStore createMSCAPIMyStore(javax.security.auth.callback.CallbackHandler keyStoreCallbackHandler) throws java.security.GeneralSecurityException, java.io.IOException
keyStoreCallbackHandler
- CallbackHandler instance used to provide password to access
key store.
java.security.GeneralSecurityException
- If there are problems accessing key store
java.io.IOException
- If there are problems accessing key storepublic static java.security.KeyStore createPEMTrustKeyStore(java.security.cert.Certificate trustCert) throws java.security.GeneralSecurityException, java.io.IOException
trustCert
- Certificate to be stored as a trusted certificate entry
java.security.GeneralSecurityException
- If there are problems creating key store
java.io.IOException
- If there are problems creating key storepublic static java.security.KeyStore createPEMCertKeyStore(java.security.cert.Certificate[] certChain, java.security.PrivateKey key) throws java.security.GeneralSecurityException, java.io.IOException
certChain
- Certificate chain to be stored together with private key in a
"private key" entrykey
- Private Key to be stored together with certificate chain in a
"private key" entry
java.security.GeneralSecurityException
- If there are problems creating key store
java.io.IOException
- If there are problems creating key storepublic static java.security.KeyStore createJKSKeyStore(java.io.InputStream jksStream, char[] keyStorePassword) throws java.security.GeneralSecurityException, java.io.IOException
jksStream
- Stream to load fromkeyStorePassword
- Password to access key store
java.security.GeneralSecurityException
- If there are problems accessing key store
java.io.IOException
- If there are problems loading key store
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |