. P7B converted to. PFX
1. Download the OpenSSL tool (for example, Windows system)
Https://www.chinassl.net/download/d1.html
2. Format conversion
p7b (pkcs#7)
A p7b file is a text file that contains a certificate and a chain of certificates, but does not contain a private key .
PFX (pkcs#12)
A portable format is specified for storing and transporting the user or server private key, public key, and certificate. It is a binary format that these files are also known as PFX files.
convert p7b to PFX
It is important to note 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: Any certificate contained in the output file .
-in: Specifies the input file .
-out: Specifies the output file.
$ OpenSSL pkcs12-export-in cert.cer-inkey cert.key-out cert.pfx
-export: represents the export certificate .
-in: Specifies the file name of the pkcs#12.
-inkey: Specifies the private key file name.
-out: Specifies 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: represents a new request.
-x509: The issuance of the certificate of the ".
-days: indicates the number of days that are valid.
-sha256: represents the Certificate digest algorithm, which is SHA256.
-nodes: the private key will not be encrypted .
-out: Specifies the output file name.
-keyout: Specifies the file name of the newly created private key .
$ OpenSSL pkcs12-export-in cert.crt-inkey cert.key-out cert.pfx
Create a certificate request (CSR)
$ 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" and other fields can be filled in at will.
create RSA private key to PFX
$ OpenSSL pkcs12-in cert.pfx-nocerts-nodes | OpenSSL rsa-out Rsaprivkey.pem
This article is from the "My World" blog, so be sure to keep this source http://biweili.blog.51cto.com/4234993/1852336
. The P7B certificate is converted to. PFX