Search code examples
keytoolp12

How to generate p12 file using pem and key file in Keytool


I want to generate p12 file from existing pem and key file using keytool

Can anyone implemented it?

Thanks in Advance


Solution

  • keytool -genkeypair -alias key -keystore something.keystore -dname "CN=YourCN,O=Thing,C=US" -validity 9999
    
    keytool -importkeystore -srckeystore something.keystore -destkeystore something.p12 -srcstoretype JKS -deststoretype PKCS12 -deststorepass something