Here you can find the source of getKeyManagerFactory(InputStream key, String keyPassword)
private static KeyManagerFactory getKeyManagerFactory(InputStream key, String keyPassword)
//package com.java2s; //License from project: Apache License import java.io.InputStream; import java.security.KeyStore; import javax.net.ssl.KeyManagerFactory; public class Main { private static KeyManagerFactory getKeyManagerFactory(InputStream key, String keyPassword) { KeyManagerFactory kmf = null; try {//from ww w .j ava2s . c o m String keyStoreType = "BKS"; KeyStore keyStore = KeyStore.getInstance(keyStoreType); keyStore.load(key, keyPassword.toCharArray()); String kmfAlgorithm = KeyManagerFactory.getDefaultAlgorithm(); kmf = KeyManagerFactory.getInstance(kmfAlgorithm); kmf.init(keyStore, keyPassword.toCharArray()); } catch (Exception e) { e.printStackTrace(); } return kmf; } }