KeyManager[] keyManagers = null;
InputStream keystoreInputStream = null;
if (_keystore != null)
keystoreInputStream = Resource.newResource(_keystore).getInputStream();
KeyStore keyStore = KeyStore.getInstance(_keystoreType);
keyStore.load(keystoreInputStream, _password == null ? null : _password.toString().toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(_sslKeyManagerFactoryAlgorithm);
keyManagerFactory.init(keyStore, _keyPassword == null ? null : _keyPassword.toString().toCharArray());
keyManagers = keyManagerFactory.getKeyManagers();
TrustManager[] trustManagers = null;
InputStream truststoreInputStream = null;
if (_truststore != null)
truststoreInputStream = Resource.newResource(_truststore).getInputStream();
KeyStore trustStore = KeyStore.getInstance(_truststoreType);
trustStore.load(truststoreInputStream, _trustPassword == null ? null : _trustPassword.toString()
.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory
.getInstance(_sslTrustManagerFactoryAlgorithm);
trustManagerFactory.init(trustStore);