Here you can find the source of getKeyManagerFactory(Map
private static KeyManagerFactory getKeyManagerFactory(Map<String, Object> stores) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException
//package com.java2s; //License from project: Apache License import javax.net.ssl.KeyManagerFactory; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.UnrecoverableKeyException; import java.util.Map; public class Main { /**/* ww w. jav a2 s . c o m*/ * Given a keystore and keystore password (as generated by {@link #pemsToKeyAndTrustStores}), * return a key manager factory that contains the keystore. * * @param keystore The keystore to get a key manager for * @param password The password for the keystore * @return A key manager factory for the provided keystore * @throws NoSuchAlgorithmException * @throws KeyStoreException * @throws UnrecoverableKeyException */ public static KeyManagerFactory getKeyManagerFactory(KeyStore keystore, String password) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException { KeyManagerFactory factory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); factory.init(keystore, password.toCharArray()); return factory; } private static KeyManagerFactory getKeyManagerFactory(Map<String, Object> stores) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException { KeyStore keystore = (KeyStore) stores.get("keystore"); String password = (String) stores.get("keystore-pw"); return getKeyManagerFactory(keystore, password); } }