openssl
securityLinux/Unix/Windows
The openssl command is one of the most frequently used commands in Linux/Unix-like operating systems. openssl Cryptography and SSL/TLS toolkit
Quick Reference
Command Name:
openssl
Category:
security
Platform:
Linux/Unix/Windows
Basic Usage:
openssl [options] [arguments]
Common Use Cases
Syntax
openssl command [command_options] [command_arguments]
Options
Standard Option | Description |
---|---|
-help |
Display help for a command |
-h |
Same as -help for most commands |
-v |
Verbose mode |
-in file |
Input file |
-out file |
Output file |
-engine id |
Use the specified engine |
Common OpenSSL Commands:
Command | Description |
---|---|
genrsa |
Generate RSA private key |
rsa |
Process RSA keys |
req |
PKCS#10 certificate request and certificate generating utility |
x509 |
X.509 certificate data management |
ca |
Certificate Authority (CA) management |
verify |
Certificate verification |
pkcs12 |
PKCS#12 data management |
dgst |
Compute message digests (hashes) |
enc |
Encoding with ciphers |
rand |
Generate random bytes |
s_client |
Implement a generic SSL/TLS client |
s_server |
Implement a generic SSL/TLS server |
speed |
Test the speed of cryptographic algorithms |
version |
Display OpenSSL version information |
list |
List algorithms, ciphers, commands, etc. |
Common Options for 'req' Command:
Option | Description |
---|---|
-new |
Generate a new certificate request |
-x509 |
Output a self-signed certificate instead of a certificate request |
-days n |
Number of days the certificate is valid for |
-key file |
Use the private key in file |
-subj arg |
Set certificate subject (e.g., '/CN=example.com') |
Examples
How to Use These Examples
The examples below show common ways to use the openssl
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
openssl version