NetWitness How To convert PKCS#12 file (.p12 or .pfx) into a PEM file using OpenSSL
Issue
Convert a PKCS#12 file (.p12 or
.pfx) into a PEM file, the resulting PEM file will typically contain the private key, the SSL/TLS certificate, and any intermediate certificates, each in PEM format. This format is commonly used in various cryptographic operations and configurations.
Tasks
This article provides information on how to extract parse certificates and private keys from PKCS #12 files using OpenSSL.
Resolution
- Make sure that PKCS#12 files (.p12 or .pfx) are copied to the appliance.
- Run this command from CLI:
openssl pkcs12 -in file.p12 -out file.pem
OR
openssl pkcs12 -in file.pfx -out file.pem
- This will dump all the keys and certificates in the PKCS#12 file to a file named file.pem. It will ask you for the password to decrypt the PKCS#12 file and the pass phrase to encrypt the output private key with.
-
Here's what each part of the command does:
openssl: Invokes the OpenSSL command-line tool.pkcs12: Specifies that we're working with PKCS#12 files.-in file.p12 | file.pfx: Specifies the input PKCS#12 file (file.p12).-out file.pem: Specifies the output file (file.pem). This will be a PEM file.
Product Details
NetWItness Product Set: NetWitnessNetWItness Product/Service Type: NetWitness Platform
NetWItness Version/Condition: 11.x, 12.x
Platform: CentOS 7 / Alma
Approval Reviewer Queue
Technical approval queue