public class SSLContextUtil extends Object
PushManager.| Constructor and Description |
|---|
SSLContextUtil() |
| Modifier and Type | Method and Description |
|---|---|
static SSLContext |
createDefaultSSLContext(InputStream keystoreInputStream,
String keystorePassword)
Creates a new SSL context using the JVM default trust managers and the certificates in the given PKCS12 InputStream.
|
static SSLContext |
createDefaultSSLContext(KeyStore keyStore,
char[] keyStorePassword)
Creates a new SSL context using the JVM default trust managers and the certificates in the given keystore.
|
static SSLContext |
createDefaultSSLContext(String pathToPKCS12File,
String keystorePassword)
Creates a new SSL context using the JVM default trust managers and the certificates in the given PKCS12 file.
|
public static SSLContext createDefaultSSLContext(String pathToPKCS12File, String keystorePassword) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, KeyManagementException, IOException
pathToPKCS12File - the path to a PKCS12 file that contains the client certificatekeystorePassword - the password to read the PKCS12 file; may be nullKeyStoreExceptionNoSuchAlgorithmExceptionCertificateExceptionUnrecoverableKeyExceptionKeyManagementExceptionIOExceptionpublic static SSLContext createDefaultSSLContext(InputStream keystoreInputStream, String keystorePassword) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, KeyManagementException, IOException
keystoreInputStream - a PKCS12 file that contains the client certificatekeystorePassword - the password to read the PKCS12 file; may be nullKeyStoreExceptionNoSuchAlgorithmExceptionCertificateExceptionUnrecoverableKeyExceptionKeyManagementExceptionIOExceptionpublic static SSLContext createDefaultSSLContext(KeyStore keyStore, char[] keyStorePassword) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, KeyManagementException
keyStore - A KeyStore containing the client certificates to present during a TLS handshake; may be
null if the environment does not require TLS. The KeyStore should be loaded before being used
here.keyStorePassword - a password to unlock the given KeyStore; may be nullKeyStoreExceptionNoSuchAlgorithmExceptionUnrecoverableKeyExceptionKeyManagementExceptionCopyright © 2013–2015 RelayRides. All rights reserved.