OpenSSL tools Common configuration commands

Source: Internet
Author: User
Tags openssl pkcs12 pfx file

In the previous articles on the replacement certificate for VMware products, different OpenSSL configuration commands are used depending on the scenario, and are summarized as follows:


OpenSSL Genrsa 2048 > Rui.key


OpenSSL pkcs12-export-in rui.crt-inkey rui.key-name rui-passout pass:testpassword-out



# Create a certificate request:

OpenSSL Req–new–key rui.key > SITE.CSR

OpenSSL req-new-x509-days 3650-key server.key-out server.crt-subj "/c=cn/st=mykey/l=mykey/o=mykey/ou=mykey/cn=domai N1/cn=domain2/cn=domain3 "

# get key file from PFX file:

OpenSSL pkcs12-in site.pfx-nocerts-nodes-out Site.key

# Get CRT files from PFX file:

OpenSSL pkcs12-in site.pfx-clcerts-nokeys-out site.crt

# Merge CRT and key for PFX:

OpenSSL pkcs12–export–in site.crt–inkey site.key–name site–passout pass:testpassword–out

# Convert certificates into PKCS12 format

OpenSSL pkcs12-export-in Server.cer-inkey server.key-out server.p12

# Convert certificate format to JKS format

Keytool-importkeystore-srcstoretype Pkcs12-srckeystore Server.p12-destkeystore Server.jks

# Conversion of pkcs#12 to PEM

OpenSSL pkcs12-in yourcert.pfx-out youcert.pem–nodes

# PEM to pkcs#12 conversion,

OpenSSL pkcs12-export-in cert.pem-out Cert.p12-inkey Key.pem

# turn a PFX without a password

OpenSSL pkcs12-export-in vcops.cer-inkey vcops.key-name vcops-out vcops.pfx

# PFX pack PEM with no password

OpenSSL pkcs12-in Vcops.pfx-inkey vcops.key-out vcops.pem-nodes

This article is from the "VirtualBox" blog, please be sure to keep this source

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: 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.