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