Android 提取keystore私钥

	public static void main(String[] args) throws Exception {
		char[] password = "你的密码".toCharArray();  
		java.io.FileInputStream fis = new java.io.FileInputStream("keystore文件路径");
		KeyStore ks = KeyStore.getInstance("jks");
		ks.load(fis, password);
		KeyStore.PrivateKeyEntry pkEntry = (KeyStore.PrivateKeyEntry) ks.getEntry(
                "keystore别名",
                new KeyStore.PasswordProtection(password));
		System.out.println(pkEntry.getPrivateKey().toString());
	}


你可能感兴趣的:(Android 提取keystore私钥)