User Tools

Site Tools


This is an old revision of the document!

Convert a Key

Convert P12 to Java Keystore

keytool -importkeystore -srckeystore testkey.p12 -srcstoretype pkcs12 -srcalias 1 -destkeystore testkey.jks -deststoretype jks -destalias testkey

You can add -deststorepass PASSWORD to set the password on the command line. If you don't, keytool will ask you for a password.

Export Certificate from P12

Export the certificate with the complete certificate chain:

openssl pkcs12 -in testkey.p12 -out testkey.pem -nokeys

Export the certificate only:

openssl pkcs12 -in testkey.p12 -out testkey.pem -nokeys -clcerts
info/cryptography/openssl/convert_key.1430904094.txt.gz · Last modified: 2015-05-06 11:21 by andunix