How to convert a p12 file into gateway.jks,cacerts.jks

4k views Asked by At

In my glassfish config file there are 3 key files gateway.jks,cacerts.jks,HOST1.cer. For connecting the the application to remote server the server team provides a .p12 file .I converted that .p12 file to private and public key pair. But unable to create the jks keys from the .p12 file. if any one done this before please help.

1

There are 1 answers

1
Jenananthan On BEST ANSWER

if you have .p12 file, using java keytool you can import the cert and key to jk with following command .(e.g your .p12 file is test.p12 and you want to add it to test.jks)

keytool -importkeystore -srckeystore test.p12 -srcstoretype pkcs12 -destkeystore test.jks -deststoretype JKS

for more detail refer http://xacmlinfo.org/2014/06/13/how-to-keystore-creating-jks-file-from-existing-private-key-and-certificate/