0

I have been stuck in a situation where i have a Keystore.jks in my configuration folder. Now from GUI i have to add a certificate+key in P12 format and store this certificate in Keystore.jks. When a user add the certificate then passphrase is also required to be added. All this i have to do with the help of Java. I cannot use direct commands present in Keytool or openssl. I have to do it programmatically.

  • Possible dublicate: https://stackoverflow.com/questions/18889058/programmatically-import-ca-trust-cert-into-existing-keystore-file-without-using – Roman Makhlin Dec 16 '15 at 09:26
  • You should read iterate over content of p12 keystore and populate jks keystore with content. Class [java.security.KeyStore](http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html) has nesessary methods. Check [this question](http://stackoverflow.com/questions/3027273/how-to-store-and-load-keys-using-java-security-keystore-class), for example – user1516873 Dec 16 '15 at 09:50
  • the issue is resolved. Actually the requirement was that i need the pass-phrase to just load the pkcs12 container. Thanks everyone for you reply. – aniket gupta Dec 21 '15 at 03:28

0 Answers0