← Back to section · Software & Developer Tools

The OpenSSL Command-Line Toolbox: Dozens of Tools in One Binary

The single openssl command hosts dozens of subcommands: keys, certificates, digests, and protocol diagnostics each form a family. This article groups them by function and explains each one's role, so you can pick the right tool on the first try.

Published 22 November 2026 · 5 min read · PQ Frontier

The OpenSSL Command-Line Toolbox: Dozens of Tools in One Binary
AI-generated site artwork
Video explainer · OpenSSL tools: from command line to protocol

For many people, the first impression of OpenSSL is the command line: type openssl in a terminal, follow it with a subcommand, and you can generate keys, sign certificates, compute digests, and test connections. In fact, dozens of small tools with distinct jobs live inside this one binary. They share the same cryptographic library but address completely different tasks. This article inventories the toolbox grouped by function, so that when a need arises you can pick the right tool immediately instead of trying them one by one.

The Key Family: genpkey and pkey

Key generation goes uniformly through genpkey: it generates key pairs from algorithm parameters, covering traditional keys such as RSA, EC, and ED25519, and — where the version supports it — post-quantum keys as well (since 3.5 it can generate ML-KEM and ML-DSA keys, subject to the installed version). Its companion is pkey: it reads an existing key and performs format conversion, public-key extraction, and textual inspection. The everyday troubleshooting question “what algorithm is this key, exactly, and how long is it” is answered by pkey’s text output.

Historically there were separate generation commands per algorithm (such as standalone RSA and EC parameter commands); in 3.x these old commands are either marked as not recommended or have their functionality absorbed by general entry points such as genpkey and pkeyparam. New scripts should use the general entry points uniformly, and cleaning these up is a priority item when migrating old scripts.

The Certificate Family: req, x509, ca, and verify

Certificates are the densest cluster of subcommands. req handles certificate signing requests (CSRs) and direct issuance of self-signed certificates; x509 is the Swiss army knife for the certificate itself: viewing certificate contents, converting between formats, adjusting validity and re-signing; ca is a miniature certificate authority that maintains a certificate database (index file and serial file) driven by configuration, suited to lab environments and small-scale internal issuance; verify is dedicated to checking whether a certificate chain anchors to a given trust root, reporting the result at each level.

The boundaries of this family are worth memorizing: req handles “requests,” x509 handles “a single certificate,” ca handles “issuing as a system,” and verify handles “validation.” Together, the four cover the overwhelming majority of manual PKI operations. The next article takes this family apart in detail.

The Data Family: dgst, enc, rand, and the pkcs Series

dgst computes message digests and the hashes needed for signature verification, and is among the most frequently used subcommands in scripts; enc performs symmetric encryption and decryption with password-based key derivation, commonly used for quick checks and small-scale file handling; rand outputs random bytes for scripts that need salts, password material, and the like. There is also a set of packaging-format tools named after standards: pkcs8 handles the PKCS#8 wrapping of private keys, pkcs12 handles the .p12 format that bundles a private key with its certificate into one file, crl handles certificate revocation lists, cms handles CMS signed and enveloped messages, ts handles the time-stamp protocol, and ocsp can act as an OCSP client and simple responder.

What unites this family is that they perform one-shot transformations on data itself. Their option details are numerous, but their positioning is clear: all are offline processing tools, none plays the role of an online service.

The Protocol and Introspection Family: s_client, s_server, list, version, speed

s_client is a diagnostic client that can connect to any TLS server, and s_server is its counterpart: a test server you can start locally. Together they are the mainstay of TLS troubleshooting, and a later article is devoted to them. The list subcommand enumerates the algorithms, commands, and Providers that this OpenSSL build can offer — the first-hand tool for answering “what does this version actually support”; version reports the version and build information (with -a, the full picture of directories and compile options); speed runs algorithm benchmarks, useful for comparing the orders of magnitude of algorithms and key lengths on the same machine.

Notes for Using Them in Scripts

These tools are often written into operations scripts, and three lessons are worth stating first. The first is passphrase delivery: when passphrases protect private keys or bundle files, the passphrase source should be an environment variable or a file (for example, read in from a controlled source with -passin), never the passphrase written directly in a command-line argument — it will show up in the process list and the shell history. The second is error handling: when a subcommand fails, it gives the reason on standard error and exits with a non-zero status; scripts must check the exit code rather than merely whether an output file appeared — many “the certificate came out but the content is wrong” incidents originate in a script swallowing an error. The third is non-interactivity: many subcommands prompt item by item on an interactive terminal (for example, the subject fields when generating a CSR); in scripts, supply everything at once via a configuration file or command-line options, so the flow does not stall waiting for input in the middle of a midnight automation run.

One more version-related reality: across major versions, the default behavior of individual subcommands has changed (for example, the default digest algorithm of enc has changed between versions, so a file encrypted by an old version needs the original digest specified explicitly when decrypted by a new one). When using this toolbox on historical files across versions, consult the target version’s documentation first instead of assuming defaults are constant.

Principles for Choosing a Tool

First, identify the task domain before picking a subcommand: keys, certificates, data, protocol, and introspection are five families that do not substitute for one another. Second, prefer the general entry points: 3.x has converged the scattered old commands, and genpkey-style general commands are the future-proof way to write things. Third, remember the positioning: this command line is the management plane and the diagnostic plane, not the data plane — it suits issuance, inspection, validation, and troubleshooting, not embedding into a hot business path to process traffic item by item. With the map of the toolbox in hand, the following articles go deep family by family.

Tags: OpenSSLCommand LineToolsOperations