}
KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm);
kmf.init(ks, keystorePass.toCharArray());
kms = kmf.getKeyManagers();
for(int i=0; certAlias!=null && i<kms.length; i++) {
kms[i] = new JSSEKeyManager((X509KeyManager)kms[i], certAlias);
}
return kms;
}