githubEdit

OpenSSL

OpenSSL

Introduction

...

How to Use

1. Third-Party CA Signed Certificate

# generate private key, encryption parameter: -des3
openssl genrsa -out a.com.key 2048

# generate CSR file
openssl genrsa -out a.com.key 2048 openssl req -new -sha256 -key a.com.key -out a.com.csr
# view CSR information
openssl req -noout -text -in a.com.csr

# submit CSR file to CA or third-party certificate authority to obtain a digitally signed public key CRT file
# deploy CRT and key files to the web server

2. Self-Signed / Private CA Certificate

  • Self-signed method

  • CA signed method

3. Encrypt and Decrypt Files with OpenSSL

4. Certificate Format Conversion

Common certificate formats:

  • .DER .CER: Binary format, contains certificate only, no private key.

  • .PEM: Text format, can contain both certificate and private key. Files with .key suffix are typically PEM format.

  • .CRT: Can be binary or text format, contains certificate only, no private key.

  • .PFX .P12: PKCS12 binary format, contains both certificate and private key, usually password-protected.

  • .JKS: Java-specific binary format, contains both certificate and private key, usually password-protected.

5. Other Tips

Reference:

Last updated