Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // open the file
- fileName = "my_output.p12";
- OutputStream outFile = new FileOutputStream (fileName);
- // get privatekey and cert details ...
- // ...
- // initialize
- // note: I have also tried: KeyStore.getInstance("PKCS12", "BC");
- KeyStore keyStore = KeyStore.getInstance("PKCS12");
- keyStore.load(null, null);
- // this line doesn't add my password "test_pass" !
- keyStore.setKeyEntry("test_alias", myExistingPrivateKey, "key_pass".toCharArray(), myExistingCertChain);
- // store keystore and close file
- keyStore.store(outFile, "container_pass".toCharArray());
- outFile.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement