Command 1:
OpenSSL genrsa-out Root.key 1024
Generate a Root.key private key
Command 2:
OpenSSL req-key root.key-new-out root . Req
produce a certificate request req file according to the private keyCommand 3:OpenSSL x509-req-in root.req-signkey root.key-out root.pem-passin pass:123456-days 3650
Self-issued a certificate PEM
Command 1: OpenSSL genrsa-out 1.key 1024x768generate a 1.key private key
Command 2: OpenSSL req-key 1.key-new-out 1.reqproduce a certificate request req file according to the private key
Command 3:
OpenSSL x509-req-in 1.req-ca root.pem-cakey root.key-out 1.pem-passin pass:123456-cacreateserial
Issue a 1.PEM certificate with a self-signed certificate Root.pem
conversion of PEM and P12 formats to each otherPem converted to P12
OpenSSL pkcs12-export-inkey 1.key-in 1.pem-passin pass:123456-passout pass:123456-out 1.p12
P12 converted to PEM
Certificate: OpenSSL pkcs12-in mysite.p12-nokeys-passin pass:123456-out Mysite.pem
Private key: OpenSSL pkcs12-in mysite.p12-nocerts-passin pass:123456-passout pass:123123-out Mysite.key
the full certificate content
$ OpenSSL x509-in Mysite.pem-noout-text
OpenSSL command line-certificate authentication