Here you can find the source of getKeyKeyManagerFactoryByPfx(InputStream keyStore, String password)
public static KeyManagerFactory getKeyKeyManagerFactoryByPfx(InputStream keyStore, String password) throws Exception
//package com.java2s; //License from project: Apache License import java.io.InputStream; import java.security.KeyStore; import javax.net.ssl.KeyManagerFactory; public class Main { public static KeyManagerFactory getKeyKeyManagerFactoryByPfx(InputStream keyStore, String password) throws Exception { String algorithm = "sunx509"; String keyStoreType = "PKCS12"; return getKeyKeyManagerFactory(keyStore, password, algorithm, keyStoreType); }/*from ww w . ja v a2 s. com*/ public static KeyManagerFactory getKeyKeyManagerFactory(InputStream keyStore, String password, String algorithm, String keyStoreType) throws Exception { KeyStore ks = KeyStore.getInstance(keyStoreType); ks.load(keyStore, password.toCharArray()); keyStore.close(); KeyManagerFactory k = KeyManagerFactory.getInstance(algorithm); k.init(ks, password.toCharArray()); return k; } }