Here you can find the source of getKeyManagers(KeyStore keyStore, String keyPassword)
private static KeyManager[] getKeyManagers(KeyStore keyStore, String keyPassword) throws GeneralSecurityException, IOException
//package com.java2s; //License from project: Open Source License import javax.net.ssl.KeyManager; import javax.net.ssl.KeyManagerFactory; import java.io.IOException; import java.security.GeneralSecurityException; import java.security.KeyStore; public class Main { private static KeyManager[] getKeyManagers(KeyStore keyStore, String keyPassword) throws GeneralSecurityException, IOException { String alg = KeyManagerFactory.getDefaultAlgorithm(); char[] keyPass = keyPassword != null ? keyPassword.toCharArray() : null; KeyManagerFactory fac = KeyManagerFactory.getInstance(alg); fac.init(keyStore, keyPass);//from w ww. j ava 2 s . c o m return fac.getKeyManagers(); } }