OPENSSL(1) | OpenSSL | OPENSSL(1) |
openssl - OpenSSL command line program
openssl command [ options ... ] [ parameters ... ]
openssl no-XXX [ options ]
OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and related cryptography standards required by them.
The openssl program is a command line program for using the various cryptography functions of OpenSSL's crypto library from the shell. It can be used for
o Creation and management of private keys, public keys and parameters o Public key cryptographic operations o Creation of X.509 certificates, CSRs and CRLs o Calculation of Message Digests and Message Authentication Codes o Encryption and Decryption with Ciphers o SSL/TLS Client and Server Tests o Handling of S/MIME signed or encrypted mail o Timestamp requests, generation and verification
The openssl program provides a rich variety of commands (command in the "SYNOPSIS" above). Each command can have many options and argument parameters, shown above as options and parameters.
Detailed documentation and use cases for most standard subcommands are available (e.g., openssl-x509(1)). The subcommand openssl-list(1) may be used to list subcommands.
The command no-XXX tests whether a command of the specified name is available. If no command named XXX exists, it returns 0 (success) and prints no-XXX; otherwise it returns 1 and prints XXX. In both cases, the output goes to stdout and nothing is printed to stderr. Additional command line arguments are always ignored. Since for each cipher there is a command of the same name, this provides an easy way for shell scripts to test for the availability of ciphers in the openssl program. (no-XXX is not able to detect pseudo-commands such as quit, list, or no-XXX itself.)
Many commands use an external configuration file for some or all of their arguments and have a -config option to specify that file. The default name of the file is openssl.cnf in the default certificate storage area, which can be determined from the openssl-version(1) command using the -d or -a option. The environment variable OPENSSL_CONF can be used to specify a different file location or to disable loading a configuration (using the empty string).
Among others, the configuration file can be used to load modules and to specify parameters for generating certificates and random numbers. See config(5) for details.
The following aliases provide convenient access to the most used encodings and ciphers.
Depending on how OpenSSL was configured and built, not all ciphers listed here may be present. See openssl-enc(1) for more information.
Details of which options are available depend on the specific command. This section describes some common options with common behavior.
openssl verify [flags...] -- -cert1.pem...
See openssl-format-options(1) for manual page.
See the openssl-passphrase-options(1) manual page.
Prior to OpenSSL 1.1.1, it was common for applications to store information about the state of the random-number generator in a file that was loaded at startup and rewritten upon exit. On modern operating systems, this is generally no longer necessary as OpenSSL will seed itself from a trusted entropy source provided by the operating system. These flags are still supported for special platforms or circumstances that might require them.
It is generally an error to use the same seed file more than once and every use of -rand should be paired with -writerand.
See the openssl-verification-options(1) manual page.
See the openssl-namedisplay-options(1) manual page.
Several commands use SSL, TLS, or DTLS. By default, the commands use TLS and clients will offer the lowest and highest protocol version they support, and servers will pick the highest version that the client offers that is also supported by the server.
The options below can be used to limit which protocol versions are used, and whether TCP (SSL and TLS) or UDP (DTLS) is used. Note that not all protocols and flags may be available, depending on how OpenSSL was built.
The engine will be used for key ids specified with -key and similar options when an option like -keyform engine is given.
A special case is the "loader_attic" engine, which is meant just for internal OpenSSL testing purposes and supports loading keys, parameters, certificates, and CRLs from files. When this engine is used, files with such credentials are read via this engine. Using the "file:" schema is optional; a plain file (path) name will do.
Options specifying keys, like -key and similar, can use the generic OpenSSL engine key loading URI scheme "org.openssl.engine:" to retrieve private keys and public keys. The URI syntax is as follows, in simplified form:
org.openssl.engine:{engineid}:{keyid}
Where "{engineid}" is the identity/name of the engine, and "{keyid}" is a key identifier that's acceptable by that engine. For example, when using an engine that interfaces against a PKCS#11 implementation, the generic key URI would be something like this (this happens to be an example for the PKCS#11 engine that's part of OpenSC):
-key org.openssl.engine:pkcs11:label_some-private-key
As a third possibility, for engines and providers that have implemented their own OSSL_STORE_LOADER(3), "org.openssl.engine:" should not be necessary. For a PKCS#11 implementation that has implemented such a loader, the PKCS#11 URI as defined in RFC 7512 should be possible to use directly:
-key pkcs11:object=some-private-key;pin-value=1234
The OpenSSL libraries can take some configuration parameters from the environment.
For information about all environment variables used by the OpenSSL libraries, such as OPENSSL_CONF, OPENSSL_MODULES, and OPENSSL_TRACE, see openssl-env(7).
For information about the use of environment variables in configuration, see "ENVIRONMENT" in config(5).
For information about specific commands, see openssl-engine(1), openssl-rehash(1), and tsget(1).
For information about querying or specifying CPU architecture flags, see OPENSSL_ia32cap(3), and OPENSSL_s390xcap(3).
openssl-asn1parse(1), openssl-ca(1), openssl-ciphers(1), openssl-cms(1), openssl-crl(1), openssl-crl2pkcs7(1), openssl-dgst(1), openssl-dhparam(1), openssl-dsa(1), openssl-dsaparam(1), openssl-ec(1), openssl-ecparam(1), openssl-enc(1), openssl-engine(1), openssl-errstr(1), openssl-gendsa(1), openssl-genpkey(1), openssl-genrsa(1), openssl-kdf(1), openssl-list(1), openssl-mac(1), openssl-nseq(1), openssl-ocsp(1), openssl-passwd(1), openssl-pkcs12(1), openssl-pkcs7(1), openssl-pkcs8(1), openssl-pkey(1), openssl-pkeyparam(1), openssl-pkeyutl(1), openssl-prime(1), openssl-rand(1), openssl-rehash(1), openssl-req(1), openssl-rsa(1), openssl-rsautl(1), openssl-s_client(1), openssl-s_server(1), openssl-s_time(1), openssl-sess_id(1), openssl-smime(1), openssl-speed(1), openssl-spkac(1), openssl-srp(1), openssl-storeutl(1), openssl-ts(1), openssl-verify(1), openssl-version(1), openssl-x509(1), config(5), crypto(7), openssl-env(7). ssl(7), x509v3_config(5)
The list -XXX-algorithms options were added in OpenSSL 1.0.0; For notes on the availability of other commands, see their individual manual pages.
The -issuer_checks option is deprecated as of OpenSSL 1.1.0 and is silently ignored.
The -xcertform and -xkeyform options are obsolete since OpenSSL 3.0 and have no effect.
The interactive mode, which could be invoked by running "openssl" with no further arguments, was removed in OpenSSL 3.0, and running that program with no arguments is now equivalent to "openssl help".
Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
2025-02-11 | 3.0.16 |