|
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.KeyManagerHelper
public class KeyManagerHelper
Helper class that provides convenient methods to create KeyManager instances.
Constructor Summary | |
---|---|
KeyManagerHelper()
|
Method Summary | |
---|---|
static javax.net.ssl.X509ExtendedKeyManager |
createEmptyKeyManager()
Creates empty KeyManager instance, one that does not contain any keys and/or certificates. |
static javax.net.ssl.X509ExtendedKeyManager |
createJKSKeyManager(java.io.InputStream jksStream,
char[] keyStorePassword,
char[] entryPassword)
Creates KeyManager that will use specified key store to get party credentials. |
static javax.net.ssl.X509ExtendedKeyManager |
createJKSKeyManager(java.lang.String jksFilePath,
char[] keyStorePassword,
char[] entryPassword)
Creates KeyManager that will use specified key store to get party credentials. |
static javax.net.ssl.X509ExtendedKeyManager |
createMSCAPIKeyManager(javax.security.auth.callback.CallbackHandler callbackHandler,
java.lang.String certThumbprint)
Creates KeyManager that will use specified entry from Windows Certificate Services (WCS) as party credentials. |
static javax.net.ssl.X509ExtendedKeyManager |
createPEMKeyManager(java.io.InputStream certStream,
java.io.InputStream keyStream)
Creates KeyManager that will use specified private key and certificate as party credentials. |
static javax.net.ssl.X509ExtendedKeyManager |
createPEMKeyManager(java.lang.String certFilePath,
java.lang.String keyFilePath)
Creates KeyManager that will use specified private key and certificate as party credentials. |
static javax.net.ssl.X509ExtendedKeyManager |
createPKCS11KeyManager(javax.security.auth.callback.CallbackHandler callbackHandler)
Creates KeyManager that will use PKCS#11 security provider key store as party credentials. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyManagerHelper()
Method Detail |
---|
public static javax.net.ssl.X509ExtendedKeyManager createPEMKeyManager(java.io.InputStream certStream, java.io.InputStream keyStream) throws java.io.IOException, java.security.GeneralSecurityException
certStream
- Stream to load certificate from. Certificate must be in X.509 PEM format.keyStream
- Stream to load private key from. Key must be in PKCS#8 PEM format without
password protection.
java.io.IOException
- If there are problems reading any of the streams
java.security.GeneralSecurityException
- If there are problems with certificate/key format and/or datapublic static javax.net.ssl.X509ExtendedKeyManager createPEMKeyManager(java.lang.String certFilePath, java.lang.String keyFilePath) throws java.io.IOException, java.security.GeneralSecurityException
certFilePath
- Path to an existing file containing certificate in PEM-encoded X.509 format.keyFilePath
- Path to an existing file containing private key in PEM-encoded PKCS#8 format.
java.io.IOException
java.security.GeneralSecurityException
public static javax.net.ssl.X509ExtendedKeyManager createMSCAPIKeyManager(javax.security.auth.callback.CallbackHandler callbackHandler, java.lang.String certThumbprint) throws java.io.IOException, java.security.GeneralSecurityException
callbackHandler
- CallbackHandler instance used to provide password necessary to access
the entry. Must be always provided, can not be null. Use
DummyCallbackHandler instance if no password is required.certThumbprint
- Hexadecimal thumbprint (SHA1 hash of signed certificate data) used to
identify entry in WCS
java.io.IOException
java.security.GeneralSecurityException
public static javax.net.ssl.X509ExtendedKeyManager createPKCS11KeyManager(javax.security.auth.callback.CallbackHandler callbackHandler) throws java.io.IOException, java.security.GeneralSecurityException
callbackHandler
- CallbackHandler instance used to provide password necessary to access
key store. Must be always provided, can not be null. Use
DummyCallbackHandler instance if no password is required.
java.security.GeneralSecurityException
- If Java runtime is not in FIPS mode or there are problems getting
data from key store.
java.io.IOException
- If there are problems accessing key store.public static javax.net.ssl.X509ExtendedKeyManager createJKSKeyManager(java.io.InputStream jksStream, char[] keyStorePassword, char[] entryPassword) throws java.io.IOException, java.security.GeneralSecurityException
jksStream
- Stream to read key store fromkeyStorePassword
- Password to access key storeentryPassword
- Password to access key/certificate entry in the key store
java.io.IOException
- If there are problems reading data from stream.
java.security.GeneralSecurityException
- If there are problems accessing key store.public static javax.net.ssl.X509ExtendedKeyManager createJKSKeyManager(java.lang.String jksFilePath, char[] keyStorePassword, char[] entryPassword) throws java.io.IOException, java.security.GeneralSecurityException
jksFilePath
- Path to file to read key store fromkeyStorePassword
- Password to access key storeentryPassword
- Password to access key/certificate entry in the key store
java.io.IOException
- If there are problems reading data from file.
java.security.GeneralSecurityException
- If there are problems accessing key store.public static javax.net.ssl.X509ExtendedKeyManager createEmptyKeyManager()
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |