$ openssl pkcs12 -in cert.pfx -nocerts -nodes | openssl rsa -out rsaprivkey.pem
How to convert .P7B certificate to .PFX
.P7B Convert to .PFX
1. Download the openssl tool, (here we take the windows system as an example)
https://www. chinassl.net/download/d1.html
2. Format conversion
P7B (PKCS#7)
a A P7B file is a text file that contains the certificate and certificate chain, but not the private key.
PFX (PKCS#12)
Specifies a portable format for storing and transmitting user or server private keys, public keys, and certificates. It is a binary format and these files are also called PFX files.
Convert P7B to PFX
It should be noted that in order to do the conversion, you must have the certificate cert.p7b file and the private key cert.key file.
$ openssl pkcs7 -print_certs -in cert.p7b -out cert.cer
-print_certs: Output any certificates contained in the file.
-in: Specify the input file.
-out: Specify the output file.
$ openssl pkcs12 -export -in cert.cer -inkey cert.key -out cert.pfx
-export: Indicates exporting the certificate.
-in:Specifies the file name of PKCS#12.
-
-inkey: Specify the private key file name.
-out: Specify the output file.
3. Extension:
Create a self-signed certificate
Create a 2048-bit RSA certificate, valid for 5 years:
$ openssl req -new -x509 -days 1825 -sha256 -nodes -out cert.crt \ -keyout cert.key
req: Generate certificate issuance request command
-new: Indicates a new request.
-x509: Command to issue X.509 format certificate.
##-days: means Validity days.
-sha256: represents the certificate digest algorithm, here is SHA256.
-nodes : The private key will not be encrypted.
-out: Specify the output file name.
-
-keyout: Specify the file name of the newly created private key.
$ openssl pkcs12 -export -in cert.crt -inkey cert.key -out cert.pfx
$ openssl req -new -newkey rsa:2048 -sha256 -nodes -out cert.csr \
-keyout cert.key
Copy after login
$ openssl req -new -newkey rsa:2048 -sha256 -nodes -out cert.csr \ -keyout cert.key
- newkey: Create a new certificate request and KEY.
Note: "Country Name" must be "CN", other fields can be filled in as you like. Create RSA private key for PFX$ openssl pkcs12 -in cert.pfx -nocerts -nodes | openssl rsa -out rsaprivkey.pem
Copy after login
$ openssl pkcs12 -in cert.pfx -nocerts -nodes | openssl rsa -out rsaprivkey.pem
The above is the detailed content of How to convert .P7B certificate to .PFX. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

