Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change a .p12 file to .key file

Tags:

I have a .p12 file, I can also transfer it to a .pem file, but how to transfer it as a .key file?

like image 258
Rico Chan Avatar asked Apr 18 '13 06:04

Rico Chan


People also ask

What is key p12 file?

PKCS#12 (P12) files define an archive file format for storing cryptographic objects as a single file. API Connect supports the P12 file format for uploading a keystore and truststore. The keystore should contain both a private and public key along with intermediate CA certificates.

Does p12 file contain private key?

The . p12 contains both the private and the public key, and also information about the owner (name, email address, etc. ) all being certified by a third party. With such certificate, a user can identify himself and authenticate himself to any organization trusting the third party.


1 Answers

openssl pkcs12 -in out.p12 -nodes -out private.key -nocerts

openssl will ask you for a password, then store the unencrypted private key into the file private.key

Documentation: https://www.openssl.org/docs/man1.1.0/apps/pkcs12.html

like image 101
user1516873 Avatar answered Nov 17 '22 14:11

user1516873