Here you can find the source of getKey(KeyStore keystore, String alias, String password)
public static Key getKey(KeyStore keystore, String alias, String password) throws GeneralSecurityException
//package com.java2s; import java.security.*; public class Main { /**//from w ww. j a va2 s . c o m Get a private key from the keystore by name and password. */ public static Key getKey(KeyStore keystore, String alias, String password) throws GeneralSecurityException { return keystore.getKey(alias, password.toCharArray()); } }