Here you can find the source of getKeyManagers()
public static KeyManager[] getKeyManagers()
//package com.java2s; //License from project: Apache License import javax.net.ssl.KeyManager; import javax.net.ssl.KeyManagerFactory; import java.io.FileInputStream; import java.security.KeyStore; public class Main { public static KeyManager[] getKeyManagers() { String pass = "lib.pass"; try {/*w w w .jav a2 s . c o m*/ KeyStore keyStore = KeyStore.getInstance("JKS"); keyStore.load(new FileInputStream("keystore.jks"), pass.toCharArray()); KeyManagerFactory keyManagerFactory = KeyManagerFactory .getInstance(KeyManagerFactory.getDefaultAlgorithm()); keyManagerFactory.init(keyStore, pass.toCharArray()); return keyManagerFactory.getKeyManagers(); } catch (Exception e) { throw new RuntimeException(e); } } }