OpenSSL command line-certificate authentication

Source: Internet
Author: User
Tags openssl x509 pkcs12

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.