File: /home/boxelikax/public_html/demoltec.com/share.zip
PK !J]�ґ� � man/man7/RAND.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "RAND 7"
.TH RAND 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
RAND
\&\- the OpenSSL random generator
.SH DESCRIPTION
.IX Header "DESCRIPTION"
Random numbers are a vital part of cryptography, they are needed to provide
unpredictability for tasks like key generation, creating salts, and many more.
Software-based generators must be seeded with external randomness before they
can be used as a cryptographically-secure pseudo-random number generator
(CSPRNG).
The availability of common hardware with special instructions and
modern operating systems, which may use items such as interrupt jitter
and network packet timings, can be reasonable sources of seeding material.
.PP
OpenSSL comes with a default implementation of the RAND API which is based on
the deterministic random bit generator (DRBG) model as described in
[NIST SP 800\-90A Rev. 1]. The default random generator will initialize
automatically on first use and will be fully functional without having
to be initialized ('seeded') explicitly.
It seeds and reseeds itself automatically using trusted random sources
provided by the operating system.
.PP
As a normal application developer, you do not have to worry about any details,
just use \fBRAND_bytes\fR\|(3) to obtain random data.
Having said that, there is one important rule to obey: Always check the error
return value of \fBRAND_bytes\fR\|(3) and do not take randomness for granted.
Although (re\-)seeding is automatic, it can fail because no trusted random source
is available or the trusted source(s) temporarily fail to provide sufficient
random seed material.
In this case the CSPRNG enters an error state and ceases to provide output,
until it is able to recover from the error by reseeding itself.
For more details on reseeding and error recovery, see \fBRAND_DRBG\fR\|(7).
.PP
For values that should remain secret, you can use \fBRAND_priv_bytes\fR\|(3)
instead.
This method does not provide 'better' randomness, it uses the same type of CSPRNG.
The intention behind using a dedicated CSPRNG exclusively for private
values is that none of its output should be visible to an attacker (e.g.,
used as salt value), in order to reveal as little information as
possible about its internal state, and that a compromise of the "public"
CSPRNG instance will not affect the secrecy of these private values.
.PP
In the rare case where the default implementation does not satisfy your special
requirements, there are two options:
.IP \(bu 2
Replace the default RAND method by your own RAND method using
\&\fBRAND_set_rand_method\fR\|(3).
.IP \(bu 2
Modify the default settings of the OpenSSL RAND method by modifying the security
parameters of the underlying DRBG, which is described in detail in \fBRAND_DRBG\fR\|(7).
.PP
Changing the default random generator or its default parameters should be necessary
only in exceptional cases and is not recommended, unless you have a profound knowledge
of cryptographic principles and understand the implications of your changes.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBRAND_add\fR\|(3),
\&\fBRAND_bytes\fR\|(3),
\&\fBRAND_priv_bytes\fR\|(3),
\&\fBRAND_get_rand_method\fR\|(3),
\&\fBRAND_set_rand_method\fR\|(3),
\&\fBRAND_OpenSSL\fR\|(3),
\&\fBRAND_DRBG\fR\|(7)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2018\-2019 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]|�D�^9 ^9 man/man7/proxy-certificates.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "PROXY-CERTIFICATES 7"
.TH PROXY-CERTIFICATES 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
proxy\-certificates \- Proxy certificates in OpenSSL
.SH DESCRIPTION
.IX Header "DESCRIPTION"
Proxy certificates are defined in RFC 3820. They are used to
extend rights to some other entity (a computer process, typically, or
sometimes to the user itself). This allows the entity to perform
operations on behalf of the owner of the EE (End Entity) certificate.
.PP
The requirements for a valid proxy certificate are:
.IP \(bu 4
They are issued by an End Entity, either a normal EE certificate, or
another proxy certificate.
.IP \(bu 4
They must not have the \fBsubjectAltName\fR or \fBissuerAltName\fR
extensions.
.IP \(bu 4
They must have the \fBproxyCertInfo\fR extension.
.IP \(bu 4
They must have the subject of their issuer, with one \fBcommonName\fR
added.
.SS "Enabling proxy certificate verification"
.IX Subsection "Enabling proxy certificate verification"
OpenSSL expects applications that want to use proxy certificates to be
specially aware of them, and make that explicit. This is done by
setting an X509 verification flag:
.PP
.Vb 1
\& X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS);
.Ve
.PP
or
.PP
.Vb 1
\& X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_ALLOW_PROXY_CERTS);
.Ve
.PP
See "NOTES" for a discussion on this requirement.
.SS "Creating proxy certificates"
.IX Subsection "Creating proxy certificates"
Creating proxy certificates can be done using the \fBopenssl\-x509\fR\|(1)
command, with some extra extensions:
.PP
.Vb 3
\& [ v3_proxy ]
\& # A proxy certificate MUST NEVER be a CA certificate.
\& basicConstraints=CA:FALSE
\&
\& # Usual authority key ID
\& authorityKeyIdentifier=keyid,issuer:always
\&
\& # The extension which marks this certificate as a proxy
\& proxyCertInfo=critical,language:id\-ppl\-anyLanguage,pathlen:1,policy:text:AB
.Ve
.PP
It's also possible to specify the proxy extension in a separate section:
.PP
.Vb 1
\& proxyCertInfo=critical,@proxy_ext
\&
\& [ proxy_ext ]
\& language=id\-ppl\-anyLanguage
\& pathlen=0
\& policy=text:BC
.Ve
.PP
The policy value has a specific syntax, \fIsyntag\fR:\fIstring\fR, where the
\&\fIsyntag\fR determines what will be done with the string. The following
\&\fIsyntag\fRs are recognised:
.IP \fBtext\fR 4
.IX Item "text"
indicates that the string is a byte sequence, without any encoding:
.Sp
.Vb 1
\& policy=text:räksmörgås
.Ve
.IP \fBhex\fR 4
.IX Item "hex"
indicates the string is encoded hexadecimal encoded binary data, with
colons between each byte (every second hex digit):
.Sp
.Vb 1
\& policy=hex:72:E4:6B:73:6D:F6:72:67:E5:73
.Ve
.IP \fBfile\fR 4
.IX Item "file"
indicates that the text of the policy should be taken from a file.
The string is then a filename. This is useful for policies that are
large (more than a few lines, e.g. XML documents).
.PP
\&\fINOTE: The proxy policy value is what determines the rights granted
to the process during the proxy certificate. It's up to the
application to interpret and combine these policies.\fR
.PP
With a proxy extension, creating a proxy certificate is a matter of
two commands:
.PP
.Vb 3
\& openssl req \-new \-config proxy.cnf \e
\& \-out proxy.req \-keyout proxy.key \e
\& \-subj "/DC=org/DC=openssl/DC=users/CN=proxy 1"
\&
\& openssl x509 \-req \-CAcreateserial \-in proxy.req \-out proxy.crt \e
\& \-CA user.crt \-CAkey user.key \-days 7 \e
\& \-extfile proxy.cnf \-extensions v3_proxy1
.Ve
.PP
You can also create a proxy certificate using another proxy
certificate as issuer (note: using a different configuration
section for the proxy extensions):
.PP
.Vb 3
\& openssl req \-new \-config proxy.cnf \e
\& \-out proxy2.req \-keyout proxy2.key \e
\& \-subj "/DC=org/DC=openssl/DC=users/CN=proxy 1/CN=proxy 2"
\&
\& openssl x509 \-req \-CAcreateserial \-in proxy2.req \-out proxy2.crt \e
\& \-CA proxy.crt \-CAkey proxy.key \-days 7 \e
\& \-extfile proxy.cnf \-extensions v3_proxy2
.Ve
.SS "Using proxy certs in applications"
.IX Subsection "Using proxy certs in applications"
To interpret proxy policies, the application would normally start with
some default rights (perhaps none at all), then compute the resulting
rights by checking the rights against the chain of proxy certificates,
user certificate and CA certificates.
.PP
The complicated part is figuring out how to pass data between your
application and the certificate validation procedure.
.PP
The following ingredients are needed for such processing:
.IP \(bu 4
a callback function that will be called for every certificate being
validated. The callback is called several times for each certificate,
so you must be careful to do the proxy policy interpretation at the
right time. You also need to fill in the defaults when the EE
certificate is checked.
.IP \(bu 4
a data structure that is shared between your application code and the
callback.
.IP \(bu 4
a wrapper function that sets it all up.
.IP \(bu 4
an ex_data index function that creates an index into the generic
ex_data store that is attached to an X509 validation context.
.PP
The following skeleton code can be used as a starting point:
.PP
.Vb 4
\& #include <string.h>
\& #include <netdb.h>
\& #include <openssl/x509.h>
\& #include <openssl/x509v3.h>
\&
\& #define total_rights 25
\&
\& /*
\& * In this example, I will use a view of granted rights as a bit
\& * array, one bit for each possible right.
\& */
\& typedef struct your_rights {
\& unsigned char rights[(total_rights + 7) / 8];
\& } YOUR_RIGHTS;
\&
\& /*
\& * The following procedure will create an index for the ex_data
\& * store in the X509 validation context the first time it\*(Aqs
\& * called. Subsequent calls will return the same index.
\& */
\& static int get_proxy_auth_ex_data_idx(X509_STORE_CTX *ctx)
\& {
\& static volatile int idx = \-1;
\&
\& if (idx < 0) {
\& X509_STORE_lock(X509_STORE_CTX_get0_store(ctx));
\& if (idx < 0) {
\& idx = X509_STORE_CTX_get_ex_new_index(0,
\& "for verify callback",
\& NULL,NULL,NULL);
\& }
\& X509_STORE_unlock(X509_STORE_CTX_get0_store(ctx));
\& }
\& return idx;
\& }
\&
\& /* Callback to be given to the X509 validation procedure. */
\& static int verify_callback(int ok, X509_STORE_CTX *ctx)
\& {
\& if (ok == 1) {
\& /*
\& * It\*(Aqs REALLY important you keep the proxy policy check
\& * within this section. It\*(Aqs important to know that when
\& * ok is 1, the certificates are checked from top to
\& * bottom. You get the CA root first, followed by the
\& * possible chain of intermediate CAs, followed by the EE
\& * certificate, followed by the possible proxy
\& * certificates.
\& */
\& X509 *xs = X509_STORE_CTX_get_current_cert(ctx);
\&
\& if (X509_get_extension_flags(xs) & EXFLAG_PROXY) {
\& YOUR_RIGHTS *rights =
\& (YOUR_RIGHTS *)X509_STORE_CTX_get_ex_data(ctx,
\& get_proxy_auth_ex_data_idx(ctx));
\& PROXY_CERT_INFO_EXTENSION *pci =
\& X509_get_ext_d2i(xs, NID_proxyCertInfo, NULL, NULL);
\&
\& switch (OBJ_obj2nid(pci\->proxyPolicy\->policyLanguage)) {
\& case NID_Independent:
\& /*
\& * Do whatever you need to grant explicit rights
\& * to this particular proxy certificate, usually
\& * by pulling them from some database. If there
\& * are none to be found, clear all rights (making
\& * this and any subsequent proxy certificate void
\& * of any rights).
\& */
\& memset(rights\->rights, 0, sizeof(rights\->rights));
\& break;
\& case NID_id_ppl_inheritAll:
\& /*
\& * This is basically a NOP, we simply let the
\& * current rights stand as they are.
\& */
\& break;
\& default:
\& /*
\& * This is usually the most complex section of
\& * code. You really do whatever you want as long
\& * as you follow RFC 3820. In the example we use
\& * here, the simplest thing to do is to build
\& * another, temporary bit array and fill it with
\& * the rights granted by the current proxy
\& * certificate, then use it as a mask on the
\& * accumulated rights bit array, and voilà, you
\& * now have a new accumulated rights bit array.
\& */
\& {
\& int i;
\& YOUR_RIGHTS tmp_rights;
\& memset(tmp_rights.rights, 0,
\& sizeof(tmp_rights.rights));
\&
\& /*
\& * process_rights() is supposed to be a
\& * procedure that takes a string and its
\& * length, interprets it and sets the bits
\& * in the YOUR_RIGHTS pointed at by the
\& * third argument.
\& */
\& process_rights((char *) pci\->proxyPolicy\->policy\->data,
\& pci\->proxyPolicy\->policy\->length,
\& &tmp_rights);
\&
\& for(i = 0; i < total_rights / 8; i++)
\& rights\->rights[i] &= tmp_rights.rights[i];
\& }
\& break;
\& }
\& PROXY_CERT_INFO_EXTENSION_free(pci);
\& } else if (!(X509_get_extension_flags(xs) & EXFLAG_CA)) {
\& /* We have an EE certificate, let\*(Aqs use it to set default! */
\& YOUR_RIGHTS *rights =
\& (YOUR_RIGHTS *)X509_STORE_CTX_get_ex_data(ctx,
\& get_proxy_auth_ex_data_idx(ctx));
\&
\& /*
\& * The following procedure finds out what rights the
\& * owner of the current certificate has, and sets them
\& * in the YOUR_RIGHTS structure pointed at by the
\& * second argument.
\& */
\& set_default_rights(xs, rights);
\& }
\& }
\& return ok;
\& }
\&
\& static int my_X509_verify_cert(X509_STORE_CTX *ctx,
\& YOUR_RIGHTS *needed_rights)
\& {
\& int ok;
\& int (*save_verify_cb)(int ok,X509_STORE_CTX *ctx) =
\& X509_STORE_CTX_get_verify_cb(ctx);
\& YOUR_RIGHTS rights;
\&
\& X509_STORE_CTX_set_verify_cb(ctx, verify_callback);
\& X509_STORE_CTX_set_ex_data(ctx, get_proxy_auth_ex_data_idx(ctx),
\& &rights);
\& X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS);
\& ok = X509_verify_cert(ctx);
\&
\& if (ok == 1) {
\& ok = check_needed_rights(rights, needed_rights);
\& }
\&
\& X509_STORE_CTX_set_verify_cb(ctx, save_verify_cb);
\&
\& return ok;
\& }
.Ve
.PP
If you use SSL or TLS, you can easily set up a callback to have the
certificates checked properly, using the code above:
.PP
.Vb 2
\& SSL_CTX_set_cert_verify_callback(s_ctx, my_X509_verify_cert,
\& &needed_rights);
.Ve
.SH NOTES
.IX Header "NOTES"
To this date, it seems that proxy certificates have only been used in
environments that are aware of them, and no one seems to have
investigated how they can be used or misused outside of such an
environment.
.PP
For that reason, OpenSSL requires that applications aware of proxy
certificates must also make that explicit.
.PP
\&\fBsubjectAltName\fR and \fBissuerAltName\fR are forbidden in proxy
certificates, and this is enforced in OpenSSL. The subject must be
the same as the issuer, with one commonName added on.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBX509_STORE_CTX_set_flags\fR\|(3),
\&\fBX509_STORE_CTX_set_verify_cb\fR\|(3),
\&\fBX509_VERIFY_PARAM_set_flags\fR\|(3),
\&\fBSSL_CTX_set_cert_verify_callback\fR\|(3),
\&\fBopenssl\-req\fR\|(1), \fBopenssl\-x509\fR\|(1),
RFC 3820 <https://tools.ietf.org/html/rfc3820>
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
.PP
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>.
PK !J]�X��A# A# man/man7/passphrase-encoding.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "PASSPHRASE-ENCODING 7"
.TH PASSPHRASE-ENCODING 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
passphrase\-encoding
\&\- How diverse parts of OpenSSL treat pass phrases character encoding
.SH DESCRIPTION
.IX Header "DESCRIPTION"
In a modern world with all sorts of character encodings, the treatment of pass
phrases has become increasingly complex.
This manual page attempts to give an overview over how this problem is
currently addressed in different parts of the OpenSSL library.
.SS "The general case"
.IX Subsection "The general case"
The OpenSSL library doesn't treat pass phrases in any special way as a general
rule, and trusts the application or user to choose a suitable character set
and stick to that throughout the lifetime of affected objects.
This means that for an object that was encrypted using a pass phrase encoded in
ISO\-8859\-1, that object needs to be decrypted using a pass phrase encoded in
ISO\-8859\-1.
Using the wrong encoding is expected to cause a decryption failure.
.SS PKCS#12
.IX Subsection "PKCS#12"
PKCS#12 is a bit different regarding pass phrase encoding.
The standard stipulates that the pass phrase shall be encoded as an ASN.1
BMPString, which consists of the code points of the basic multilingual plane,
encoded in big endian (UCS\-2 BE).
.PP
OpenSSL tries to adapt to this requirements in one of the following manners:
.IP 1. 4
Treats the received pass phrase as UTF\-8 encoded and tries to re-encode it to
UTF\-16 (which is the same as UCS\-2 for characters U+0000 to U+D7FF and U+E000
to U+FFFF, but becomes an expansion for any other character), or failing that,
proceeds with step 2.
.IP 2. 4
Assumes that the pass phrase is encoded in ASCII or ISO\-8859\-1 and
opportunistically prepends each byte with a zero byte to obtain the UCS\-2
encoding of the characters, which it stores as a BMPString.
.Sp
Note that since there is no check of your locale, this may produce UCS\-2 /
UTF\-16 characters that do not correspond to the original pass phrase characters
for other character sets, such as any ISO\-8859\-X encoding other than
ISO\-8859\-1 (or for Windows, CP 1252 with exception for the extra "graphical"
characters in the 0x80\-0x9F range).
.PP
OpenSSL versions older than 1.1.0 do variant 2 only, and that is the reason why
OpenSSL still does this, to be able to read files produced with older versions.
.PP
It should be noted that this approach isn't entirely fault free.
.PP
A pass phrase encoded in ISO\-8859\-2 could very well have a sequence such as
0xC3 0xAF (which is the two characters "LATIN CAPITAL LETTER A WITH BREVE"
and "LATIN CAPITAL LETTER Z WITH DOT ABOVE" in ISO\-8859\-2 encoding), but would
be misinterpreted as the perfectly valid UTF\-8 encoded code point U+00EF (LATIN
SMALL LETTER I WITH DIAERESIS) \fIif the pass phrase doesn't contain anything that
would be invalid UTF\-8\fR.
A pass phrase that contains this kind of byte sequence will give a different
outcome in OpenSSL 1.1.0 and newer than in OpenSSL older than 1.1.0.
.PP
.Vb 2
\& 0x00 0xC3 0x00 0xAF # OpenSSL older than 1.1.0
\& 0x00 0xEF # OpenSSL 1.1.0 and newer
.Ve
.PP
On the same accord, anything encoded in UTF\-8 that was given to OpenSSL older
than 1.1.0 was misinterpreted as ISO\-8859\-1 sequences.
.SS OSSL_STORE
.IX Subsection "OSSL_STORE"
\&\fBossl_store\fR\|(7) acts as a general interface to access all kinds of objects,
potentially protected with a pass phrase, a PIN or something else.
This API stipulates that pass phrases should be UTF\-8 encoded, and that any
other pass phrase encoding may give undefined results.
This API relies on the application to ensure UTF\-8 encoding, and doesn't check
that this is the case, so what it gets, it will also pass to the underlying
loader.
.SH RECOMMENDATIONS
.IX Header "RECOMMENDATIONS"
This section assumes that you know what pass phrase was used for encryption,
but that it may have been encoded in a different character encoding than the
one used by your current input method.
For example, the pass phrase may have been used at a time when your default
encoding was ISO\-8859\-1 (i.e. "naïve" resulting in the byte sequence 0x6E 0x61
0xEF 0x76 0x65), and you're now in an environment where your default encoding
is UTF\-8 (i.e. "naïve" resulting in the byte sequence 0x6E 0x61 0xC3 0xAF 0x76
0x65).
Whenever it's mentioned that you should use a certain character encoding, it
should be understood that you either change the input method to use the
mentioned encoding when you type in your pass phrase, or use some suitable tool
to convert your pass phrase from your default encoding to the target encoding.
.PP
Also note that the sub-sections below discuss human readable pass phrases.
This is particularly relevant for PKCS#12 objects, where human readable pass
phrases are assumed.
For other objects, it's as legitimate to use any byte sequence (such as a
sequence of bytes from `/dev/urandom` that's been saved away), which makes any
character encoding discussion irrelevant; in such cases, simply use the same
byte sequence as it is.
.SS "Creating new objects"
.IX Subsection "Creating new objects"
For creating new pass phrase protected objects, make sure the pass phrase is
encoded using UTF\-8.
This is default on most modern Unixes, but may involve an effort on other
platforms.
Specifically for Windows, setting the environment variable
\&\f(CW\*(C`OPENSSL_WIN32_UTF8\*(C'\fR will have anything entered on [Windows] console prompt
converted to UTF\-8 (command line and separately prompted pass phrases alike).
.SS "Opening existing objects"
.IX Subsection "Opening existing objects"
For opening pass phrase protected objects where you know what character
encoding was used for the encryption pass phrase, make sure to use the same
encoding again.
.PP
For opening pass phrase protected objects where the character encoding that was
used is unknown, or where the producing application is unknown, try one of the
following:
.IP 1. 4
Try the pass phrase that you have as it is in the character encoding of your
environment.
It's possible that its byte sequence is exactly right.
.IP 2. 4
Convert the pass phrase to UTF\-8 and try with the result.
Specifically with PKCS#12, this should open up any object that was created
according to the specification.
.IP 3. 4
Do a naïve (i.e. purely mathematical) ISO\-8859\-1 to UTF\-8 conversion and try
with the result.
This differs from the previous attempt because ISO\-8859\-1 maps directly to
U+0000 to U+00FF, which other non\-UTF\-8 character sets do not.
.Sp
This also takes care of the case when a UTF\-8 encoded string was used with
OpenSSL older than 1.1.0.
(for example, \f(CW\*(C`ï\*(C'\fR, which is 0xC3 0xAF when encoded in UTF\-8, would become 0xC3
0x83 0xC2 0xAF when re-encoded in the naïve manner.
The conversion to BMPString would then yield 0x00 0xC3 0x00 0xA4 0x00 0x00, the
erroneous/non\-compliant encoding used by OpenSSL older than 1.1.0)
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBevp\fR\|(7),
\&\fBossl_store\fR\|(7),
\&\fBEVP_BytesToKey\fR\|(3), \fBEVP_DecryptInit\fR\|(3),
\&\fBPEM_do_header\fR\|(3),
\&\fBPKCS12_parse\fR\|(3), \fBPKCS12_newpass\fR\|(3),
\&\fBd2i_PKCS8PrivateKey_bio\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2018\-2020 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]ir5� � man/man7/Ed25519.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "ED25519 7"
.TH ED25519 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
Ed25519,
Ed448
\&\- EVP_PKEY Ed25519 and Ed448 support
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBEd25519\fR and \fBEd448\fR EVP_PKEY implementation supports key generation,
one-shot digest sign and digest verify using PureEdDSA and \fBEd25519\fR or \fBEd448\fR
(see RFC8032). It has associated private and public key formats compatible with
RFC 8410.
.PP
No additional parameters can be set during key generation, one-shot signing or
verification. In particular, because PureEdDSA is used, a digest must \fBNOT\fR be
specified when signing or verifying.
.SH NOTES
.IX Header "NOTES"
The PureEdDSA algorithm does not support the streaming mechanism
of other signature algorithms using, for example, \fBEVP_DigestUpdate()\fR.
The message to sign or verify must be passed using the one-shot
\&\fBEVP_DigestSign()\fR and \fBEVP_DigestVerify()\fR functions.
.PP
When calling \fBEVP_DigestSignInit()\fR or \fBEVP_DigestVerifyInit()\fR, the
digest \fBtype\fR parameter \fBMUST\fR be set to \fBNULL\fR.
.PP
Applications wishing to sign certificates (or other structures such as
CRLs or certificate requests) using Ed25519 or Ed448 can either use \fBX509_sign()\fR
or \fBX509_sign_ctx()\fR in the usual way.
.PP
A context for the \fBEd25519\fR algorithm can be obtained by calling:
.PP
.Vb 1
\& EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_ED25519, NULL);
.Ve
.PP
For the \fBEd448\fR algorithm a context can be obtained by calling:
.PP
.Vb 1
\& EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_ED448, NULL);
.Ve
.PP
Ed25519 or Ed448 private keys can be set directly using
\&\fBEVP_PKEY_new_raw_private_key\fR\|(3) or loaded from a PKCS#8 private key file
using \fBPEM_read_bio_PrivateKey\fR\|(3) (or similar function). Completely new keys
can also be generated (see the example below). Setting a private key also sets
the associated public key.
.PP
Ed25519 or Ed448 public keys can be set directly using
\&\fBEVP_PKEY_new_raw_public_key\fR\|(3) or loaded from a SubjectPublicKeyInfo
structure in a PEM file using \fBPEM_read_bio_PUBKEY\fR\|(3) (or similar function).
.PP
Ed25519 and Ed448 can be tested within \fBspeed\fR\|(1) application since version 1.1.1.
Valid algorithm names are \fBed25519\fR, \fBed448\fR and \fBeddsa\fR. If \fBeddsa\fR is
specified, then both Ed25519 and Ed448 are benchmarked.
.SH EXAMPLES
.IX Header "EXAMPLES"
This example generates an \fBED25519\fR private key and writes it to standard
output in PEM format:
.PP
.Vb 9
\& #include <openssl/evp.h>
\& #include <openssl/pem.h>
\& ...
\& EVP_PKEY *pkey = NULL;
\& EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_ED25519, NULL);
\& EVP_PKEY_keygen_init(pctx);
\& EVP_PKEY_keygen(pctx, &pkey);
\& EVP_PKEY_CTX_free(pctx);
\& PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL);
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBEVP_PKEY_CTX_new\fR\|(3),
\&\fBEVP_PKEY_keygen\fR\|(3),
\&\fBEVP_DigestSignInit\fR\|(3),
\&\fBEVP_DigestVerifyInit\fR\|(3),
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2017\-2020 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�/r�* * man/man7/RSA-PSS.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "RSA-PSS 7"
.TH RSA-PSS 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
RSA\-PSS \- EVP_PKEY RSA\-PSS algorithm support
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBRSA-PSS\fR EVP_PKEY implementation is a restricted version of the RSA
algorithm which only supports signing, verification and key generation
using PSS padding modes with optional parameter restrictions.
.PP
It has associated private key and public key formats.
.PP
This algorithm shares several control operations with the \fBRSA\fR algorithm
but with some restrictions described below.
.SS "Signing and Verification"
.IX Subsection "Signing and Verification"
Signing and verification is similar to the \fBRSA\fR algorithm except the
padding mode is always PSS. If the key in use has parameter restrictions then
the corresponding signature parameters are set to the restrictions:
for example, if the key can only be used with digest SHA256, MGF1 SHA256
and minimum salt length 32 then the digest, MGF1 digest and salt length
will be set to SHA256, SHA256 and 32 respectively.
.SS "Key Generation"
.IX Subsection "Key Generation"
By default no parameter restrictions are placed on the generated key.
.SH NOTES
.IX Header "NOTES"
The public key format is documented in RFC4055.
.PP
The PKCS#8 private key format used for RSA-PSS keys is similar to the RSA
format except it uses the \fBid-RSASSA-PSS\fR OID and the parameters field, if
present, restricts the key parameters in the same way as the public key.
.SH "CONFORMING TO"
.IX Header "CONFORMING TO"
RFC 4055
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBEVP_PKEY_CTX_set_rsa_pss_keygen_md\fR\|(3),
\&\fBEVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md\fR\|(3),
\&\fBEVP_PKEY_CTX_set_rsa_pss_keygen_saltlen\fR\|(3),
\&\fBEVP_PKEY_CTX_new\fR\|(3),
\&\fBEVP_PKEY_CTX_ctrl_str\fR\|(3),
\&\fBEVP_PKEY_derive\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2017\-2018 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�*}
� � man/man7/evp.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "EVP 7"
.TH EVP 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
evp \- high\-level cryptographic functions
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\& #include <openssl/evp.h>
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The EVP library provides a high-level interface to cryptographic
functions.
.PP
The \fBEVP_Seal\fR\fIXXX\fR and \fBEVP_Open\fR\fIXXX\fR
functions provide public key encryption and decryption to implement digital "envelopes".
.PP
The \fBEVP_DigestSign\fR\fIXXX\fR and
\&\fBEVP_DigestVerify\fR\fIXXX\fR functions implement
digital signatures and Message Authentication Codes (MACs). Also see the older
\&\fBEVP_Sign\fR\fIXXX\fR and \fBEVP_Verify\fR\fIXXX\fR
functions.
.PP
Symmetric encryption is available with the \fBEVP_Encrypt\fR\fIXXX\fR
functions. The \fBEVP_Digest\fR\fIXXX\fR functions provide message digests.
.PP
The \fBEVP_PKEY\fR\fIXXX\fR functions provide a high-level interface to
asymmetric algorithms. To create a new EVP_PKEY see
\&\fBEVP_PKEY_new\fR\|(3). EVP_PKEYs can be associated
with a private key of a particular algorithm by using the functions
described on the \fBEVP_PKEY_set1_RSA\fR\|(3) page, or
new keys can be generated using \fBEVP_PKEY_keygen\fR\|(3).
EVP_PKEYs can be compared using \fBEVP_PKEY_cmp\fR\|(3), or printed using
\&\fBEVP_PKEY_print_private\fR\|(3).
.PP
The EVP_PKEY functions support the full range of asymmetric algorithm operations:
.IP "For key agreement see \fBEVP_PKEY_derive\fR\|(3)" 4
.IX Item "For key agreement see EVP_PKEY_derive"
.PD 0
.IP "For signing and verifying see \fBEVP_PKEY_sign\fR\|(3), \fBEVP_PKEY_verify\fR\|(3) and \fBEVP_PKEY_verify_recover\fR\|(3). However, note that these functions do not perform a digest of the data to be signed. Therefore, normally you would use the \fBEVP_DigestSignInit\fR\|(3) functions for this purpose." 4
.IX Item "For signing and verifying see EVP_PKEY_sign, EVP_PKEY_verify and EVP_PKEY_verify_recover. However, note that these functions do not perform a digest of the data to be signed. Therefore, normally you would use the EVP_DigestSignInit functions for this purpose."
.IP "For encryption and decryption see \fBEVP_PKEY_encrypt\fR\|(3) and \fBEVP_PKEY_decrypt\fR\|(3) respectively. However, note that these functions perform encryption and decryption only. As public key encryption is an expensive operation, normally you would wrap an encrypted message in a ""digital envelope"" using the \fBEVP_SealInit\fR\|(3) and \fBEVP_OpenInit\fR\|(3) functions." 4
.IX Item "For encryption and decryption see EVP_PKEY_encrypt and EVP_PKEY_decrypt respectively. However, note that these functions perform encryption and decryption only. As public key encryption is an expensive operation, normally you would wrap an encrypted message in a ""digital envelope"" using the EVP_SealInit and EVP_OpenInit functions."
.PD
.PP
The \fBEVP_BytesToKey\fR\|(3) function provides some limited support for password
based encryption. Careful selection of the parameters will provide a PKCS#5 PBKDF1 compatible
implementation. However, new applications should not typically use this (preferring, for example,
PBKDF2 from PCKS#5).
.PP
The \fBEVP_Encode\fR\fIXXX\fR and
\&\fBEVP_Decode\fR\fIXXX\fR functions implement base 64 encoding
and decoding.
.PP
All the symmetric algorithms (ciphers), digests and asymmetric algorithms
(public key algorithms) can be replaced by ENGINE modules providing alternative
implementations. If ENGINE implementations of ciphers or digests are registered
as defaults, then the various EVP functions will automatically use those
implementations automatically in preference to built in software
implementations. For more information, consult the \fBengine\fR\|(3) man page.
.PP
Although low-level algorithm specific functions exist for many algorithms
their use is discouraged. They cannot be used with an ENGINE and ENGINE
versions of new algorithms cannot be accessed using the low-level functions.
Also makes code harder to adapt to new algorithms and some options are not
cleanly supported at the low-level and some operations are more efficient
using the high-level interface.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBEVP_DigestInit\fR\|(3),
\&\fBEVP_EncryptInit\fR\|(3),
\&\fBEVP_OpenInit\fR\|(3),
\&\fBEVP_SealInit\fR\|(3),
\&\fBEVP_DigestSignInit\fR\|(3),
\&\fBEVP_SignInit\fR\|(3),
\&\fBEVP_VerifyInit\fR\|(3),
\&\fBEVP_EncodeInit\fR\|(3),
\&\fBEVP_PKEY_new\fR\|(3),
\&\fBEVP_PKEY_set1_RSA\fR\|(3),
\&\fBEVP_PKEY_keygen\fR\|(3),
\&\fBEVP_PKEY_print_private\fR\|(3),
\&\fBEVP_PKEY_decrypt\fR\|(3),
\&\fBEVP_PKEY_encrypt\fR\|(3),
\&\fBEVP_PKEY_sign\fR\|(3),
\&\fBEVP_PKEY_verify\fR\|(3),
\&\fBEVP_PKEY_verify_recover\fR\|(3),
\&\fBEVP_PKEY_derive\fR\|(3),
\&\fBEVP_BytesToKey\fR\|(3),
\&\fBENGINE_by_id\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2020 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]Ċ{�� � man/man7/ossl_store.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "OSSL_STORE 7"
.TH OSSL_STORE 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
ossl_store \- Store retrieval functions
.SH SYNOPSIS
.IX Header "SYNOPSIS"
#include <openssl/store.h>
.SH DESCRIPTION
.IX Header "DESCRIPTION"
.SS General
.IX Subsection "General"
A STORE is a layer of functionality to retrieve a number of supported
objects from a repository of any kind, addressable as a filename or
as a URI.
.PP
The functionality supports the pattern "open a channel to the
repository", "loop and retrieve one object at a time", and "finish up
by closing the channel".
.PP
The retrieved objects are returned as a wrapper type \fBOSSL_STORE_INFO\fR,
from which an OpenSSL type can be retrieved.
.SS "URI schemes and loaders"
.IX Subsection "URI schemes and loaders"
Support for a URI scheme is called a STORE "loader", and can be added
dynamically from the calling application or from a loadable engine.
.PP
Support for the 'file' scheme is built into \f(CW\*(C`libcrypto\*(C'\fR.
See \fBossl_store\-file\fR\|(7) for more information.
.SS "UI_METHOD and pass phrases"
.IX Subsection "UI_METHOD and pass phrases"
The \fBOSS_STORE\fR API does nothing to enforce any specific format or
encoding on the pass phrase that the \fBUI_METHOD\fR provides. However,
the pass phrase is expected to be UTF\-8 encoded. The result of any
other encoding is undefined.
.SH EXAMPLES
.IX Header "EXAMPLES"
.SS "A generic call"
.IX Subsection "A generic call"
.Vb 1
\& OSSL_STORE_CTX *ctx = OSSL_STORE_open("file:/foo/bar/data.pem");
\&
\& /*
\& * OSSL_STORE_eof() simulates file semantics for any repository to signal
\& * that no more data can be expected
\& */
\& while (!OSSL_STORE_eof(ctx)) {
\& OSSL_STORE_INFO *info = OSSL_STORE_load(ctx);
\&
\& /*
\& * Do whatever is necessary with the OSSL_STORE_INFO,
\& * here just one example
\& */
\& switch (OSSL_STORE_INFO_get_type(info)) {
\& case OSSL_STORE_INFO_CERT:
\& /* Print the X.509 certificate text */
\& X509_print_fp(stdout, OSSL_STORE_INFO_get0_CERT(info));
\& /* Print the X.509 certificate PEM output */
\& PEM_write_X509(stdout, OSSL_STORE_INFO_get0_CERT(info));
\& break;
\& }
\& }
\&
\& OSSL_STORE_close(ctx);
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBOSSL_STORE_INFO\fR\|(3), \fBOSSL_STORE_LOADER\fR\|(3),
\&\fBOSSL_STORE_open\fR\|(3), \fBOSSL_STORE_expect\fR\|(3),
\&\fBOSSL_STORE_SEARCH\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2016\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]��B& & man/man7/ossl_store-file.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "OSSL_STORE-FILE 7"
.TH OSSL_STORE-FILE 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
ossl_store\-file \- The store 'file' scheme loader
.SH SYNOPSIS
.IX Header "SYNOPSIS"
#include <openssl/store.h>
.SH DESCRIPTION
.IX Header "DESCRIPTION"
Support for the 'file' scheme is built into \f(CW\*(C`libcrypto\*(C'\fR.
Since files come in all kinds of formats and content types, the 'file'
scheme has its own layer of functionality called "file handlers",
which are used to try to decode diverse types of file contents.
.PP
In case a file is formatted as PEM, each called file handler receives
the PEM name (everything following any '\f(CW\*(C`\-\-\-\-\-BEGIN \*(C'\fR') as well as
possible PEM headers, together with the decoded PEM body. Since PEM
formatted files can contain more than one object, the file handlers
are called upon for each such object.
.PP
If the file isn't determined to be formatted as PEM, the content is
loaded in raw form in its entirety and passed to the available file
handlers as is, with no PEM name or headers.
.PP
Each file handler is expected to handle PEM and non-PEM content as
appropriate. Some may refuse non-PEM content for the sake of
determinism (for example, there are keys out in the wild that are
represented as an ASN.1 OCTET STRING. In raw form, it's not easily
possible to distinguish those from any other data coming as an ASN.1
OCTET STRING, so such keys would naturally be accepted as PEM files
only).
.SH NOTES
.IX Header "NOTES"
When needed, the 'file' scheme loader will require a pass phrase by
using the \f(CW\*(C`UI_METHOD\*(C'\fR that was passed via \fBOSSL_STORE_open()\fR.
This pass phrase is expected to be UTF\-8 encoded, anything else will
give an undefined result.
The files made accessible through this loader are expected to be
standard compliant with regards to pass phrase encoding.
Files that aren't should be re-generated with a correctly encoded pass
phrase.
See \fBpassphrase\-encoding\fR\|(7) for more information.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBossl_store\fR\|(7), \fBpassphrase\-encoding\fR\|(7)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�)9�� � man/man7/x509.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "X509 7"
.TH X509 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
x509 \- X.509 certificate handling
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\& #include <openssl/x509.h>
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
An X.509 certificate is a structured grouping of information about
an individual, a device, or anything one can imagine. An X.509 CRL
(certificate revocation list) is a tool to help determine if a
certificate is still valid. The exact definition of those can be
found in the X.509 document from ITU-T, or in RFC3280 from PKIX.
In OpenSSL, the type X509 is used to express such a certificate, and
the type X509_CRL is used to express a CRL.
.PP
A related structure is a certificate request, defined in PKCS#10 from
RSA Security, Inc, also reflected in RFC2896. In OpenSSL, the type
X509_REQ is used to express such a certificate request.
.PP
To handle some complex parts of a certificate, there are the types
X509_NAME (to express a certificate name), X509_ATTRIBUTE (to express
a certificate attribute), X509_EXTENSION (to express a certificate
extension) and a few more.
.PP
Finally, there's the supertype X509_INFO, which can contain a CRL, a
certificate and a corresponding private key.
.PP
\&\fBX509_\fR\fIXXX\fR, \fBd2i_X509_\fR\fIXXX\fR, and \fBi2d_X509_\fR\fIXXX\fR functions
handle X.509 certificates, with some exceptions, shown below.
.PP
\&\fBX509_CRL_\fR\fIXXX\fR, \fBd2i_X509_CRL_\fR\fIXXX\fR, and \fBi2d_X509_CRL_\fR\fIXXX\fR
functions handle X.509 CRLs.
.PP
\&\fBX509_REQ_\fR\fIXXX\fR, \fBd2i_X509_REQ_\fR\fIXXX\fR, and \fBi2d_X509_REQ_\fR\fIXXX\fR
functions handle PKCS#10 certificate requests.
.PP
\&\fBX509_NAME_\fR\fIXXX\fR functions handle certificate names.
.PP
\&\fBX509_ATTRIBUTE_\fR\fIXXX\fR functions handle certificate attributes.
.PP
\&\fBX509_EXTENSION_\fR\fIXXX\fR functions handle certificate extensions.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBX509_NAME_ENTRY_get_object\fR\|(3),
\&\fBX509_NAME_add_entry_by_txt\fR\|(3),
\&\fBX509_NAME_add_entry_by_NID\fR\|(3),
\&\fBX509_NAME_print_ex\fR\|(3),
\&\fBX509_NAME_new\fR\|(3),
\&\fBd2i_X509\fR\|(3),
\&\fBd2i_X509_ALGOR\fR\|(3),
\&\fBd2i_X509_CRL\fR\|(3),
\&\fBd2i_X509_NAME\fR\|(3),
\&\fBd2i_X509_REQ\fR\|(3),
\&\fBd2i_X509_SIG\fR\|(3),
\&\fBX509v3\fR\|(3),
\&\fBcrypto\fR\|(7)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2003\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]y�ki i man/man7/des_modes.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "DES_MODES 7"
.TH DES_MODES 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
des_modes \- the variants of DES and other crypto algorithms of OpenSSL
.SH DESCRIPTION
.IX Header "DESCRIPTION"
Several crypto algorithms for OpenSSL can be used in a number of modes. Those
are used for using block ciphers in a way similar to stream ciphers, among
other things.
.SH OVERVIEW
.IX Header "OVERVIEW"
.SS "Electronic Codebook Mode (ECB)"
.IX Subsection "Electronic Codebook Mode (ECB)"
Normally, this is found as the function \fIalgorithm\fR\fB_ecb_encrypt()\fR.
.IP \(bu 2
64 bits are enciphered at a time.
.IP \(bu 2
The order of the blocks can be rearranged without detection.
.IP \(bu 2
The same plaintext block always produces the same ciphertext block
(for the same key) making it vulnerable to a 'dictionary attack'.
.IP \(bu 2
An error will only affect one ciphertext block.
.SS "Cipher Block Chaining Mode (CBC)"
.IX Subsection "Cipher Block Chaining Mode (CBC)"
Normally, this is found as the function \fIalgorithm\fR\fB_cbc_encrypt()\fR.
Be aware that \fBdes_cbc_encrypt()\fR is not really DES CBC (it does
not update the IV); use \fBdes_ncbc_encrypt()\fR instead.
.IP \(bu 2
a multiple of 64 bits are enciphered at a time.
.IP \(bu 2
The CBC mode produces the same ciphertext whenever the same
plaintext is encrypted using the same key and starting variable.
.IP \(bu 2
The chaining operation makes the ciphertext blocks dependent on the
current and all preceding plaintext blocks and therefore blocks can not
be rearranged.
.IP \(bu 2
The use of different starting variables prevents the same plaintext
enciphering to the same ciphertext.
.IP \(bu 2
An error will affect the current and the following ciphertext blocks.
.SS "Cipher Feedback Mode (CFB)"
.IX Subsection "Cipher Feedback Mode (CFB)"
Normally, this is found as the function \fIalgorithm\fR\fB_cfb_encrypt()\fR.
.IP \(bu 2
a number of bits (j) <= 64 are enciphered at a time.
.IP \(bu 2
The CFB mode produces the same ciphertext whenever the same
plaintext is encrypted using the same key and starting variable.
.IP \(bu 2
The chaining operation makes the ciphertext variables dependent on the
current and all preceding variables and therefore j\-bit variables are
chained together and can not be rearranged.
.IP \(bu 2
The use of different starting variables prevents the same plaintext
enciphering to the same ciphertext.
.IP \(bu 2
The strength of the CFB mode depends on the size of k (maximal if
j == k). In my implementation this is always the case.
.IP \(bu 2
Selection of a small value for j will require more cycles through
the encipherment algorithm per unit of plaintext and thus cause
greater processing overheads.
.IP \(bu 2
Only multiples of j bits can be enciphered.
.IP \(bu 2
An error will affect the current and the following ciphertext variables.
.SS "Output Feedback Mode (OFB)"
.IX Subsection "Output Feedback Mode (OFB)"
Normally, this is found as the function \fIalgorithm\fR\fB_ofb_encrypt()\fR.
.IP \(bu 2
a number of bits (j) <= 64 are enciphered at a time.
.IP \(bu 2
The OFB mode produces the same ciphertext whenever the same
plaintext enciphered using the same key and starting variable. More
over, in the OFB mode the same key stream is produced when the same
key and start variable are used. Consequently, for security reasons
a specific start variable should be used only once for a given key.
.IP \(bu 2
The absence of chaining makes the OFB more vulnerable to specific attacks.
.IP \(bu 2
The use of different start variables values prevents the same
plaintext enciphering to the same ciphertext, by producing different
key streams.
.IP \(bu 2
Selection of a small value for j will require more cycles through
the encipherment algorithm per unit of plaintext and thus cause
greater processing overheads.
.IP \(bu 2
Only multiples of j bits can be enciphered.
.IP \(bu 2
OFB mode of operation does not extend ciphertext errors in the
resultant plaintext output. Every bit error in the ciphertext causes
only one bit to be in error in the deciphered plaintext.
.IP \(bu 2
OFB mode is not self-synchronizing. If the two operation of
encipherment and decipherment get out of synchronism, the system needs
to be re-initialized.
.IP \(bu 2
Each re-initialization should use a value of the start variable
different from the start variable values used before with the same
key. The reason for this is that an identical bit stream would be
produced each time from the same parameters. This would be
susceptible to a 'known plaintext' attack.
.SS "Triple ECB Mode"
.IX Subsection "Triple ECB Mode"
Normally, this is found as the function \fIalgorithm\fR\fB_ecb3_encrypt()\fR.
.IP \(bu 2
Encrypt with key1, decrypt with key2 and encrypt with key3 again.
.IP \(bu 2
As for ECB encryption but increases the key length to 168 bits.
There are theoretic attacks that can be used that make the effective
key length 112 bits, but this attack also requires 2^56 blocks of
memory, not very likely, even for the NSA.
.IP \(bu 2
If both keys are the same it is equivalent to encrypting once with
just one key.
.IP \(bu 2
If the first and last key are the same, the key length is 112 bits.
There are attacks that could reduce the effective key strength
to only slightly more than 56 bits, but these require a lot of memory.
.IP \(bu 2
If all 3 keys are the same, this is effectively the same as normal
ecb mode.
.SS "Triple CBC Mode"
.IX Subsection "Triple CBC Mode"
Normally, this is found as the function \fIalgorithm\fR\fB_ede3_cbc_encrypt()\fR.
.IP \(bu 2
Encrypt with key1, decrypt with key2 and then encrypt with key3.
.IP \(bu 2
As for CBC encryption but increases the key length to 168 bits with
the same restrictions as for triple ecb mode.
.SH NOTES
.IX Header "NOTES"
This text was been written in large parts by Eric Young in his original
documentation for SSLeay, the predecessor of OpenSSL. In turn, he attributed
it to:
.PP
.Vb 5
\& AS 2805.5.2
\& Australian Standard
\& Electronic funds transfer \- Requirements for interfaces,
\& Part 5.2: Modes of operation for an n\-bit block cipher algorithm
\& Appendix A
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBBF_encrypt\fR\|(3), \fBDES_crypt\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]��c. man/man7/X25519.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "X25519 7"
.TH X25519 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
X25519,
X448
\&\- EVP_PKEY X25519 and X448 support
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBX25519\fR and \fBX448\fR EVP_PKEY implementation supports key generation and
key derivation using \fBX25519\fR and \fBX448\fR. It has associated private and public
key formats compatible with RFC 8410.
.PP
No additional parameters can be set during key generation.
.PP
The peer public key must be set using \fBEVP_PKEY_derive_set_peer()\fR when
performing key derivation.
.SH NOTES
.IX Header "NOTES"
A context for the \fBX25519\fR algorithm can be obtained by calling:
.PP
.Vb 1
\& EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL);
.Ve
.PP
For the \fBX448\fR algorithm a context can be obtained by calling:
.PP
.Vb 1
\& EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X448, NULL);
.Ve
.PP
X25519 or X448 private keys can be set directly using
\&\fBEVP_PKEY_new_raw_private_key\fR\|(3) or loaded from a PKCS#8 private key file
using \fBPEM_read_bio_PrivateKey\fR\|(3) (or similar function). Completely new keys
can also be generated (see the example below). Setting a private key also sets
the associated public key.
.PP
X25519 or X448 public keys can be set directly using
\&\fBEVP_PKEY_new_raw_public_key\fR\|(3) or loaded from a SubjectPublicKeyInfo
structure in a PEM file using \fBPEM_read_bio_PUBKEY\fR\|(3) (or similar function).
.SH EXAMPLES
.IX Header "EXAMPLES"
This example generates an \fBX25519\fR private key and writes it to standard
output in PEM format:
.PP
.Vb 9
\& #include <openssl/evp.h>
\& #include <openssl/pem.h>
\& ...
\& EVP_PKEY *pkey = NULL;
\& EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL);
\& EVP_PKEY_keygen_init(pctx);
\& EVP_PKEY_keygen(pctx, &pkey);
\& EVP_PKEY_CTX_free(pctx);
\& PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL);
.Ve
.PP
The key derivation example in \fBEVP_PKEY_derive\fR\|(3) can be used with
\&\fBX25519\fR and \fBX448\fR.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBEVP_PKEY_CTX_new\fR\|(3),
\&\fBEVP_PKEY_keygen\fR\|(3),
\&\fBEVP_PKEY_derive\fR\|(3),
\&\fBEVP_PKEY_derive_set_peer\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2017\-2020 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]v<��@� @� man/man7/ssl.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "SSL 7"
.TH SSL 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
ssl \- OpenSSL SSL/TLS library
.SH SYNOPSIS
.IX Header "SYNOPSIS"
See the individual manual pages for details.
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The OpenSSL \fBssl\fR library implements the Secure Sockets Layer (SSL v2/v3) and
Transport Layer Security (TLS v1) protocols. It provides a rich API which is
documented here.
.PP
An \fBSSL_CTX\fR object is created as a framework to establish
TLS/SSL enabled connections (see \fBSSL_CTX_new\fR\|(3)).
Various options regarding certificates, algorithms etc. can be set
in this object.
.PP
When a network connection has been created, it can be assigned to an
\&\fBSSL\fR object. After the \fBSSL\fR object has been created using
\&\fBSSL_new\fR\|(3), \fBSSL_set_fd\fR\|(3) or
\&\fBSSL_set_bio\fR\|(3) can be used to associate the network
connection with the object.
.PP
When the TLS/SSL handshake is performed using
\&\fBSSL_accept\fR\|(3) or \fBSSL_connect\fR\|(3)
respectively.
\&\fBSSL_read_ex\fR\|(3), \fBSSL_read\fR\|(3), \fBSSL_write_ex\fR\|(3) and \fBSSL_write\fR\|(3) are
used to read and write data on the TLS/SSL connection.
\&\fBSSL_shutdown\fR\|(3) can be used to shut down the
TLS/SSL connection.
.SH "DATA STRUCTURES"
.IX Header "DATA STRUCTURES"
Currently the OpenSSL \fBssl\fR library functions deals with the following data
structures:
.IP "\fBSSL_METHOD\fR (SSL Method)" 4
.IX Item "SSL_METHOD (SSL Method)"
This is a dispatch structure describing the internal \fBssl\fR library
methods/functions which implement the various protocol versions (SSLv3
TLSv1, ...). It's needed to create an \fBSSL_CTX\fR.
.IP "\fBSSL_CIPHER\fR (SSL Cipher)" 4
.IX Item "SSL_CIPHER (SSL Cipher)"
This structure holds the algorithm information for a particular cipher which
are a core part of the SSL/TLS protocol. The available ciphers are configured
on a \fBSSL_CTX\fR basis and the actual ones used are then part of the
\&\fBSSL_SESSION\fR.
.IP "\fBSSL_CTX\fR (SSL Context)" 4
.IX Item "SSL_CTX (SSL Context)"
This is the global context structure which is created by a server or client
once per program life-time and which holds mainly default values for the
\&\fBSSL\fR structures which are later created for the connections.
.IP "\fBSSL_SESSION\fR (SSL Session)" 4
.IX Item "SSL_SESSION (SSL Session)"
This is a structure containing the current TLS/SSL session details for a
connection: \fBSSL_CIPHER\fRs, client and server certificates, keys, etc.
.IP "\fBSSL\fR (SSL Connection)" 4
.IX Item "SSL (SSL Connection)"
This is the main SSL/TLS structure which is created by a server or client per
established connection. This actually is the core structure in the SSL API.
At run-time the application usually deals with this structure which has
links to mostly all other structures.
.SH "HEADER FILES"
.IX Header "HEADER FILES"
Currently the OpenSSL \fBssl\fR library provides the following C header files
containing the prototypes for the data structures and functions:
.IP \fBssl.h\fR 4
.IX Item "ssl.h"
This is the common header file for the SSL/TLS API. Include it into your
program to make the API of the \fBssl\fR library available. It internally
includes both more private SSL headers and headers from the \fBcrypto\fR library.
Whenever you need hard-core details on the internals of the SSL API, look
inside this header file.
.IP \fBssl2.h\fR 4
.IX Item "ssl2.h"
Unused. Present for backwards compatibility only.
.IP \fBssl3.h\fR 4
.IX Item "ssl3.h"
This is the sub header file dealing with the SSLv3 protocol only.
\&\fIUsually you don't have to include it explicitly because
it's already included by ssl.h\fR.
.IP \fBtls1.h\fR 4
.IX Item "tls1.h"
This is the sub header file dealing with the TLSv1 protocol only.
\&\fIUsually you don't have to include it explicitly because
it's already included by ssl.h\fR.
.SH "API FUNCTIONS"
.IX Header "API FUNCTIONS"
Currently the OpenSSL \fBssl\fR library exports 214 API functions.
They are documented in the following:
.SS "Dealing with Protocol Methods"
.IX Subsection "Dealing with Protocol Methods"
Here we document the various API functions which deal with the SSL/TLS
protocol methods defined in \fBSSL_METHOD\fR structures.
.IP "const SSL_METHOD *\fBTLS_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLS_method(void);"
Constructor for the \fIversion-flexible\fR SSL_METHOD structure for clients,
servers or both.
See \fBSSL_CTX_new\fR\|(3) for details.
.IP "const SSL_METHOD *\fBTLS_client_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLS_client_method(void);"
Constructor for the \fIversion-flexible\fR SSL_METHOD structure for clients.
Must be used to support the TLSv1.3 protocol.
.IP "const SSL_METHOD *\fBTLS_server_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLS_server_method(void);"
Constructor for the \fIversion-flexible\fR SSL_METHOD structure for servers.
Must be used to support the TLSv1.3 protocol.
.IP "const SSL_METHOD *\fBTLSv1_2_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_2_method(void);"
Constructor for the TLSv1.2 SSL_METHOD structure for clients, servers or both.
.IP "const SSL_METHOD *\fBTLSv1_2_client_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_2_client_method(void);"
Constructor for the TLSv1.2 SSL_METHOD structure for clients.
.IP "const SSL_METHOD *\fBTLSv1_2_server_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_2_server_method(void);"
Constructor for the TLSv1.2 SSL_METHOD structure for servers.
.IP "const SSL_METHOD *\fBTLSv1_1_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_1_method(void);"
Constructor for the TLSv1.1 SSL_METHOD structure for clients, servers or both.
.IP "const SSL_METHOD *\fBTLSv1_1_client_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_1_client_method(void);"
Constructor for the TLSv1.1 SSL_METHOD structure for clients.
.IP "const SSL_METHOD *\fBTLSv1_1_server_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_1_server_method(void);"
Constructor for the TLSv1.1 SSL_METHOD structure for servers.
.IP "const SSL_METHOD *\fBTLSv1_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_method(void);"
Constructor for the TLSv1 SSL_METHOD structure for clients, servers or both.
.IP "const SSL_METHOD *\fBTLSv1_client_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_client_method(void);"
Constructor for the TLSv1 SSL_METHOD structure for clients.
.IP "const SSL_METHOD *\fBTLSv1_server_method\fR(void);" 4
.IX Item "const SSL_METHOD *TLSv1_server_method(void);"
Constructor for the TLSv1 SSL_METHOD structure for servers.
.IP "const SSL_METHOD *\fBSSLv3_method\fR(void);" 4
.IX Item "const SSL_METHOD *SSLv3_method(void);"
Constructor for the SSLv3 SSL_METHOD structure for clients, servers or both.
.IP "const SSL_METHOD *\fBSSLv3_client_method\fR(void);" 4
.IX Item "const SSL_METHOD *SSLv3_client_method(void);"
Constructor for the SSLv3 SSL_METHOD structure for clients.
.IP "const SSL_METHOD *\fBSSLv3_server_method\fR(void);" 4
.IX Item "const SSL_METHOD *SSLv3_server_method(void);"
Constructor for the SSLv3 SSL_METHOD structure for servers.
.SS "Dealing with Ciphers"
.IX Subsection "Dealing with Ciphers"
Here we document the various API functions which deal with the SSL/TLS
ciphers defined in \fBSSL_CIPHER\fR structures.
.IP "char *\fBSSL_CIPHER_description\fR(SSL_CIPHER *cipher, char *buf, int len);" 4
.IX Item "char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len);"
Write a string to \fIbuf\fR (with a maximum size of \fIlen\fR) containing a human
readable description of \fIcipher\fR. Returns \fIbuf\fR.
.IP "int \fBSSL_CIPHER_get_bits\fR(SSL_CIPHER *cipher, int *alg_bits);" 4
.IX Item "int SSL_CIPHER_get_bits(SSL_CIPHER *cipher, int *alg_bits);"
Determine the number of bits in \fIcipher\fR. Because of export crippled ciphers
there are two bits: The bits the algorithm supports in general (stored to
\&\fIalg_bits\fR) and the bits which are actually used (the return value).
.IP "const char *\fBSSL_CIPHER_get_name\fR(SSL_CIPHER *cipher);" 4
.IX Item "const char *SSL_CIPHER_get_name(SSL_CIPHER *cipher);"
Return the internal name of \fIcipher\fR as a string. These are the various
strings defined by the \fISSL3_TXT_xxx\fR and \fITLS1_TXT_xxx\fR
definitions in the header files.
.IP "const char *\fBSSL_CIPHER_get_version\fR(SSL_CIPHER *cipher);" 4
.IX Item "const char *SSL_CIPHER_get_version(SSL_CIPHER *cipher);"
Returns a string like "\f(CW\*(C`SSLv3\*(C'\fR" or "\f(CW\*(C`TLSv1.2\*(C'\fR" which indicates the
SSL/TLS protocol version to which \fIcipher\fR belongs (i.e. where it was defined
in the specification the first time).
.SS "Dealing with Protocol Contexts"
.IX Subsection "Dealing with Protocol Contexts"
Here we document the various API functions which deal with the SSL/TLS
protocol context defined in the \fBSSL_CTX\fR structure.
.IP "int \fBSSL_CTX_add_client_CA\fR(SSL_CTX *ctx, X509 *x);" 4
.IX Item "int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x);"
.PD 0
.IP "long \fBSSL_CTX_add_extra_chain_cert\fR(SSL_CTX *ctx, X509 *x509);" 4
.IX Item "long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509);"
.IP "int \fBSSL_CTX_add_session\fR(SSL_CTX *ctx, SSL_SESSION *c);" 4
.IX Item "int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c);"
.IP "int \fBSSL_CTX_check_private_key\fR(const SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_check_private_key(const SSL_CTX *ctx);"
.IP "long \fBSSL_CTX_ctrl\fR(SSL_CTX *ctx, int cmd, long larg, char *parg);" 4
.IX Item "long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg);"
.IP "void \fBSSL_CTX_flush_sessions\fR(SSL_CTX *s, long t);" 4
.IX Item "void SSL_CTX_flush_sessions(SSL_CTX *s, long t);"
.IP "void \fBSSL_CTX_free\fR(SSL_CTX *a);" 4
.IX Item "void SSL_CTX_free(SSL_CTX *a);"
.IP "char *\fBSSL_CTX_get_app_data\fR(SSL_CTX *ctx);" 4
.IX Item "char *SSL_CTX_get_app_data(SSL_CTX *ctx);"
.IP "X509_STORE *\fBSSL_CTX_get_cert_store\fR(SSL_CTX *ctx);" 4
.IX Item "X509_STORE *SSL_CTX_get_cert_store(SSL_CTX *ctx);"
.IP "STACK *\fBSSL_CTX_get_ciphers\fR(const SSL_CTX *ctx);" 4
.IX Item "STACK *SSL_CTX_get_ciphers(const SSL_CTX *ctx);"
.IP "STACK *\fBSSL_CTX_get_client_CA_list\fR(const SSL_CTX *ctx);" 4
.IX Item "STACK *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx);"
.IP "int (*\fBSSL_CTX_get_client_cert_cb\fR(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey);" 4
.IX Item "int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey);"
.IP "void \fBSSL_CTX_get_default_read_ahead\fR(SSL_CTX *ctx);" 4
.IX Item "void SSL_CTX_get_default_read_ahead(SSL_CTX *ctx);"
.IP "char *\fBSSL_CTX_get_ex_data\fR(const SSL_CTX *s, int idx);" 4
.IX Item "char *SSL_CTX_get_ex_data(const SSL_CTX *s, int idx);"
.IP "int \fBSSL_CTX_get_ex_new_index\fR(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))" 4
.IX Item "int SSL_CTX_get_ex_new_index(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))"
.IP "void (*\fBSSL_CTX_get_info_callback\fR(SSL_CTX *ctx))(SSL *ssl, int cb, int ret);" 4
.IX Item "void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(SSL *ssl, int cb, int ret);"
.IP "int \fBSSL_CTX_get_quiet_shutdown\fR(const SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);"
.IP "void \fBSSL_CTX_get_read_ahead\fR(SSL_CTX *ctx);" 4
.IX Item "void SSL_CTX_get_read_ahead(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_get_session_cache_mode\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_get_session_cache_mode(SSL_CTX *ctx);"
.IP "long \fBSSL_CTX_get_timeout\fR(const SSL_CTX *ctx);" 4
.IX Item "long SSL_CTX_get_timeout(const SSL_CTX *ctx);"
.IP "int (*\fBSSL_CTX_get_verify_callback\fR(const SSL_CTX *ctx))(int ok, X509_STORE_CTX *ctx);" 4
.IX Item "int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int ok, X509_STORE_CTX *ctx);"
.IP "int \fBSSL_CTX_get_verify_mode\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_get_verify_mode(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_load_verify_locations\fR(SSL_CTX *ctx, const char *CAfile, const char *CApath);" 4
.IX Item "int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);"
.IP "SSL_CTX *\fBSSL_CTX_new\fR(const SSL_METHOD *meth);" 4
.IX Item "SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);"
.IP "int SSL_CTX_up_ref(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_up_ref(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_remove_session\fR(SSL_CTX *ctx, SSL_SESSION *c);" 4
.IX Item "int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c);"
.IP "int \fBSSL_CTX_sess_accept\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_accept(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_accept_good\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_accept_good(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_accept_renegotiate\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_accept_renegotiate(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_cache_full\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_cache_full(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_cb_hits\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_cb_hits(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_connect\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_connect(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_connect_good\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_connect_good(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_connect_renegotiate\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_connect_renegotiate(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_get_cache_size\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_get_cache_size(SSL_CTX *ctx);"
.IP "SSL_SESSION *(*\fBSSL_CTX_sess_get_get_cb\fR(SSL_CTX *ctx))(SSL *ssl, unsigned char *data, int len, int *copy);" 4
.IX Item "SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(SSL *ssl, unsigned char *data, int len, int *copy);"
.IP "int (*\fBSSL_CTX_sess_get_new_cb\fR(SSL_CTX *ctx)(SSL *ssl, SSL_SESSION *sess);" 4
.IX Item "int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)(SSL *ssl, SSL_SESSION *sess);"
.IP "void (*\fBSSL_CTX_sess_get_remove_cb\fR(SSL_CTX *ctx)(SSL_CTX *ctx, SSL_SESSION *sess);" 4
.IX Item "void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx)(SSL_CTX *ctx, SSL_SESSION *sess);"
.IP "int \fBSSL_CTX_sess_hits\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_hits(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_misses\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_misses(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_sess_number\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_number(SSL_CTX *ctx);"
.IP "void \fBSSL_CTX_sess_set_cache_size\fR(SSL_CTX *ctx, t);" 4
.IX Item "void SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, t);"
.IP "void \fBSSL_CTX_sess_set_get_cb\fR(SSL_CTX *ctx, SSL_SESSION *(*cb)(SSL *ssl, unsigned char *data, int len, int *copy));" 4
.IX Item "void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, SSL_SESSION *(*cb)(SSL *ssl, unsigned char *data, int len, int *copy));"
.IP "void \fBSSL_CTX_sess_set_new_cb\fR(SSL_CTX *ctx, int (*cb)(SSL *ssl, SSL_SESSION *sess));" 4
.IX Item "void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, SSL_SESSION *sess));"
.IP "void \fBSSL_CTX_sess_set_remove_cb\fR(SSL_CTX *ctx, void (*cb)(SSL_CTX *ctx, SSL_SESSION *sess));" 4
.IX Item "void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, void (*cb)(SSL_CTX *ctx, SSL_SESSION *sess));"
.IP "int \fBSSL_CTX_sess_timeouts\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_sess_timeouts(SSL_CTX *ctx);"
.IP "LHASH *\fBSSL_CTX_sessions\fR(SSL_CTX *ctx);" 4
.IX Item "LHASH *SSL_CTX_sessions(SSL_CTX *ctx);"
.IP "int \fBSSL_CTX_set_app_data\fR(SSL_CTX *ctx, void *arg);" 4
.IX Item "int SSL_CTX_set_app_data(SSL_CTX *ctx, void *arg);"
.IP "void \fBSSL_CTX_set_cert_store\fR(SSL_CTX *ctx, X509_STORE *cs);" 4
.IX Item "void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *cs);"
.IP "void \fBSSL_CTX_set1_cert_store\fR(SSL_CTX *ctx, X509_STORE *cs);" 4
.IX Item "void SSL_CTX_set1_cert_store(SSL_CTX *ctx, X509_STORE *cs);"
.IP "void \fBSSL_CTX_set_cert_verify_cb\fR(SSL_CTX *ctx, int (*cb)(), char *arg)" 4
.IX Item "void SSL_CTX_set_cert_verify_cb(SSL_CTX *ctx, int (*cb)(), char *arg)"
.IP "int \fBSSL_CTX_set_cipher_list\fR(SSL_CTX *ctx, char *str);" 4
.IX Item "int SSL_CTX_set_cipher_list(SSL_CTX *ctx, char *str);"
.IP "void \fBSSL_CTX_set_client_CA_list\fR(SSL_CTX *ctx, STACK *list);" 4
.IX Item "void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK *list);"
.IP "void \fBSSL_CTX_set_client_cert_cb\fR(SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey));" 4
.IX Item "void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey));"
.IP "int \fBSSL_CTX_set_ct_validation_callback\fR(SSL_CTX *ctx, ssl_ct_validation_cb callback, void *arg);" 4
.IX Item "int SSL_CTX_set_ct_validation_callback(SSL_CTX *ctx, ssl_ct_validation_cb callback, void *arg);"
.IP "void \fBSSL_CTX_set_default_passwd_cb\fR(SSL_CTX *ctx, int (*cb);(void))" 4
.IX Item "void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, int (*cb);(void))"
.IP "void \fBSSL_CTX_set_default_read_ahead\fR(SSL_CTX *ctx, int m);" 4
.IX Item "void SSL_CTX_set_default_read_ahead(SSL_CTX *ctx, int m);"
.IP "int \fBSSL_CTX_set_default_verify_paths\fR(SSL_CTX *ctx);" 4
.IX Item "int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);"
.PD
Use the default paths to locate trusted CA certificates. There is one default
directory path and one default file path. Both are set via this call.
.IP "int \fBSSL_CTX_set_default_verify_dir\fR(SSL_CTX *ctx)" 4
.IX Item "int SSL_CTX_set_default_verify_dir(SSL_CTX *ctx)"
Use the default directory path to locate trusted CA certificates.
.IP "int \fBSSL_CTX_set_default_verify_file\fR(SSL_CTX *ctx)" 4
.IX Item "int SSL_CTX_set_default_verify_file(SSL_CTX *ctx)"
Use the file path to locate trusted CA certificates.
.IP "int \fBSSL_CTX_set_ex_data\fR(SSL_CTX *s, int idx, char *arg);" 4
.IX Item "int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, char *arg);"
.PD 0
.IP "void \fBSSL_CTX_set_info_callback\fR(SSL_CTX *ctx, void (*cb)(SSL *ssl, int cb, int ret));" 4
.IX Item "void SSL_CTX_set_info_callback(SSL_CTX *ctx, void (*cb)(SSL *ssl, int cb, int ret));"
.IP "void \fBSSL_CTX_set_msg_callback\fR(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));" 4
.IX Item "void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));"
.IP "void \fBSSL_CTX_set_msg_callback_arg\fR(SSL_CTX *ctx, void *arg);" 4
.IX Item "void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg);"
.IP "unsigned long \fBSSL_CTX_clear_options\fR(SSL_CTX *ctx, unsigned long op);" 4
.IX Item "unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op);"
.IP "unsigned long \fBSSL_CTX_get_options\fR(SSL_CTX *ctx);" 4
.IX Item "unsigned long SSL_CTX_get_options(SSL_CTX *ctx);"
.IP "unsigned long \fBSSL_CTX_set_options\fR(SSL_CTX *ctx, unsigned long op);" 4
.IX Item "unsigned long SSL_CTX_set_options(SSL_CTX *ctx, unsigned long op);"
.IP "void \fBSSL_CTX_set_quiet_shutdown\fR(SSL_CTX *ctx, int mode);" 4
.IX Item "void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode);"
.IP "void \fBSSL_CTX_set_read_ahead\fR(SSL_CTX *ctx, int m);" 4
.IX Item "void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int m);"
.IP "void \fBSSL_CTX_set_session_cache_mode\fR(SSL_CTX *ctx, int mode);" 4
.IX Item "void SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, int mode);"
.IP "int \fBSSL_CTX_set_ssl_version\fR(SSL_CTX *ctx, const SSL_METHOD *meth);" 4
.IX Item "int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth);"
.IP "void \fBSSL_CTX_set_timeout\fR(SSL_CTX *ctx, long t);" 4
.IX Item "void SSL_CTX_set_timeout(SSL_CTX *ctx, long t);"
.IP "long \fBSSL_CTX_set_tmp_dh\fR(SSL_CTX* ctx, DH *dh);" 4
.IX Item "long SSL_CTX_set_tmp_dh(SSL_CTX* ctx, DH *dh);"
.IP "long \fBSSL_CTX_set_tmp_dh_callback\fR(SSL_CTX *ctx, DH *(*cb)(void));" 4
.IX Item "long SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, DH *(*cb)(void));"
.IP "void \fBSSL_CTX_set_verify\fR(SSL_CTX *ctx, int mode, int (*cb);(void))" 4
.IX Item "void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*cb);(void))"
.IP "int \fBSSL_CTX_use_PrivateKey\fR(SSL_CTX *ctx, EVP_PKEY *pkey);" 4
.IX Item "int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);"
.IP "int \fBSSL_CTX_use_PrivateKey_ASN1\fR(int type, SSL_CTX *ctx, unsigned char *d, long len);" 4
.IX Item "int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, unsigned char *d, long len);"
.IP "int \fBSSL_CTX_use_PrivateKey_file\fR(SSL_CTX *ctx, const char *file, int type);" 4
.IX Item "int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);"
.IP "int \fBSSL_CTX_use_RSAPrivateKey\fR(SSL_CTX *ctx, RSA *rsa);" 4
.IX Item "int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);"
.IP "int \fBSSL_CTX_use_RSAPrivateKey_ASN1\fR(SSL_CTX *ctx, unsigned char *d, long len);" 4
.IX Item "int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, unsigned char *d, long len);"
.IP "int \fBSSL_CTX_use_RSAPrivateKey_file\fR(SSL_CTX *ctx, const char *file, int type);" 4
.IX Item "int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);"
.IP "int \fBSSL_CTX_use_certificate\fR(SSL_CTX *ctx, X509 *x);" 4
.IX Item "int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);"
.IP "int \fBSSL_CTX_use_certificate_ASN1\fR(SSL_CTX *ctx, int len, unsigned char *d);" 4
.IX Item "int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, unsigned char *d);"
.IP "int \fBSSL_CTX_use_certificate_file\fR(SSL_CTX *ctx, const char *file, int type);" 4
.IX Item "int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);"
.IP "int \fBSSL_CTX_use_cert_and_key\fR(SSL_CTX *ctx, X509 *x, EVP_PKEY *pkey, STACK_OF(X509) *chain, int override);" 4
.IX Item "int SSL_CTX_use_cert_and_key(SSL_CTX *ctx, X509 *x, EVP_PKEY *pkey, STACK_OF(X509) *chain, int override);"
.IP "X509 *\fBSSL_CTX_get0_certificate\fR(const SSL_CTX *ctx);" 4
.IX Item "X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx);"
.IP "EVP_PKEY *\fBSSL_CTX_get0_privatekey\fR(const SSL_CTX *ctx);" 4
.IX Item "EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx);"
.IP "void \fBSSL_CTX_set_psk_client_callback\fR(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len));" 4
.IX Item "void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len));"
.IP "int \fBSSL_CTX_use_psk_identity_hint\fR(SSL_CTX *ctx, const char *hint);" 4
.IX Item "int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint);"
.IP "void \fBSSL_CTX_set_psk_server_callback\fR(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));" 4
.IX Item "void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));"
.PD
.SS "Dealing with Sessions"
.IX Subsection "Dealing with Sessions"
Here we document the various API functions which deal with the SSL/TLS
sessions defined in the \fBSSL_SESSION\fR structures.
.IP "int \fBSSL_SESSION_cmp\fR(const SSL_SESSION *a, const SSL_SESSION *b);" 4
.IX Item "int SSL_SESSION_cmp(const SSL_SESSION *a, const SSL_SESSION *b);"
.PD 0
.IP "void \fBSSL_SESSION_free\fR(SSL_SESSION *ss);" 4
.IX Item "void SSL_SESSION_free(SSL_SESSION *ss);"
.IP "char *\fBSSL_SESSION_get_app_data\fR(SSL_SESSION *s);" 4
.IX Item "char *SSL_SESSION_get_app_data(SSL_SESSION *s);"
.IP "char *\fBSSL_SESSION_get_ex_data\fR(const SSL_SESSION *s, int idx);" 4
.IX Item "char *SSL_SESSION_get_ex_data(const SSL_SESSION *s, int idx);"
.IP "int \fBSSL_SESSION_get_ex_new_index\fR(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))" 4
.IX Item "int SSL_SESSION_get_ex_new_index(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))"
.IP "long \fBSSL_SESSION_get_time\fR(const SSL_SESSION *s);" 4
.IX Item "long SSL_SESSION_get_time(const SSL_SESSION *s);"
.IP "long \fBSSL_SESSION_get_timeout\fR(const SSL_SESSION *s);" 4
.IX Item "long SSL_SESSION_get_timeout(const SSL_SESSION *s);"
.IP "unsigned long \fBSSL_SESSION_hash\fR(const SSL_SESSION *a);" 4
.IX Item "unsigned long SSL_SESSION_hash(const SSL_SESSION *a);"
.IP "SSL_SESSION *\fBSSL_SESSION_new\fR(void);" 4
.IX Item "SSL_SESSION *SSL_SESSION_new(void);"
.IP "int \fBSSL_SESSION_print\fR(BIO *bp, const SSL_SESSION *x);" 4
.IX Item "int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x);"
.IP "int \fBSSL_SESSION_print_fp\fR(FILE *fp, const SSL_SESSION *x);" 4
.IX Item "int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *x);"
.IP "int \fBSSL_SESSION_set_app_data\fR(SSL_SESSION *s, char *a);" 4
.IX Item "int SSL_SESSION_set_app_data(SSL_SESSION *s, char *a);"
.IP "int \fBSSL_SESSION_set_ex_data\fR(SSL_SESSION *s, int idx, char *arg);" 4
.IX Item "int SSL_SESSION_set_ex_data(SSL_SESSION *s, int idx, char *arg);"
.IP "long \fBSSL_SESSION_set_time\fR(SSL_SESSION *s, long t);" 4
.IX Item "long SSL_SESSION_set_time(SSL_SESSION *s, long t);"
.IP "long \fBSSL_SESSION_set_timeout\fR(SSL_SESSION *s, long t);" 4
.IX Item "long SSL_SESSION_set_timeout(SSL_SESSION *s, long t);"
.PD
.SS "Dealing with Connections"
.IX Subsection "Dealing with Connections"
Here we document the various API functions which deal with the SSL/TLS
connection defined in the \fBSSL\fR structure.
.IP "int \fBSSL_accept\fR(SSL *ssl);" 4
.IX Item "int SSL_accept(SSL *ssl);"
.PD 0
.IP "int \fBSSL_add_dir_cert_subjects_to_stack\fR(STACK *stack, const char *dir);" 4
.IX Item "int SSL_add_dir_cert_subjects_to_stack(STACK *stack, const char *dir);"
.IP "int \fBSSL_add_file_cert_subjects_to_stack\fR(STACK *stack, const char *file);" 4
.IX Item "int SSL_add_file_cert_subjects_to_stack(STACK *stack, const char *file);"
.IP "int \fBSSL_add_client_CA\fR(SSL *ssl, X509 *x);" 4
.IX Item "int SSL_add_client_CA(SSL *ssl, X509 *x);"
.IP "char *\fBSSL_alert_desc_string\fR(int value);" 4
.IX Item "char *SSL_alert_desc_string(int value);"
.IP "char *\fBSSL_alert_desc_string_long\fR(int value);" 4
.IX Item "char *SSL_alert_desc_string_long(int value);"
.IP "char *\fBSSL_alert_type_string\fR(int value);" 4
.IX Item "char *SSL_alert_type_string(int value);"
.IP "char *\fBSSL_alert_type_string_long\fR(int value);" 4
.IX Item "char *SSL_alert_type_string_long(int value);"
.IP "int \fBSSL_check_private_key\fR(const SSL *ssl);" 4
.IX Item "int SSL_check_private_key(const SSL *ssl);"
.IP "void \fBSSL_clear\fR(SSL *ssl);" 4
.IX Item "void SSL_clear(SSL *ssl);"
.IP "long \fBSSL_clear_num_renegotiations\fR(SSL *ssl);" 4
.IX Item "long SSL_clear_num_renegotiations(SSL *ssl);"
.IP "int \fBSSL_connect\fR(SSL *ssl);" 4
.IX Item "int SSL_connect(SSL *ssl);"
.IP "int \fBSSL_copy_session_id\fR(SSL *t, const SSL *f);" 4
.IX Item "int SSL_copy_session_id(SSL *t, const SSL *f);"
.PD
Sets the session details for \fBt\fR to be the same as in \fBf\fR. Returns 1 on
success or 0 on failure.
.IP "long \fBSSL_ctrl\fR(SSL *ssl, int cmd, long larg, char *parg);" 4
.IX Item "long SSL_ctrl(SSL *ssl, int cmd, long larg, char *parg);"
.PD 0
.IP "int \fBSSL_do_handshake\fR(SSL *ssl);" 4
.IX Item "int SSL_do_handshake(SSL *ssl);"
.IP "SSL *\fBSSL_dup\fR(SSL *ssl);" 4
.IX Item "SSL *SSL_dup(SSL *ssl);"
.PD
\&\fBSSL_dup()\fR allows applications to configure an SSL handle for use
in multiple SSL connections, and then duplicate it prior to initiating
each connection with the duplicated handle.
Use of \fBSSL_dup()\fR avoids the need to repeat the configuration of the
handles for each connection.
.Sp
For \fBSSL_dup()\fR to work, the connection MUST be in its initial state
and MUST NOT have not yet have started the SSL handshake.
For connections that are not in their initial state \fBSSL_dup()\fR just
increments an internal reference count and returns the \fIsame\fR
handle.
It may be possible to use \fBSSL_clear\fR\|(3) to recycle an SSL handle
that is not in its initial state for re-use, but this is best
avoided.
Instead, save and restore the session, if desired, and construct a
fresh handle for each connection.
.IP "STACK *\fBSSL_dup_CA_list\fR(STACK *sk);" 4
.IX Item "STACK *SSL_dup_CA_list(STACK *sk);"
.PD 0
.IP "void \fBSSL_free\fR(SSL *ssl);" 4
.IX Item "void SSL_free(SSL *ssl);"
.IP "SSL_CTX *\fBSSL_get_SSL_CTX\fR(const SSL *ssl);" 4
.IX Item "SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl);"
.IP "char *\fBSSL_get_app_data\fR(SSL *ssl);" 4
.IX Item "char *SSL_get_app_data(SSL *ssl);"
.IP "X509 *\fBSSL_get_certificate\fR(const SSL *ssl);" 4
.IX Item "X509 *SSL_get_certificate(const SSL *ssl);"
.IP "const char *\fBSSL_get_cipher\fR(const SSL *ssl);" 4
.IX Item "const char *SSL_get_cipher(const SSL *ssl);"
.IP "int \fBSSL_is_dtls\fR(const SSL *ssl);" 4
.IX Item "int SSL_is_dtls(const SSL *ssl);"
.IP "int \fBSSL_get_cipher_bits\fR(const SSL *ssl, int *alg_bits);" 4
.IX Item "int SSL_get_cipher_bits(const SSL *ssl, int *alg_bits);"
.IP "char *\fBSSL_get_cipher_list\fR(const SSL *ssl, int n);" 4
.IX Item "char *SSL_get_cipher_list(const SSL *ssl, int n);"
.IP "char *\fBSSL_get_cipher_name\fR(const SSL *ssl);" 4
.IX Item "char *SSL_get_cipher_name(const SSL *ssl);"
.IP "char *\fBSSL_get_cipher_version\fR(const SSL *ssl);" 4
.IX Item "char *SSL_get_cipher_version(const SSL *ssl);"
.IP "STACK *\fBSSL_get_ciphers\fR(const SSL *ssl);" 4
.IX Item "STACK *SSL_get_ciphers(const SSL *ssl);"
.IP "STACK *\fBSSL_get_client_CA_list\fR(const SSL *ssl);" 4
.IX Item "STACK *SSL_get_client_CA_list(const SSL *ssl);"
.IP "SSL_CIPHER *\fBSSL_get_current_cipher\fR(SSL *ssl);" 4
.IX Item "SSL_CIPHER *SSL_get_current_cipher(SSL *ssl);"
.IP "long \fBSSL_get_default_timeout\fR(const SSL *ssl);" 4
.IX Item "long SSL_get_default_timeout(const SSL *ssl);"
.IP "int \fBSSL_get_error\fR(const SSL *ssl, int i);" 4
.IX Item "int SSL_get_error(const SSL *ssl, int i);"
.IP "char *\fBSSL_get_ex_data\fR(const SSL *ssl, int idx);" 4
.IX Item "char *SSL_get_ex_data(const SSL *ssl, int idx);"
.IP "int \fBSSL_get_ex_data_X509_STORE_CTX_idx\fR(void);" 4
.IX Item "int SSL_get_ex_data_X509_STORE_CTX_idx(void);"
.IP "int \fBSSL_get_ex_new_index\fR(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))" 4
.IX Item "int SSL_get_ex_new_index(long argl, char *argp, int (*new_func);(void), int (*dup_func)(void), void (*free_func)(void))"
.IP "int \fBSSL_get_fd\fR(const SSL *ssl);" 4
.IX Item "int SSL_get_fd(const SSL *ssl);"
.IP "void (*\fBSSL_get_info_callback\fR(const SSL *ssl);)()" 4
.IX Item "void (*SSL_get_info_callback(const SSL *ssl);)()"
.IP "int \fBSSL_get_key_update_type\fR(SSL *s);" 4
.IX Item "int SSL_get_key_update_type(SSL *s);"
.IP "STACK *\fBSSL_get_peer_cert_chain\fR(const SSL *ssl);" 4
.IX Item "STACK *SSL_get_peer_cert_chain(const SSL *ssl);"
.IP "X509 *\fBSSL_get_peer_certificate\fR(const SSL *ssl);" 4
.IX Item "X509 *SSL_get_peer_certificate(const SSL *ssl);"
.IP "const STACK_OF(SCT) *\fBSSL_get0_peer_scts\fR(SSL *s);" 4
.IX Item "const STACK_OF(SCT) *SSL_get0_peer_scts(SSL *s);"
.IP "EVP_PKEY *\fBSSL_get_privatekey\fR(const SSL *ssl);" 4
.IX Item "EVP_PKEY *SSL_get_privatekey(const SSL *ssl);"
.IP "int \fBSSL_get_quiet_shutdown\fR(const SSL *ssl);" 4
.IX Item "int SSL_get_quiet_shutdown(const SSL *ssl);"
.IP "BIO *\fBSSL_get_rbio\fR(const SSL *ssl);" 4
.IX Item "BIO *SSL_get_rbio(const SSL *ssl);"
.IP "int \fBSSL_get_read_ahead\fR(const SSL *ssl);" 4
.IX Item "int SSL_get_read_ahead(const SSL *ssl);"
.IP "SSL_SESSION *\fBSSL_get_session\fR(const SSL *ssl);" 4
.IX Item "SSL_SESSION *SSL_get_session(const SSL *ssl);"
.IP "char *\fBSSL_get_shared_ciphers\fR(const SSL *ssl, char *buf, int size);" 4
.IX Item "char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int size);"
.IP "int \fBSSL_get_shutdown\fR(const SSL *ssl);" 4
.IX Item "int SSL_get_shutdown(const SSL *ssl);"
.IP "const SSL_METHOD *\fBSSL_get_ssl_method\fR(SSL *ssl);" 4
.IX Item "const SSL_METHOD *SSL_get_ssl_method(SSL *ssl);"
.IP "int \fBSSL_get_state\fR(const SSL *ssl);" 4
.IX Item "int SSL_get_state(const SSL *ssl);"
.IP "long \fBSSL_get_time\fR(const SSL *ssl);" 4
.IX Item "long SSL_get_time(const SSL *ssl);"
.IP "long \fBSSL_get_timeout\fR(const SSL *ssl);" 4
.IX Item "long SSL_get_timeout(const SSL *ssl);"
.IP "int (*\fBSSL_get_verify_callback\fR(const SSL *ssl))(int, X509_STORE_CTX *)" 4
.IX Item "int (*SSL_get_verify_callback(const SSL *ssl))(int, X509_STORE_CTX *)"
.IP "int \fBSSL_get_verify_mode\fR(const SSL *ssl);" 4
.IX Item "int SSL_get_verify_mode(const SSL *ssl);"
.IP "long \fBSSL_get_verify_result\fR(const SSL *ssl);" 4
.IX Item "long SSL_get_verify_result(const SSL *ssl);"
.IP "char *\fBSSL_get_version\fR(const SSL *ssl);" 4
.IX Item "char *SSL_get_version(const SSL *ssl);"
.IP "BIO *\fBSSL_get_wbio\fR(const SSL *ssl);" 4
.IX Item "BIO *SSL_get_wbio(const SSL *ssl);"
.IP "int \fBSSL_in_accept_init\fR(SSL *ssl);" 4
.IX Item "int SSL_in_accept_init(SSL *ssl);"
.IP "int \fBSSL_in_before\fR(SSL *ssl);" 4
.IX Item "int SSL_in_before(SSL *ssl);"
.IP "int \fBSSL_in_connect_init\fR(SSL *ssl);" 4
.IX Item "int SSL_in_connect_init(SSL *ssl);"
.IP "int \fBSSL_in_init\fR(SSL *ssl);" 4
.IX Item "int SSL_in_init(SSL *ssl);"
.IP "int \fBSSL_is_init_finished\fR(SSL *ssl);" 4
.IX Item "int SSL_is_init_finished(SSL *ssl);"
.IP "int \fBSSL_key_update\fR(SSL *s, int updatetype);" 4
.IX Item "int SSL_key_update(SSL *s, int updatetype);"
.IP "STACK *\fBSSL_load_client_CA_file\fR(const char *file);" 4
.IX Item "STACK *SSL_load_client_CA_file(const char *file);"
.IP "SSL *\fBSSL_new\fR(SSL_CTX *ctx);" 4
.IX Item "SSL *SSL_new(SSL_CTX *ctx);"
.IP "int SSL_up_ref(SSL *s);" 4
.IX Item "int SSL_up_ref(SSL *s);"
.IP "long \fBSSL_num_renegotiations\fR(SSL *ssl);" 4
.IX Item "long SSL_num_renegotiations(SSL *ssl);"
.IP "int \fBSSL_peek\fR(SSL *ssl, void *buf, int num);" 4
.IX Item "int SSL_peek(SSL *ssl, void *buf, int num);"
.IP "int \fBSSL_pending\fR(const SSL *ssl);" 4
.IX Item "int SSL_pending(const SSL *ssl);"
.IP "int \fBSSL_read\fR(SSL *ssl, void *buf, int num);" 4
.IX Item "int SSL_read(SSL *ssl, void *buf, int num);"
.IP "int \fBSSL_renegotiate\fR(SSL *ssl);" 4
.IX Item "int SSL_renegotiate(SSL *ssl);"
.IP "char *\fBSSL_rstate_string\fR(SSL *ssl);" 4
.IX Item "char *SSL_rstate_string(SSL *ssl);"
.IP "char *\fBSSL_rstate_string_long\fR(SSL *ssl);" 4
.IX Item "char *SSL_rstate_string_long(SSL *ssl);"
.IP "long \fBSSL_session_reused\fR(SSL *ssl);" 4
.IX Item "long SSL_session_reused(SSL *ssl);"
.IP "void \fBSSL_set_accept_state\fR(SSL *ssl);" 4
.IX Item "void SSL_set_accept_state(SSL *ssl);"
.IP "void \fBSSL_set_app_data\fR(SSL *ssl, char *arg);" 4
.IX Item "void SSL_set_app_data(SSL *ssl, char *arg);"
.IP "void \fBSSL_set_bio\fR(SSL *ssl, BIO *rbio, BIO *wbio);" 4
.IX Item "void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio);"
.IP "int \fBSSL_set_cipher_list\fR(SSL *ssl, char *str);" 4
.IX Item "int SSL_set_cipher_list(SSL *ssl, char *str);"
.IP "void \fBSSL_set_client_CA_list\fR(SSL *ssl, STACK *list);" 4
.IX Item "void SSL_set_client_CA_list(SSL *ssl, STACK *list);"
.IP "void \fBSSL_set_connect_state\fR(SSL *ssl);" 4
.IX Item "void SSL_set_connect_state(SSL *ssl);"
.IP "int \fBSSL_set_ct_validation_callback\fR(SSL *ssl, ssl_ct_validation_cb callback, void *arg);" 4
.IX Item "int SSL_set_ct_validation_callback(SSL *ssl, ssl_ct_validation_cb callback, void *arg);"
.IP "int \fBSSL_set_ex_data\fR(SSL *ssl, int idx, char *arg);" 4
.IX Item "int SSL_set_ex_data(SSL *ssl, int idx, char *arg);"
.IP "int \fBSSL_set_fd\fR(SSL *ssl, int fd);" 4
.IX Item "int SSL_set_fd(SSL *ssl, int fd);"
.IP "void \fBSSL_set_info_callback\fR(SSL *ssl, void (*cb);(void))" 4
.IX Item "void SSL_set_info_callback(SSL *ssl, void (*cb);(void))"
.IP "void \fBSSL_set_msg_callback\fR(SSL *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));" 4
.IX Item "void SSL_set_msg_callback(SSL *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));"
.IP "void \fBSSL_set_msg_callback_arg\fR(SSL *ctx, void *arg);" 4
.IX Item "void SSL_set_msg_callback_arg(SSL *ctx, void *arg);"
.IP "unsigned long \fBSSL_clear_options\fR(SSL *ssl, unsigned long op);" 4
.IX Item "unsigned long SSL_clear_options(SSL *ssl, unsigned long op);"
.IP "unsigned long \fBSSL_get_options\fR(SSL *ssl);" 4
.IX Item "unsigned long SSL_get_options(SSL *ssl);"
.IP "unsigned long \fBSSL_set_options\fR(SSL *ssl, unsigned long op);" 4
.IX Item "unsigned long SSL_set_options(SSL *ssl, unsigned long op);"
.IP "void \fBSSL_set_quiet_shutdown\fR(SSL *ssl, int mode);" 4
.IX Item "void SSL_set_quiet_shutdown(SSL *ssl, int mode);"
.IP "void \fBSSL_set_read_ahead\fR(SSL *ssl, int yes);" 4
.IX Item "void SSL_set_read_ahead(SSL *ssl, int yes);"
.IP "int \fBSSL_set_rfd\fR(SSL *ssl, int fd);" 4
.IX Item "int SSL_set_rfd(SSL *ssl, int fd);"
.IP "int \fBSSL_set_session\fR(SSL *ssl, SSL_SESSION *session);" 4
.IX Item "int SSL_set_session(SSL *ssl, SSL_SESSION *session);"
.IP "void \fBSSL_set_shutdown\fR(SSL *ssl, int mode);" 4
.IX Item "void SSL_set_shutdown(SSL *ssl, int mode);"
.IP "int \fBSSL_set_ssl_method\fR(SSL *ssl, const SSL_METHOD *meth);" 4
.IX Item "int SSL_set_ssl_method(SSL *ssl, const SSL_METHOD *meth);"
.IP "void \fBSSL_set_time\fR(SSL *ssl, long t);" 4
.IX Item "void SSL_set_time(SSL *ssl, long t);"
.IP "void \fBSSL_set_timeout\fR(SSL *ssl, long t);" 4
.IX Item "void SSL_set_timeout(SSL *ssl, long t);"
.IP "void \fBSSL_set_verify\fR(SSL *ssl, int mode, int (*callback);(void))" 4
.IX Item "void SSL_set_verify(SSL *ssl, int mode, int (*callback);(void))"
.IP "void \fBSSL_set_verify_result\fR(SSL *ssl, long arg);" 4
.IX Item "void SSL_set_verify_result(SSL *ssl, long arg);"
.IP "int \fBSSL_set_wfd\fR(SSL *ssl, int fd);" 4
.IX Item "int SSL_set_wfd(SSL *ssl, int fd);"
.IP "int \fBSSL_shutdown\fR(SSL *ssl);" 4
.IX Item "int SSL_shutdown(SSL *ssl);"
.IP "OSSL_HANDSHAKE_STATE \fBSSL_get_state\fR(const SSL *ssl);" 4
.IX Item "OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl);"
.PD
Returns the current handshake state.
.IP "char *\fBSSL_state_string\fR(const SSL *ssl);" 4
.IX Item "char *SSL_state_string(const SSL *ssl);"
.PD 0
.IP "char *\fBSSL_state_string_long\fR(const SSL *ssl);" 4
.IX Item "char *SSL_state_string_long(const SSL *ssl);"
.IP "long \fBSSL_total_renegotiations\fR(SSL *ssl);" 4
.IX Item "long SSL_total_renegotiations(SSL *ssl);"
.IP "int \fBSSL_use_PrivateKey\fR(SSL *ssl, EVP_PKEY *pkey);" 4
.IX Item "int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);"
.IP "int \fBSSL_use_PrivateKey_ASN1\fR(int type, SSL *ssl, unsigned char *d, long len);" 4
.IX Item "int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, unsigned char *d, long len);"
.IP "int \fBSSL_use_PrivateKey_file\fR(SSL *ssl, const char *file, int type);" 4
.IX Item "int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);"
.IP "int \fBSSL_use_RSAPrivateKey\fR(SSL *ssl, RSA *rsa);" 4
.IX Item "int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);"
.IP "int \fBSSL_use_RSAPrivateKey_ASN1\fR(SSL *ssl, unsigned char *d, long len);" 4
.IX Item "int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);"
.IP "int \fBSSL_use_RSAPrivateKey_file\fR(SSL *ssl, const char *file, int type);" 4
.IX Item "int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);"
.IP "int \fBSSL_use_certificate\fR(SSL *ssl, X509 *x);" 4
.IX Item "int SSL_use_certificate(SSL *ssl, X509 *x);"
.IP "int \fBSSL_use_certificate_ASN1\fR(SSL *ssl, int len, unsigned char *d);" 4
.IX Item "int SSL_use_certificate_ASN1(SSL *ssl, int len, unsigned char *d);"
.IP "int \fBSSL_use_certificate_file\fR(SSL *ssl, const char *file, int type);" 4
.IX Item "int SSL_use_certificate_file(SSL *ssl, const char *file, int type);"
.IP "int \fBSSL_use_cert_and_key\fR(SSL *ssl, X509 *x, EVP_PKEY *pkey, STACK_OF(X509) *chain, int override);" 4
.IX Item "int SSL_use_cert_and_key(SSL *ssl, X509 *x, EVP_PKEY *pkey, STACK_OF(X509) *chain, int override);"
.IP "int \fBSSL_version\fR(const SSL *ssl);" 4
.IX Item "int SSL_version(const SSL *ssl);"
.IP "int \fBSSL_want\fR(const SSL *ssl);" 4
.IX Item "int SSL_want(const SSL *ssl);"
.IP "int \fBSSL_want_nothing\fR(const SSL *ssl);" 4
.IX Item "int SSL_want_nothing(const SSL *ssl);"
.IP "int \fBSSL_want_read\fR(const SSL *ssl);" 4
.IX Item "int SSL_want_read(const SSL *ssl);"
.IP "int \fBSSL_want_write\fR(const SSL *ssl);" 4
.IX Item "int SSL_want_write(const SSL *ssl);"
.IP "int \fBSSL_want_x509_lookup\fR(const SSL *ssl);" 4
.IX Item "int SSL_want_x509_lookup(const SSL *ssl);"
.IP "int \fBSSL_write\fR(SSL *ssl, const void *buf, int num);" 4
.IX Item "int SSL_write(SSL *ssl, const void *buf, int num);"
.IP "void \fBSSL_set_psk_client_callback\fR(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len));" 4
.IX Item "void SSL_set_psk_client_callback(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len));"
.IP "int \fBSSL_use_psk_identity_hint\fR(SSL *ssl, const char *hint);" 4
.IX Item "int SSL_use_psk_identity_hint(SSL *ssl, const char *hint);"
.IP "void \fBSSL_set_psk_server_callback\fR(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));" 4
.IX Item "void SSL_set_psk_server_callback(SSL *ssl, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len));"
.IP "const char *\fBSSL_get_psk_identity_hint\fR(SSL *ssl);" 4
.IX Item "const char *SSL_get_psk_identity_hint(SSL *ssl);"
.IP "const char *\fBSSL_get_psk_identity\fR(SSL *ssl);" 4
.IX Item "const char *SSL_get_psk_identity(SSL *ssl);"
.PD
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
See the individual manual pages for details.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBopenssl\fR\|(1), \fBcrypto\fR\|(7),
\&\fBCRYPTO_get_ex_new_index\fR\|(3),
\&\fBSSL_accept\fR\|(3), \fBSSL_clear\fR\|(3),
\&\fBSSL_connect\fR\|(3),
\&\fBSSL_CIPHER_get_name\fR\|(3),
\&\fBSSL_COMP_add_compression_method\fR\|(3),
\&\fBSSL_CTX_add_extra_chain_cert\fR\|(3),
\&\fBSSL_CTX_add_session\fR\|(3),
\&\fBSSL_CTX_ctrl\fR\|(3),
\&\fBSSL_CTX_flush_sessions\fR\|(3),
\&\fBSSL_CTX_get_verify_mode\fR\|(3),
\&\fBSSL_CTX_load_verify_locations\fR\|(3)
\&\fBSSL_CTX_new\fR\|(3),
\&\fBSSL_CTX_sess_number\fR\|(3),
\&\fBSSL_CTX_sess_set_cache_size\fR\|(3),
\&\fBSSL_CTX_sess_set_get_cb\fR\|(3),
\&\fBSSL_CTX_sessions\fR\|(3),
\&\fBSSL_CTX_set_cert_store\fR\|(3),
\&\fBSSL_CTX_set_cert_verify_callback\fR\|(3),
\&\fBSSL_CTX_set_cipher_list\fR\|(3),
\&\fBSSL_CTX_set_client_CA_list\fR\|(3),
\&\fBSSL_CTX_set_client_cert_cb\fR\|(3),
\&\fBSSL_CTX_set_default_passwd_cb\fR\|(3),
\&\fBSSL_CTX_set_generate_session_id\fR\|(3),
\&\fBSSL_CTX_set_info_callback\fR\|(3),
\&\fBSSL_CTX_set_max_cert_list\fR\|(3),
\&\fBSSL_CTX_set_mode\fR\|(3),
\&\fBSSL_CTX_set_msg_callback\fR\|(3),
\&\fBSSL_CTX_set_options\fR\|(3),
\&\fBSSL_CTX_set_quiet_shutdown\fR\|(3),
\&\fBSSL_CTX_set_read_ahead\fR\|(3),
\&\fBSSL_CTX_set_security_level\fR\|(3),
\&\fBSSL_CTX_set_session_cache_mode\fR\|(3),
\&\fBSSL_CTX_set_session_id_context\fR\|(3),
\&\fBSSL_CTX_set_ssl_version\fR\|(3),
\&\fBSSL_CTX_set_timeout\fR\|(3),
\&\fBSSL_CTX_set_tmp_dh_callback\fR\|(3),
\&\fBSSL_CTX_set_verify\fR\|(3),
\&\fBSSL_CTX_use_certificate\fR\|(3),
\&\fBSSL_alert_type_string\fR\|(3),
\&\fBSSL_do_handshake\fR\|(3),
\&\fBSSL_enable_ct\fR\|(3),
\&\fBSSL_get_SSL_CTX\fR\|(3),
\&\fBSSL_get_ciphers\fR\|(3),
\&\fBSSL_get_client_CA_list\fR\|(3),
\&\fBSSL_get_default_timeout\fR\|(3),
\&\fBSSL_get_error\fR\|(3),
\&\fBSSL_get_ex_data_X509_STORE_CTX_idx\fR\|(3),
\&\fBSSL_get_fd\fR\|(3),
\&\fBSSL_get_peer_cert_chain\fR\|(3),
\&\fBSSL_get_rbio\fR\|(3),
\&\fBSSL_get_session\fR\|(3),
\&\fBSSL_get_verify_result\fR\|(3),
\&\fBSSL_get_version\fR\|(3),
\&\fBSSL_load_client_CA_file\fR\|(3),
\&\fBSSL_new\fR\|(3),
\&\fBSSL_pending\fR\|(3),
\&\fBSSL_read_ex\fR\|(3),
\&\fBSSL_read\fR\|(3),
\&\fBSSL_rstate_string\fR\|(3),
\&\fBSSL_session_reused\fR\|(3),
\&\fBSSL_set_bio\fR\|(3),
\&\fBSSL_set_connect_state\fR\|(3),
\&\fBSSL_set_fd\fR\|(3),
\&\fBSSL_set_session\fR\|(3),
\&\fBSSL_set_shutdown\fR\|(3),
\&\fBSSL_shutdown\fR\|(3),
\&\fBSSL_state_string\fR\|(3),
\&\fBSSL_want\fR\|(3),
\&\fBSSL_write_ex\fR\|(3),
\&\fBSSL_write\fR\|(3),
\&\fBSSL_SESSION_free\fR\|(3),
\&\fBSSL_SESSION_get_time\fR\|(3),
\&\fBd2i_SSL_SESSION\fR\|(3),
\&\fBSSL_CTX_set_psk_client_callback\fR\|(3),
\&\fBSSL_CTX_use_psk_identity_hint\fR\|(3),
\&\fBSSL_get_psk_identity\fR\|(3),
\&\fBDTLSv1_listen\fR\|(3)
.SH HISTORY
.IX Header "HISTORY"
\&\fBSSLv2_client_method\fR, \fBSSLv2_server_method\fR and \fBSSLv2_method\fR were removed
in OpenSSL 1.1.0.
.PP
The return type of \fBSSL_copy_session_id\fR was changed from void to int in
OpenSSL 1.1.0.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�T�QQ Q man/man7/SM2.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "SM2 7"
.TH SM2 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
SM2 \- Chinese SM2 signature and encryption algorithm support
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBSM2\fR algorithm was first defined by the Chinese national standard GM/T
0003\-2012 and was later standardized by ISO as ISO/IEC 14888. \fBSM2\fR is actually
an elliptic curve based algorithm. The current implementation in OpenSSL supports
both signature and encryption schemes via the EVP interface.
.PP
When doing the \fBSM2\fR signature algorithm, it requires a distinguishing identifier
to form the message prefix which is hashed before the real message is hashed.
.SH NOTES
.IX Header "NOTES"
\&\fBSM2\fR signatures can be generated by using the 'DigestSign' series of APIs, for
instance, \fBEVP_DigestSignInit()\fR, \fBEVP_DigestSignUpdate()\fR and \fBEVP_DigestSignFinal()\fR.
Ditto for the verification process by calling the 'DigestVerify' series of APIs.
.PP
There are several special steps that need to be done before computing an \fBSM2\fR
signature.
.PP
The \fBEVP_PKEY\fR structure will default to using ECDSA for signatures when it is
created. It should be set to \fBEVP_PKEY_SM2\fR by calling:
.PP
.Vb 1
\& EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2);
.Ve
.PP
Then an ID should be set by calling:
.PP
.Vb 1
\& EVP_PKEY_CTX_set1_id(pctx, id, id_len);
.Ve
.PP
When calling the \fBEVP_DigestSignInit()\fR or \fBEVP_DigestVerifyInit()\fR functions, a
preallocated \fBEVP_PKEY_CTX\fR should be assigned to the \fBEVP_MD_CTX\fR. This is
done by calling:
.PP
.Vb 1
\& EVP_MD_CTX_set_pkey_ctx(mctx, pctx);
.Ve
.PP
And normally there is no need to pass a \fBpctx\fR parameter to \fBEVP_DigestSignInit()\fR
or \fBEVP_DigestVerifyInit()\fR in such a scenario.
.SH EXAMPLES
.IX Header "EXAMPLES"
This example demonstrates the calling sequence for using an \fBEVP_PKEY\fR to verify
a message with the SM2 signature algorithm and the SM3 hash algorithm:
.PP
.Vb 1
\& #include <openssl/evp.h>
\&
\& /* obtain an EVP_PKEY using whatever methods... */
\& EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2);
\& mctx = EVP_MD_CTX_new();
\& pctx = EVP_PKEY_CTX_new(pkey, NULL);
\& EVP_PKEY_CTX_set1_id(pctx, id, id_len);
\& EVP_MD_CTX_set_pkey_ctx(mctx, pctx);;
\& EVP_DigestVerifyInit(mctx, NULL, EVP_sm3(), NULL, pkey);
\& EVP_DigestVerifyUpdate(mctx, msg, msg_len);
\& EVP_DigestVerifyFinal(mctx, sig, sig_len)
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBEVP_PKEY_CTX_new\fR\|(3),
\&\fBEVP_PKEY_set_alias_type\fR\|(3),
\&\fBEVP_DigestSignInit\fR\|(3),
\&\fBEVP_DigestVerifyInit\fR\|(3),
\&\fBEVP_PKEY_CTX_set1_id\fR\|(3),
\&\fBEVP_MD_CTX_set_pkey_ctx\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2018\-2020 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]��v�8 �8 man/man7/RAND_DRBG.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "RAND_DRBG 7"
.TH RAND_DRBG 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
RAND_DRBG \- the deterministic random bit generator
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\& #include <openssl/rand_drbg.h>
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The default OpenSSL RAND method is based on the RAND_DRBG class,
which implements a deterministic random bit generator (DRBG).
A DRBG is a certain type of cryptographically-secure pseudo-random
number generator (CSPRNG), which is described in
[NIST SP 800\-90A Rev. 1].
.PP
While the RAND API is the 'frontend' which is intended to be used by
application developers for obtaining random bytes, the RAND_DRBG API
serves as the 'backend', connecting the former with the operating
systems's entropy sources and providing access to the DRBG's
configuration parameters.
.SS Disclaimer
.IX Subsection "Disclaimer"
Unless you have very specific requirements for your random generator,
it is in general not necessary to utilize the RAND_DRBG API directly.
The usual way to obtain random bytes is to use \fBRAND_bytes\fR\|(3) or
\&\fBRAND_priv_bytes\fR\|(3), see also \fBRAND\fR\|(7).
.SS "Typical Use Cases"
.IX Subsection "Typical Use Cases"
Typical examples for such special use cases are the following:
.IP \(bu 2
You want to use your own private DRBG instances.
Multiple DRBG instances which are accessed only by a single thread provide
additional security (because their internal states are independent) and
better scalability in multithreaded applications (because they don't need
to be locked).
.IP \(bu 2
You need to integrate a previously unsupported entropy source.
.IP \(bu 2
You need to change the default settings of the standard OpenSSL RAND
implementation to meet specific requirements.
.SH CHAINING
.IX Header "CHAINING"
A DRBG instance can be used as the entropy source of another DRBG instance,
provided it has itself access to a valid entropy source.
The DRBG instance which acts as entropy source is called the \fIparent\fR DRBG,
the other instance the \fIchild\fR DRBG.
.PP
This is called chaining. A chained DRBG instance is created by passing
a pointer to the parent DRBG as argument to the \fBRAND_DRBG_new()\fR call.
It is possible to create chains of more than two DRBG in a row.
.SH "THE THREE SHARED DRBG INSTANCES"
.IX Header "THE THREE SHARED DRBG INSTANCES"
Currently, there are three shared DRBG instances,
the <master>, <public>, and <private> DRBG.
While the <master> DRBG is a single global instance, the <public> and <private>
DRBG are created per thread and accessed through thread-local storage.
.PP
By default, the functions \fBRAND_bytes\fR\|(3) and \fBRAND_priv_bytes\fR\|(3) use
the thread-local <public> and <private> DRBG instance, respectively.
.SS "The <master> DRBG instance"
.IX Subsection "The <master> DRBG instance"
The <master> DRBG is not used directly by the application, only for reseeding
the two other two DRBG instances. It reseeds itself by obtaining randomness
either from os entropy sources or by consuming randomness which was added
previously by \fBRAND_add\fR\|(3).
.SS "The <public> DRBG instance"
.IX Subsection "The <public> DRBG instance"
This instance is used per default by \fBRAND_bytes\fR\|(3).
.SS "The <private> DRBG instance"
.IX Subsection "The <private> DRBG instance"
This instance is used per default by \fBRAND_priv_bytes\fR\|(3)
.SH LOCKING
.IX Header "LOCKING"
The <master> DRBG is intended to be accessed concurrently for reseeding
by its child DRBG instances. The necessary locking is done internally.
It is \fInot\fR thread-safe to access the <master> DRBG directly via the
RAND_DRBG interface.
The <public> and <private> DRBG are thread-local, i.e. there is an
instance of each per thread. So they can safely be accessed without
locking via the RAND_DRBG interface.
.PP
Pointers to these DRBG instances can be obtained using
\&\fBRAND_DRBG_get0_master()\fR,
\&\fBRAND_DRBG_get0_public()\fR, and
\&\fBRAND_DRBG_get0_private()\fR, respectively.
Note that it is not allowed to store a pointer to one of the thread-local
DRBG instances in a variable or other memory location where it will be
accessed and used by multiple threads.
.PP
All other DRBG instances created by an application don't support locking,
because they are intended to be used by a single thread.
Instead of accessing a single DRBG instance concurrently from different
threads, it is recommended to instantiate a separate DRBG instance per
thread. Using the <master> DRBG as entropy source for multiple DRBG
instances on different threads is thread-safe, because the DRBG instance
will lock the <master> DRBG automatically for obtaining random input.
.SH "THE OVERALL PICTURE"
.IX Header "THE OVERALL PICTURE"
The following picture gives an overview over how the DRBG instances work
together and are being used.
.PP
.Vb 10
\& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
\& | os entropy sources |
\& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
\& |
\& v +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
\& RAND_add() ==> <master> <\-| shared DRBG (with locking) |
\& / \e +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
\& / \e +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
\& <public> <private> <\- | per\-thread DRBG instances |
\& | | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
\& v v
\& RAND_bytes() RAND_priv_bytes()
\& | ^
\& | |
\& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
\& | general purpose | | used for secrets like session keys |
\& | random generator | | and private keys for certificates |
\& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
.Ve
.PP
The usual way to obtain random bytes is to call RAND_bytes(...) or
RAND_priv_bytes(...). These calls are roughly equivalent to calling
RAND_DRBG_bytes(<public>, ...) and RAND_DRBG_bytes(<private>, ...),
respectively. The method \fBRAND_DRBG_bytes\fR\|(3) is a convenience method
wrapping the \fBRAND_DRBG_generate\fR\|(3) function, which serves the actual
request for random data.
.SH RESEEDING
.IX Header "RESEEDING"
A DRBG instance seeds itself automatically, pulling random input from
its entropy source. The entropy source can be either a trusted operating
system entropy source, or another DRBG with access to such a source.
.PP
Automatic reseeding occurs after a predefined number of generate requests.
The selection of the trusted entropy sources is configured at build
time using the \-\-with\-rand\-seed option. The following sections explain
the reseeding process in more detail.
.SS "Automatic Reseeding"
.IX Subsection "Automatic Reseeding"
Before satisfying a generate request (\fBRAND_DRBG_generate\fR\|(3)), the DRBG
reseeds itself automatically, if one of the following conditions holds:
.PP
\&\- the DRBG was not instantiated (=seeded) yet or has been uninstantiated.
.PP
\&\- the number of generate requests since the last reseeding exceeds a
certain threshold, the so called \fIreseed_interval\fR.
This behaviour can be disabled by setting the \fIreseed_interval\fR to 0.
.PP
\&\- the time elapsed since the last reseeding exceeds a certain time
interval, the so called \fIreseed_time_interval\fR.
This can be disabled by setting the \fIreseed_time_interval\fR to 0.
.PP
\&\- the DRBG is in an error state.
.PP
\&\fBNote\fR: An error state is entered if the entropy source fails while
the DRBG is seeding or reseeding.
The last case ensures that the DRBG automatically recovers
from the error as soon as the entropy source is available again.
.SS "Manual Reseeding"
.IX Subsection "Manual Reseeding"
In addition to automatic reseeding, the caller can request an immediate
reseeding of the DRBG with fresh entropy by setting the
\&\fIprediction resistance\fR parameter to 1 when calling \fBRAND_DRBG_generate\fR\|(3).
.PP
The document [NIST SP 800\-90C] describes prediction resistance requests
in detail and imposes strict conditions on the entropy sources that are
approved for providing prediction resistance.
Since the default DRBG implementation does not have access to such an approved
entropy source, a request for prediction resistance will currently always fail.
In other words, prediction resistance is currently not supported yet by the DRBG.
.PP
For the three shared DRBGs (and only for these) there is another way to
reseed them manually:
If \fBRAND_add\fR\|(3) is called with a positive \fIrandomness\fR argument
(or \fBRAND_seed\fR\|(3)), then this will immediately reseed the <master> DRBG.
The <public> and <private> DRBG will detect this on their next generate
call and reseed, pulling randomness from <master>.
.PP
The last feature has been added to support the common practice used with
previous OpenSSL versions to call \fBRAND_add()\fR before calling \fBRAND_bytes()\fR.
.SS "Entropy Input vs. Additional Data"
.IX Subsection "Entropy Input vs. Additional Data"
The DRBG distinguishes two different types of random input: \fIentropy\fR,
which comes from a trusted source, and \fIadditional input\fR',
which can optionally be added by the user and is considered untrusted.
It is possible to add \fIadditional input\fR not only during reseeding,
but also for every generate request.
This is in fact done automatically by \fBRAND_DRBG_bytes\fR\|(3).
.SS "Configuring the Random Seed Source"
.IX Subsection "Configuring the Random Seed Source"
In most cases OpenSSL will automatically choose a suitable seed source
for automatically seeding and reseeding its <master> DRBG. In some cases
however, it will be necessary to explicitly specify a seed source during
configuration, using the \-\-with\-rand\-seed option. For more information,
see the INSTALL instructions. There are also operating systems where no
seed source is available and automatic reseeding is disabled by default.
.PP
The following two sections describe the reseeding process of the master
DRBG, depending on whether automatic reseeding is available or not.
.SS "Reseeding the master DRBG with automatic seeding enabled"
.IX Subsection "Reseeding the master DRBG with automatic seeding enabled"
Calling \fBRAND_poll()\fR or \fBRAND_add()\fR is not necessary, because the DRBG
pulls the necessary entropy from its source automatically.
However, both calls are permitted, and do reseed the RNG.
.PP
\&\fBRAND_add()\fR can be used to add both kinds of random input, depending on the
value of the \fBrandomness\fR argument:
.IP "randomness == 0:" 4
.IX Item "randomness == 0:"
The random bytes are mixed as additional input into the current state of
the DRBG.
Mixing in additional input is not considered a full reseeding, hence the
reseed counter is not reset.
.IP "randomness > 0:" 4
.IX Item "randomness > 0:"
The random bytes are used as entropy input for a full reseeding
(resp. reinstantiation) if the DRBG is instantiated
(resp. uninstantiated or in an error state).
The number of random bits required for reseeding is determined by the
security strength of the DRBG. Currently it defaults to 256 bits (32 bytes).
It is possible to provide less randomness than required.
In this case the missing randomness will be obtained by pulling random input
from the trusted entropy sources.
.SS "Reseeding the master DRBG with automatic seeding disabled"
.IX Subsection "Reseeding the master DRBG with automatic seeding disabled"
Calling \fBRAND_poll()\fR will always fail.
.PP
\&\fBRAND_add()\fR needs to be called for initial seeding and periodic reseeding.
At least 48 bytes (384 bits) of randomness have to be provided, otherwise
the (re\-)seeding of the DRBG will fail. This corresponds to one and a half
times the security strength of the DRBG. The extra half is used for the
nonce during instantiation.
.PP
More precisely, the number of bytes needed for seeding depend on the
\&\fIsecurity strength\fR of the DRBG, which is set to 256 by default.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBRAND_DRBG_bytes\fR\|(3),
\&\fBRAND_DRBG_generate\fR\|(3),
\&\fBRAND_DRBG_reseed\fR\|(3),
\&\fBRAND_DRBG_get0_master\fR\|(3),
\&\fBRAND_DRBG_get0_public\fR\|(3),
\&\fBRAND_DRBG_get0_private\fR\|(3),
\&\fBRAND_DRBG_set_reseed_interval\fR\|(3),
\&\fBRAND_DRBG_set_reseed_time_interval\fR\|(3),
\&\fBRAND_DRBG_set_reseed_defaults\fR\|(3),
\&\fBRAND\fR\|(7),
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2017\-2018 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]���|
man/man7/ct.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "CT 7"
.TH CT 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
ct \- Certificate Transparency
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\& #include <openssl/ct.h>
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
This library implements Certificate Transparency (CT) verification for TLS
clients, as defined in RFC 6962. This verification can provide some confidence
that a certificate has been publicly logged in a set of CT logs.
.PP
By default, these checks are disabled. They can be enabled using
\&\fBSSL_CTX_enable_ct\fR\|(3) or \fBSSL_enable_ct\fR\|(3).
.PP
This library can also be used to parse and examine CT data structures, such as
Signed Certificate Timestamps (SCTs), or to read a list of CT logs. There are
functions for:
\&\- decoding and encoding SCTs in DER and TLS wire format.
\&\- printing SCTs.
\&\- verifying the authenticity of SCTs.
\&\- loading a CT log list from a CONF file.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBd2i_SCT_LIST\fR\|(3),
\&\fBCTLOG_STORE_new\fR\|(3),
\&\fBCTLOG_STORE_get0_log_by_id\fR\|(3),
\&\fBSCT_new\fR\|(3),
\&\fBSCT_print\fR\|(3),
\&\fBSCT_validate\fR\|(3),
\&\fBSCT_validate\fR\|(3),
\&\fBCT_POLICY_EVAL_CTX_new\fR\|(3),
\&\fBSSL_CTX_set_ct_validation_callback\fR\|(3)
.SH HISTORY
.IX Header "HISTORY"
The ct library was added in OpenSSL 1.1.0.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2016\-2017 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]k`��
�
man/man7/crypto.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "CRYPTO 7"
.TH CRYPTO 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
crypto \- OpenSSL cryptographic library
.SH SYNOPSIS
.IX Header "SYNOPSIS"
See the individual manual pages for details.
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The OpenSSL \fBcrypto\fR library implements a wide range of cryptographic
algorithms used in various Internet standards. The services provided
by this library are used by the OpenSSL implementations of SSL, TLS
and S/MIME, and they have also been used to implement SSH, OpenPGP, and
other cryptographic standards.
.PP
\&\fBlibcrypto\fR consists of a number of sub-libraries that implement the
individual algorithms.
.PP
The functionality includes symmetric encryption, public key
cryptography and key agreement, certificate handling, cryptographic
hash functions, cryptographic pseudo-random number generator, and
various utilities.
.SH NOTES
.IX Header "NOTES"
Some of the newer functions follow a naming convention using the numbers
\&\fB0\fR and \fB1\fR. For example the functions:
.PP
.Vb 2
\& int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
\& int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
.Ve
.PP
The \fB0\fR version uses the supplied structure pointer directly
in the parent and it will be freed up when the parent is freed.
In the above example \fBcrl\fR would be freed but \fBrev\fR would not.
.PP
The \fB1\fR function uses a copy of the supplied structure pointer
(or in some cases increases its link count) in the parent and
so both (\fBx\fR and \fBobj\fR above) should be freed up.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
See the individual manual pages for details.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBopenssl\fR\|(1), \fBssl\fR\|(7)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�m*�� � man/man7/bio.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "BIO 7"
.TH BIO 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
bio \- Basic I/O abstraction
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\& #include <openssl/bio.h>
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
A BIO is an I/O abstraction, it hides many of the underlying I/O
details from an application. If an application uses a BIO for its
I/O it can transparently handle SSL connections, unencrypted network
connections and file I/O.
.PP
There are two type of BIO, a source/sink BIO and a filter BIO.
.PP
As its name implies a source/sink BIO is a source and/or sink of data,
examples include a socket BIO and a file BIO.
.PP
A filter BIO takes data from one BIO and passes it through to
another, or the application. The data may be left unmodified (for
example a message digest BIO) or translated (for example an
encryption BIO). The effect of a filter BIO may change according
to the I/O operation it is performing: for example an encryption
BIO will encrypt data if it is being written to and decrypt data
if it is being read from.
.PP
BIOs can be joined together to form a chain (a single BIO is a chain
with one component). A chain normally consist of one source/sink
BIO and one or more filter BIOs. Data read from or written to the
first BIO then traverses the chain to the end (normally a source/sink
BIO).
.PP
Some BIOs (such as memory BIOs) can be used immediately after calling
\&\fBBIO_new()\fR. Others (such as file BIOs) need some additional initialization,
and frequently a utility function exists to create and initialize such BIOs.
.PP
If \fBBIO_free()\fR is called on a BIO chain it will only free one BIO resulting
in a memory leak.
.PP
Calling \fBBIO_free_all()\fR on a single BIO has the same effect as calling
\&\fBBIO_free()\fR on it other than the discarded return value.
.PP
Normally the \fBtype\fR argument is supplied by a function which returns a
pointer to a BIO_METHOD. There is a naming convention for such functions:
a source/sink BIO is normally called BIO_s_*() and a filter BIO
BIO_f_*();
.SH EXAMPLES
.IX Header "EXAMPLES"
Create a memory BIO:
.PP
.Vb 1
\& BIO *mem = BIO_new(BIO_s_mem());
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBBIO_ctrl\fR\|(3),
\&\fBBIO_f_base64\fR\|(3), \fBBIO_f_buffer\fR\|(3),
\&\fBBIO_f_cipher\fR\|(3), \fBBIO_f_md\fR\|(3),
\&\fBBIO_f_null\fR\|(3), \fBBIO_f_ssl\fR\|(3),
\&\fBBIO_find_type\fR\|(3), \fBBIO_new\fR\|(3),
\&\fBBIO_new_bio_pair\fR\|(3),
\&\fBBIO_push\fR\|(3), \fBBIO_read_ex\fR\|(3),
\&\fBBIO_s_accept\fR\|(3), \fBBIO_s_bio\fR\|(3),
\&\fBBIO_s_connect\fR\|(3), \fBBIO_s_fd\fR\|(3),
\&\fBBIO_s_file\fR\|(3), \fBBIO_s_mem\fR\|(3),
\&\fBBIO_s_null\fR\|(3), \fBBIO_s_socket\fR\|(3),
\&\fBBIO_set_callback\fR\|(3),
\&\fBBIO_should_retry\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2019 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]V�c3` ` man/man7/scrypt.7nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "SCRYPT 7"
.TH SCRYPT 7 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
scrypt \- EVP_PKEY scrypt KDF support
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The EVP_PKEY_SCRYPT algorithm implements the scrypt password based key
derivation function, as described in RFC 7914. It is memory-hard in the sense
that it deliberately requires a significant amount of RAM for efficient
computation. The intention of this is to render brute forcing of passwords on
systems that lack large amounts of main memory (such as GPUs or ASICs)
computationally infeasible.
.PP
scrypt provides three work factors that can be customized: N, r and p. N, which
has to be a positive power of two, is the general work factor and scales CPU
time in an approximately linear fashion. r is the block size of the internally
used hash function and p is the parallelization factor. Both r and p need to be
greater than zero. The amount of RAM that scrypt requires for its computation
is roughly (128 * N * r * p) bytes.
.PP
In the original paper of Colin Percival ("Stronger Key Derivation via
Sequential Memory-Hard Functions", 2009), the suggested values that give a
computation time of less than 5 seconds on a 2.5 GHz Intel Core 2 Duo are N =
2^20 = 1048576, r = 8, p = 1. Consequently, the required amount of memory for
this computation is roughly 1 GiB. On a more recent CPU (Intel i7\-5930K at 3.5
GHz), this computation takes about 3 seconds. When N, r or p are not specified,
they default to 1048576, 8, and 1, respectively. The default amount of RAM that
may be used by scrypt defaults to 1025 MiB.
.SH NOTES
.IX Header "NOTES"
A context for scrypt can be obtained by calling:
.PP
.Vb 1
\& EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_SCRYPT, NULL);
.Ve
.PP
The output length of an scrypt key derivation is specified via the
length parameter to the \fBEVP_PKEY_derive\fR\|(3) function.
.SH EXAMPLES
.IX Header "EXAMPLES"
This example derives a 64\-byte long test vector using scrypt using the password
"password", salt "NaCl" and N = 1024, r = 8, p = 16.
.PP
.Vb 2
\& EVP_PKEY_CTX *pctx;
\& unsigned char out[64];
\&
\& size_t outlen = sizeof(out);
\& pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_SCRYPT, NULL);
\&
\& if (EVP_PKEY_derive_init(pctx) <= 0) {
\& error("EVP_PKEY_derive_init");
\& }
\& if (EVP_PKEY_CTX_set1_pbe_pass(pctx, "password", 8) <= 0) {
\& error("EVP_PKEY_CTX_set1_pbe_pass");
\& }
\& if (EVP_PKEY_CTX_set1_scrypt_salt(pctx, "NaCl", 4) <= 0) {
\& error("EVP_PKEY_CTX_set1_scrypt_salt");
\& }
\& if (EVP_PKEY_CTX_set_scrypt_N(pctx, 1024) <= 0) {
\& error("EVP_PKEY_CTX_set_scrypt_N");
\& }
\& if (EVP_PKEY_CTX_set_scrypt_r(pctx, 8) <= 0) {
\& error("EVP_PKEY_CTX_set_scrypt_r");
\& }
\& if (EVP_PKEY_CTX_set_scrypt_p(pctx, 16) <= 0) {
\& error("EVP_PKEY_CTX_set_scrypt_p");
\& }
\& if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) {
\& error("EVP_PKEY_derive");
\& }
\&
\& {
\& const unsigned char expected[sizeof(out)] = {
\& 0xfd, 0xba, 0xbe, 0x1c, 0x9d, 0x34, 0x72, 0x00,
\& 0x78, 0x56, 0xe7, 0x19, 0x0d, 0x01, 0xe9, 0xfe,
\& 0x7c, 0x6a, 0xd7, 0xcb, 0xc8, 0x23, 0x78, 0x30,
\& 0xe7, 0x73, 0x76, 0x63, 0x4b, 0x37, 0x31, 0x62,
\& 0x2e, 0xaf, 0x30, 0xd9, 0x2e, 0x22, 0xa3, 0x88,
\& 0x6f, 0xf1, 0x09, 0x27, 0x9d, 0x98, 0x30, 0xda,
\& 0xc7, 0x27, 0xaf, 0xb9, 0x4a, 0x83, 0xee, 0x6d,
\& 0x83, 0x60, 0xcb, 0xdf, 0xa2, 0xcc, 0x06, 0x40
\& };
\&
\& assert(!memcmp(out, expected, sizeof(out)));
\& }
\&
\& EVP_PKEY_CTX_free(pctx);
.Ve
.SH "CONFORMING TO"
.IX Header "CONFORMING TO"
RFC 7914
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBEVP_PKEY_CTX_set1_scrypt_salt\fR\|(3),
\&\fBEVP_PKEY_CTX_set_scrypt_N\fR\|(3),
\&\fBEVP_PKEY_CTX_set_scrypt_r\fR\|(3),
\&\fBEVP_PKEY_CTX_set_scrypt_p\fR\|(3),
\&\fBEVP_PKEY_CTX_set_scrypt_maxmem_bytes\fR\|(3),
\&\fBEVP_PKEY_CTX_new\fR\|(3),
\&\fBEVP_PKEY_CTX_ctrl_str\fR\|(3),
\&\fBEVP_PKEY_derive\fR\|(3)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2017\-2019 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]+�I�2 �2 man/man1/genpkey.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "GENPKEY 1"
.TH GENPKEY 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-genpkey,
genpkey \- generate a private key
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBgenpkey\fR
[\fB\-help\fR]
[\fB\-out filename\fR]
[\fB\-outform PEM|DER\fR]
[\fB\-pass arg\fR]
[\fB\-\fR\f(BIcipher\fR]
[\fB\-engine id\fR]
[\fB\-paramfile file\fR]
[\fB\-algorithm alg\fR]
[\fB\-pkeyopt opt:value\fR]
[\fB\-genparam\fR]
[\fB\-text\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBgenpkey\fR command generates a private key.
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
Output the key to the specified file. If this argument is not specified then
standard output is used.
.IP "\fB\-outform DER|PEM\fR" 4
.IX Item "-outform DER|PEM"
This specifies the output format DER or PEM. The default format is PEM.
.IP "\fB\-pass arg\fR" 4
.IX Item "-pass arg"
The output file password source. For more information about the format of \fBarg\fR
see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP \fB\-\fR\f(BIcipher\fR 4
.IX Item "-cipher"
This option encrypts the private key with the supplied cipher. Any algorithm
name accepted by \fBEVP_get_cipherbyname()\fR is acceptable such as \fBdes3\fR.
.IP "\fB\-engine id\fR" 4
.IX Item "-engine id"
Specifying an engine (by its unique \fBid\fR string) will cause \fBgenpkey\fR
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms. If used this option should precede all other
options.
.IP "\fB\-algorithm alg\fR" 4
.IX Item "-algorithm alg"
Public key algorithm to use such as RSA, DSA or DH. If used this option must
precede any \fB\-pkeyopt\fR options. The options \fB\-paramfile\fR and \fB\-algorithm\fR
are mutually exclusive. Engines may add algorithms in addition to the standard
built-in ones.
.Sp
Valid built-in algorithm names for private key generation are RSA, RSA-PSS, EC,
X25519, X448, ED25519 and ED448.
.Sp
Valid built-in algorithm names for parameter generation (see the \fB\-genparam\fR
option) are DH, DSA and EC.
.Sp
Note that the algorithm name X9.42 DH may be used as a synonym for the DH
algorithm. These are identical and do not indicate the type of parameters that
will be generated. Use the \fBdh_paramgen_type\fR option to indicate whether PKCS#3
or X9.42 DH parameters are required. See "DH Parameter Generation Options"
below for more details.
.IP "\fB\-pkeyopt opt:value\fR" 4
.IX Item "-pkeyopt opt:value"
Set the public key algorithm option \fBopt\fR to \fBvalue\fR. The precise set of
options supported depends on the public key algorithm used and its
implementation. See "KEY GENERATION OPTIONS" and
"PARAMETER GENERATION OPTIONS" below for more details.
.IP \fB\-genparam\fR 4
.IX Item "-genparam"
Generate a set of parameters instead of a private key. If used this option must
precede any \fB\-algorithm\fR, \fB\-paramfile\fR or \fB\-pkeyopt\fR options.
.IP "\fB\-paramfile filename\fR" 4
.IX Item "-paramfile filename"
Some public key algorithms generate a private key based on a set of parameters.
They can be supplied using this option. If this option is used the public key
algorithm used is determined by the parameters. If used this option must
precede any \fB\-pkeyopt\fR options. The options \fB\-paramfile\fR and \fB\-algorithm\fR
are mutually exclusive.
.IP \fB\-text\fR 4
.IX Item "-text"
Print an (unencrypted) text representation of private and public keys and
parameters along with the PEM or DER structure.
.SH "KEY GENERATION OPTIONS"
.IX Header "KEY GENERATION OPTIONS"
The options supported by each algorithm and indeed each implementation of an
algorithm can vary. The options for the OpenSSL implementations are detailed
below. There are no key generation options defined for the X25519, X448, ED25519
or ED448 algorithms.
.SS "RSA Key Generation Options"
.IX Subsection "RSA Key Generation Options"
.IP \fBrsa_keygen_bits:numbits\fR 4
.IX Item "rsa_keygen_bits:numbits"
The number of bits in the generated key. If not specified 2048 is used.
.IP \fBrsa_keygen_primes:numprimes\fR 4
.IX Item "rsa_keygen_primes:numprimes"
The number of primes in the generated key. If not specified 2 is used.
.IP \fBrsa_keygen_pubexp:value\fR 4
.IX Item "rsa_keygen_pubexp:value"
The RSA public exponent value. This can be a large decimal or
hexadecimal value if preceded by \fB0x\fR. Default value is 65537.
.SS "RSA-PSS Key Generation Options"
.IX Subsection "RSA-PSS Key Generation Options"
Note: by default an \fBRSA-PSS\fR key has no parameter restrictions.
.IP "\fBrsa_keygen_bits:numbits\fR, \fBrsa_keygen_primes:numprimes\fR, \fBrsa_keygen_pubexp:value\fR" 4
.IX Item "rsa_keygen_bits:numbits, rsa_keygen_primes:numprimes, rsa_keygen_pubexp:value"
These options have the same meaning as the \fBRSA\fR algorithm.
.IP \fBrsa_pss_keygen_md:digest\fR 4
.IX Item "rsa_pss_keygen_md:digest"
If set the key is restricted and can only use \fBdigest\fR for signing.
.IP \fBrsa_pss_keygen_mgf1_md:digest\fR 4
.IX Item "rsa_pss_keygen_mgf1_md:digest"
If set the key is restricted and can only use \fBdigest\fR as it's MGF1
parameter.
.IP \fBrsa_pss_keygen_saltlen:len\fR 4
.IX Item "rsa_pss_keygen_saltlen:len"
If set the key is restricted and \fBlen\fR specifies the minimum salt length.
.SS "EC Key Generation Options"
.IX Subsection "EC Key Generation Options"
The EC key generation options can also be used for parameter generation.
.IP \fBec_paramgen_curve:curve\fR 4
.IX Item "ec_paramgen_curve:curve"
The EC curve to use. OpenSSL supports NIST curve names such as "P\-256".
.IP \fBec_param_enc:encoding\fR 4
.IX Item "ec_param_enc:encoding"
The encoding to use for parameters. The "encoding" parameter must be either
"named_curve" or "explicit". The default value is "named_curve".
.SH "PARAMETER GENERATION OPTIONS"
.IX Header "PARAMETER GENERATION OPTIONS"
The options supported by each algorithm and indeed each implementation of an
algorithm can vary. The options for the OpenSSL implementations are detailed
below.
.SS "DSA Parameter Generation Options"
.IX Subsection "DSA Parameter Generation Options"
.IP \fBdsa_paramgen_bits:numbits\fR 4
.IX Item "dsa_paramgen_bits:numbits"
The number of bits in the generated prime. If not specified 2048 is used.
.IP \fBdsa_paramgen_q_bits:numbits\fR 4
.IX Item "dsa_paramgen_q_bits:numbits"
The number of bits in the q parameter. Must be one of 160, 224 or 256. If not
specified 224 is used.
.IP \fBdsa_paramgen_md:digest\fR 4
.IX Item "dsa_paramgen_md:digest"
The digest to use during parameter generation. Must be one of \fBsha1\fR, \fBsha224\fR
or \fBsha256\fR. If set, then the number of bits in \fBq\fR will match the output size
of the specified digest and the \fBdsa_paramgen_q_bits\fR parameter will be
ignored. If not set, then a digest will be used that gives an output matching
the number of bits in \fBq\fR, i.e. \fBsha1\fR if q length is 160, \fBsha224\fR if it 224
or \fBsha256\fR if it is 256.
.SS "DH Parameter Generation Options"
.IX Subsection "DH Parameter Generation Options"
.IP \fBdh_paramgen_prime_len:numbits\fR 4
.IX Item "dh_paramgen_prime_len:numbits"
The number of bits in the prime parameter \fBp\fR. The default is 2048.
.IP \fBdh_paramgen_subprime_len:numbits\fR 4
.IX Item "dh_paramgen_subprime_len:numbits"
The number of bits in the sub prime parameter \fBq\fR. The default is 256 if the
prime is at least 2048 bits long or 160 otherwise. Only relevant if used in
conjunction with the \fBdh_paramgen_type\fR option to generate X9.42 DH parameters.
.IP \fBdh_paramgen_generator:value\fR 4
.IX Item "dh_paramgen_generator:value"
The value to use for the generator \fBg\fR. The default is 2.
.IP \fBdh_paramgen_type:value\fR 4
.IX Item "dh_paramgen_type:value"
The type of DH parameters to generate. Use 0 for PKCS#3 DH and 1 for X9.42 DH.
The default is 0.
.IP \fBdh_rfc5114:num\fR 4
.IX Item "dh_rfc5114:num"
If this option is set, then the appropriate RFC5114 parameters are used
instead of generating new parameters. The value \fBnum\fR can take the
values 1, 2 or 3 corresponding to RFC5114 DH parameters consisting of
1024 bit group with 160 bit subgroup, 2048 bit group with 224 bit subgroup
and 2048 bit group with 256 bit subgroup as mentioned in RFC5114 sections
2.1, 2.2 and 2.3 respectively. If present this overrides all other DH parameter
options.
.SS "EC Parameter Generation Options"
.IX Subsection "EC Parameter Generation Options"
The EC parameter generation options are the same as for key generation. See
"EC Key Generation Options" above.
.SH NOTES
.IX Header "NOTES"
The use of the genpkey program is encouraged over the algorithm specific
utilities because additional algorithm options and ENGINE provided algorithms
can be used.
.SH EXAMPLES
.IX Header "EXAMPLES"
Generate an RSA private key using default parameters:
.PP
.Vb 1
\& openssl genpkey \-algorithm RSA \-out key.pem
.Ve
.PP
Encrypt output private key using 128 bit AES and the passphrase "hello":
.PP
.Vb 1
\& openssl genpkey \-algorithm RSA \-out key.pem \-aes\-128\-cbc \-pass pass:hello
.Ve
.PP
Generate a 2048 bit RSA key using 3 as the public exponent:
.PP
.Vb 2
\& openssl genpkey \-algorithm RSA \-out key.pem \e
\& \-pkeyopt rsa_keygen_bits:2048 \-pkeyopt rsa_keygen_pubexp:3
.Ve
.PP
Generate 2048 bit DSA parameters:
.PP
.Vb 2
\& openssl genpkey \-genparam \-algorithm DSA \-out dsap.pem \e
\& \-pkeyopt dsa_paramgen_bits:2048
.Ve
.PP
Generate DSA key from parameters:
.PP
.Vb 1
\& openssl genpkey \-paramfile dsap.pem \-out dsakey.pem
.Ve
.PP
Generate 2048 bit DH parameters:
.PP
.Vb 2
\& openssl genpkey \-genparam \-algorithm DH \-out dhp.pem \e
\& \-pkeyopt dh_paramgen_prime_len:2048
.Ve
.PP
Generate 2048 bit X9.42 DH parameters:
.PP
.Vb 3
\& openssl genpkey \-genparam \-algorithm DH \-out dhpx.pem \e
\& \-pkeyopt dh_paramgen_prime_len:2048 \e
\& \-pkeyopt dh_paramgen_type:1
.Ve
.PP
Output RFC5114 2048 bit DH parameters with 224 bit subgroup:
.PP
.Vb 1
\& openssl genpkey \-genparam \-algorithm DH \-out dhp.pem \-pkeyopt dh_rfc5114:2
.Ve
.PP
Generate DH key from parameters:
.PP
.Vb 1
\& openssl genpkey \-paramfile dhp.pem \-out dhkey.pem
.Ve
.PP
Generate EC parameters:
.PP
.Vb 3
\& openssl genpkey \-genparam \-algorithm EC \-out ecp.pem \e
\& \-pkeyopt ec_paramgen_curve:secp384r1 \e
\& \-pkeyopt ec_param_enc:named_curve
.Ve
.PP
Generate EC key from parameters:
.PP
.Vb 1
\& openssl genpkey \-paramfile ecp.pem \-out eckey.pem
.Ve
.PP
Generate EC key directly:
.PP
.Vb 3
\& openssl genpkey \-algorithm EC \-out eckey.pem \e
\& \-pkeyopt ec_paramgen_curve:P\-384 \e
\& \-pkeyopt ec_param_enc:named_curve
.Ve
.PP
Generate an X25519 private key:
.PP
.Vb 1
\& openssl genpkey \-algorithm X25519 \-out xkey.pem
.Ve
.PP
Generate an ED448 private key:
.PP
.Vb 1
\& openssl genpkey \-algorithm ED448 \-out xkey.pem
.Ve
.SH HISTORY
.IX Header "HISTORY"
The ability to use NIST curve names, and to generate an EC key directly,
were added in OpenSSL 1.0.2.
The ability to generate X25519 keys was added in OpenSSL 1.1.0.
The ability to generate X448, ED25519 and ED448 keys was added in OpenSSL 1.1.1.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2006\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�Q�Uw3 w3 man/man1/pkcs8.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "PKCS8 1"
.TH PKCS8 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-pkcs8,
pkcs8 \- PKCS#8 format private key conversion tool
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBpkcs8\fR
[\fB\-help\fR]
[\fB\-topk8\fR]
[\fB\-inform PEM|DER\fR]
[\fB\-outform PEM|DER\fR]
[\fB\-in filename\fR]
[\fB\-passin arg\fR]
[\fB\-out filename\fR]
[\fB\-passout arg\fR]
[\fB\-iter count\fR]
[\fB\-noiter\fR]
[\fB\-rand file...\fR]
[\fB\-writerand file\fR]
[\fB\-nocrypt\fR]
[\fB\-traditional\fR]
[\fB\-v2 alg\fR]
[\fB\-v2prf alg\fR]
[\fB\-v1 alg\fR]
[\fB\-engine id\fR]
[\fB\-scrypt\fR]
[\fB\-scrypt_N N\fR]
[\fB\-scrypt_r r\fR]
[\fB\-scrypt_p p\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBpkcs8\fR command processes private keys in PKCS#8 format. It can handle
both unencrypted PKCS#8 PrivateKeyInfo format and EncryptedPrivateKeyInfo
format with a variety of PKCS#5 (v1.5 and v2.0) and PKCS#12 algorithms.
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP \fB\-topk8\fR 4
.IX Item "-topk8"
Normally a PKCS#8 private key is expected on input and a private key will be
written to the output file. With the \fB\-topk8\fR option the situation is
reversed: it reads a private key and writes a PKCS#8 format key.
.IP "\fB\-inform DER|PEM\fR" 4
.IX Item "-inform DER|PEM"
This specifies the input format: see "KEY FORMATS" for more details. The default
format is PEM.
.IP "\fB\-outform DER|PEM\fR" 4
.IX Item "-outform DER|PEM"
This specifies the output format: see "KEY FORMATS" for more details. The default
format is PEM.
.IP \fB\-traditional\fR 4
.IX Item "-traditional"
When this option is present and \fB\-topk8\fR is not a traditional format private
key is written.
.IP "\fB\-in filename\fR" 4
.IX Item "-in filename"
This specifies the input filename to read a key from or standard input if this
option is not specified. If the key is encrypted a pass phrase will be
prompted for.
.IP "\fB\-passin arg\fR" 4
.IX Item "-passin arg"
The input file password source. For more information about the format of \fBarg\fR
see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
This specifies the output filename to write a key to or standard output by
default. If any encryption options are set then a pass phrase will be
prompted for. The output filename should \fBnot\fR be the same as the input
filename.
.IP "\fB\-passout arg\fR" 4
.IX Item "-passout arg"
The output file password source. For more information about the format of \fBarg\fR
see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP "\fB\-iter count\fR" 4
.IX Item "-iter count"
When creating new PKCS#8 containers, use a given number of iterations on
the password in deriving the encryption key for the PKCS#8 output.
High values increase the time required to brute-force a PKCS#8 container.
.IP \fB\-nocrypt\fR 4
.IX Item "-nocrypt"
PKCS#8 keys generated or input are normally PKCS#8 EncryptedPrivateKeyInfo
structures using an appropriate password based encryption algorithm. With
this option an unencrypted PrivateKeyInfo structure is expected or output.
This option does not encrypt private keys at all and should only be used
when absolutely necessary. Certain software such as some versions of Java
code signing software used unencrypted private keys.
.IP "\fB\-rand file...\fR" 4
.IX Item "-rand file..."
A file or files containing random data used to seed the random number
generator.
Multiple files can be specified separated by an OS-dependent character.
The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
all others.
.IP "[\fB\-writerand file\fR]" 4
.IX Item "[-writerand file]"
Writes random data to the specified \fIfile\fR upon exit.
This can be used with a subsequent \fB\-rand\fR flag.
.IP "\fB\-v2 alg\fR" 4
.IX Item "-v2 alg"
This option sets the PKCS#5 v2.0 algorithm.
.Sp
The \fBalg\fR argument is the encryption algorithm to use, valid values include
\&\fBaes128\fR, \fBaes256\fR and \fBdes3\fR. If this option isn't specified then \fBaes256\fR
is used.
.IP "\fB\-v2prf alg\fR" 4
.IX Item "-v2prf alg"
This option sets the PRF algorithm to use with PKCS#5 v2.0. A typical value
value would be \fBhmacWithSHA256\fR. If this option isn't set then the default
for the cipher is used or \fBhmacWithSHA256\fR if there is no default.
.Sp
Some implementations may not support custom PRF algorithms and may require
the \fBhmacWithSHA1\fR option to work.
.IP "\fB\-v1 alg\fR" 4
.IX Item "-v1 alg"
This option indicates a PKCS#5 v1.5 or PKCS#12 algorithm should be used. Some
older implementations may not support PKCS#5 v2.0 and may require this option.
If not specified PKCS#5 v2.0 form is used.
.IP "\fB\-engine id\fR" 4
.IX Item "-engine id"
Specifying an engine (by its unique \fBid\fR string) will cause \fBpkcs8\fR
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms.
.IP \fB\-scrypt\fR 4
.IX Item "-scrypt"
Uses the \fBscrypt\fR algorithm for private key encryption using default
parameters: currently N=16384, r=8 and p=1 and AES in CBC mode with a 256 bit
key. These parameters can be modified using the \fB\-scrypt_N\fR, \fB\-scrypt_r\fR,
\&\fB\-scrypt_p\fR and \fB\-v2\fR options.
.IP "\fB\-scrypt_N N\fR \fB\-scrypt_r r\fR \fB\-scrypt_p p\fR" 4
.IX Item "-scrypt_N N -scrypt_r r -scrypt_p p"
Sets the scrypt \fBN\fR, \fBr\fR or \fBp\fR parameters.
.SH "KEY FORMATS"
.IX Header "KEY FORMATS"
Various different formats are used by the pkcs8 utility. These are detailed
below.
.PP
If a key is being converted from PKCS#8 form (i.e. the \fB\-topk8\fR option is
not used) then the input file must be in PKCS#8 format. An encrypted
key is expected unless \fB\-nocrypt\fR is included.
.PP
If \fB\-topk8\fR is not used and \fBPEM\fR mode is set the output file will be an
unencrypted private key in PKCS#8 format. If the \fB\-traditional\fR option is
used then a traditional format private key is written instead.
.PP
If \fB\-topk8\fR is not used and \fBDER\fR mode is set the output file will be an
unencrypted private key in traditional DER format.
.PP
If \fB\-topk8\fR is used then any supported private key can be used for the input
file in a format specified by \fB\-inform\fR. The output file will be encrypted
PKCS#8 format using the specified encryption parameters unless \fB\-nocrypt\fR
is included.
.SH NOTES
.IX Header "NOTES"
By default, when converting a key to PKCS#8 format, PKCS#5 v2.0 using 256 bit
AES with HMAC and SHA256 is used.
.PP
Some older implementations do not support PKCS#5 v2.0 format and require
the older PKCS#5 v1.5 form instead, possibly also requiring insecure weak
encryption algorithms such as 56 bit DES.
.PP
The encrypted form of a PEM encode PKCS#8 files uses the following
headers and footers:
.PP
.Vb 2
\& \-\-\-\-\-BEGIN ENCRYPTED PRIVATE KEY\-\-\-\-\-
\& \-\-\-\-\-END ENCRYPTED PRIVATE KEY\-\-\-\-\-
.Ve
.PP
The unencrypted form uses:
.PP
.Vb 2
\& \-\-\-\-\-BEGIN PRIVATE KEY\-\-\-\-\-
\& \-\-\-\-\-END PRIVATE KEY\-\-\-\-\-
.Ve
.PP
Private keys encrypted using PKCS#5 v2.0 algorithms and high iteration
counts are more secure that those encrypted using the traditional
SSLeay compatible formats. So if additional security is considered
important the keys should be converted.
.PP
It is possible to write out DER encoded encrypted private keys in
PKCS#8 format because the encryption details are included at an ASN1
level whereas the traditional format includes them at a PEM level.
.SH "PKCS#5 v1.5 and PKCS#12 algorithms."
.IX Header "PKCS#5 v1.5 and PKCS#12 algorithms."
Various algorithms can be used with the \fB\-v1\fR command line option,
including PKCS#5 v1.5 and PKCS#12. These are described in more detail
below.
.IP "\fBPBE\-MD2\-DES PBE\-MD5\-DES\fR" 4
.IX Item "PBE-MD2-DES PBE-MD5-DES"
These algorithms were included in the original PKCS#5 v1.5 specification.
They only offer 56 bits of protection since they both use DES.
.IP "\fBPBE\-SHA1\-RC2\-64\fR, \fBPBE\-MD2\-RC2\-64\fR, \fBPBE\-MD5\-RC2\-64\fR, \fBPBE\-SHA1\-DES\fR" 4
.IX Item "PBE-SHA1-RC2-64, PBE-MD2-RC2-64, PBE-MD5-RC2-64, PBE-SHA1-DES"
These algorithms are not mentioned in the original PKCS#5 v1.5 specification
but they use the same key derivation algorithm and are supported by some
software. They are mentioned in PKCS#5 v2.0. They use either 64 bit RC2 or
56 bit DES.
.IP "\fBPBE\-SHA1\-RC4\-128\fR, \fBPBE\-SHA1\-RC4\-40\fR, \fBPBE\-SHA1\-3DES\fR, \fBPBE\-SHA1\-2DES\fR, \fBPBE\-SHA1\-RC2\-128\fR, \fBPBE\-SHA1\-RC2\-40\fR" 4
.IX Item "PBE-SHA1-RC4-128, PBE-SHA1-RC4-40, PBE-SHA1-3DES, PBE-SHA1-2DES, PBE-SHA1-RC2-128, PBE-SHA1-RC2-40"
These algorithms use the PKCS#12 password based encryption algorithm and
allow strong encryption algorithms like triple DES or 128 bit RC2 to be used.
.SH EXAMPLES
.IX Header "EXAMPLES"
Convert a private key to PKCS#8 format using default parameters (AES with
256 bit key and \fBhmacWithSHA256\fR):
.PP
.Vb 1
\& openssl pkcs8 \-in key.pem \-topk8 \-out enckey.pem
.Ve
.PP
Convert a private key to PKCS#8 unencrypted format:
.PP
.Vb 1
\& openssl pkcs8 \-in key.pem \-topk8 \-nocrypt \-out enckey.pem
.Ve
.PP
Convert a private key to PKCS#5 v2.0 format using triple DES:
.PP
.Vb 1
\& openssl pkcs8 \-in key.pem \-topk8 \-v2 des3 \-out enckey.pem
.Ve
.PP
Convert a private key to PKCS#5 v2.0 format using AES with 256 bits in CBC
mode and \fBhmacWithSHA512\fR PRF:
.PP
.Vb 1
\& openssl pkcs8 \-in key.pem \-topk8 \-v2 aes\-256\-cbc \-v2prf hmacWithSHA512 \-out enckey.pem
.Ve
.PP
Convert a private key to PKCS#8 using a PKCS#5 1.5 compatible algorithm
(DES):
.PP
.Vb 1
\& openssl pkcs8 \-in key.pem \-topk8 \-v1 PBE\-MD5\-DES \-out enckey.pem
.Ve
.PP
Convert a private key to PKCS#8 using a PKCS#12 compatible algorithm
(3DES):
.PP
.Vb 1
\& openssl pkcs8 \-in key.pem \-topk8 \-out enckey.pem \-v1 PBE\-SHA1\-3DES
.Ve
.PP
Read a DER unencrypted PKCS#8 format private key:
.PP
.Vb 1
\& openssl pkcs8 \-inform DER \-nocrypt \-in key.der \-out key.pem
.Ve
.PP
Convert a private key from any PKCS#8 encrypted format to traditional format:
.PP
.Vb 1
\& openssl pkcs8 \-in pk8.pem \-traditional \-out key.pem
.Ve
.PP
Convert a private key to PKCS#8 format, encrypting with AES\-256 and with
one million iterations of the password:
.PP
.Vb 1
\& openssl pkcs8 \-in key.pem \-topk8 \-v2 aes\-256\-cbc \-iter 1000000 \-out pk8.pem
.Ve
.SH STANDARDS
.IX Header "STANDARDS"
Test vectors from this PKCS#5 v2.0 implementation were posted to the
pkcs-tng mailing list using triple DES, DES and RC2 with high iteration
counts, several people confirmed that they could decrypt the private
keys produced and therefore, it can be assumed that the PKCS#5 v2.0
implementation is reasonably accurate at least as far as these
algorithms are concerned.
.PP
The format of PKCS#8 DSA (and other) private keys is not well documented:
it is hidden away in PKCS#11 v2.01, section 11.9. OpenSSL's default DSA
PKCS#8 private key format complies with this standard.
.SH BUGS
.IX Header "BUGS"
There should be an option that prints out the encryption algorithm
in use and other details such as the iteration count.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBdsa\fR\|(1), \fBrsa\fR\|(1), \fBgenrsa\fR\|(1),
\&\fBgendsa\fR\|(1)
.SH HISTORY
.IX Header "HISTORY"
The \fB\-iter\fR option was added in OpenSSL 1.1.0.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]���k �k man/man1/req.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "REQ 1"
.TH REQ 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-req,
req \- PKCS#10 certificate request and certificate generating utility
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBreq\fR
[\fB\-help\fR]
[\fB\-inform PEM|DER\fR]
[\fB\-outform PEM|DER\fR]
[\fB\-in filename\fR]
[\fB\-passin arg\fR]
[\fB\-out filename\fR]
[\fB\-passout arg\fR]
[\fB\-text\fR]
[\fB\-pubkey\fR]
[\fB\-noout\fR]
[\fB\-verify\fR]
[\fB\-modulus\fR]
[\fB\-new\fR]
[\fB\-rand file...\fR]
[\fB\-writerand file\fR]
[\fB\-newkey rsa:bits\fR]
[\fB\-newkey alg:file\fR]
[\fB\-nodes\fR]
[\fB\-key filename\fR]
[\fB\-keyform PEM|DER\fR]
[\fB\-keyout filename\fR]
[\fB\-keygen_engine id\fR]
[\fB\-\fR\f(BIdigest\fR]
[\fB\-config filename\fR]
[\fB\-multivalue\-rdn\fR]
[\fB\-x509\fR]
[\fB\-days n\fR]
[\fB\-set_serial n\fR]
[\fB\-newhdr\fR]
[\fB\-addext ext\fR]
[\fB\-extensions section\fR]
[\fB\-reqexts section\fR]
[\fB\-precert\fR]
[\fB\-utf8\fR]
[\fB\-nameopt\fR]
[\fB\-reqopt\fR]
[\fB\-subject\fR]
[\fB\-subj arg\fR]
[\fB\-sigopt nm:v\fR]
[\fB\-batch\fR]
[\fB\-verbose\fR]
[\fB\-engine id\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBreq\fR command primarily creates and processes certificate requests
in PKCS#10 format. It can additionally create self signed certificates
for use as root CAs for example.
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP "\fB\-inform DER|PEM\fR" 4
.IX Item "-inform DER|PEM"
This specifies the input format. The \fBDER\fR option uses an ASN1 DER encoded
form compatible with the PKCS#10. The \fBPEM\fR form is the default format: it
consists of the \fBDER\fR format base64 encoded with additional header and
footer lines.
.IP "\fB\-outform DER|PEM\fR" 4
.IX Item "-outform DER|PEM"
This specifies the output format, the options have the same meaning and default
as the \fB\-inform\fR option.
.IP "\fB\-in filename\fR" 4
.IX Item "-in filename"
This specifies the input filename to read a request from or standard input
if this option is not specified. A request is only read if the creation
options (\fB\-new\fR and \fB\-newkey\fR) are not specified.
.IP "\fB\-sigopt nm:v\fR" 4
.IX Item "-sigopt nm:v"
Pass options to the signature algorithm during sign or verify operations.
Names and values of these options are algorithm-specific.
.IP "\fB\-passin arg\fR" 4
.IX Item "-passin arg"
The input file password source. For more information about the format of \fBarg\fR
see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
This specifies the output filename to write to or standard output by
default.
.IP "\fB\-passout arg\fR" 4
.IX Item "-passout arg"
The output file password source. For more information about the format of \fBarg\fR
see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP \fB\-text\fR 4
.IX Item "-text"
Prints out the certificate request in text form.
.IP \fB\-subject\fR 4
.IX Item "-subject"
Prints out the request subject (or certificate subject if \fB\-x509\fR is
specified)
.IP \fB\-pubkey\fR 4
.IX Item "-pubkey"
Outputs the public key.
.IP \fB\-noout\fR 4
.IX Item "-noout"
This option prevents output of the encoded version of the request.
.IP \fB\-modulus\fR 4
.IX Item "-modulus"
This option prints out the value of the modulus of the public key
contained in the request.
.IP \fB\-verify\fR 4
.IX Item "-verify"
Verifies the signature on the request.
.IP \fB\-new\fR 4
.IX Item "-new"
This option generates a new certificate request. It will prompt
the user for the relevant field values. The actual fields
prompted for and their maximum and minimum sizes are specified
in the configuration file and any requested extensions.
.Sp
If the \fB\-key\fR option is not used it will generate a new RSA private
key using information specified in the configuration file.
.IP "\fB\-rand file...\fR" 4
.IX Item "-rand file..."
A file or files containing random data used to seed the random number
generator.
Multiple files can be specified separated by an OS-dependent character.
The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
all others.
.IP "[\fB\-writerand file\fR]" 4
.IX Item "[-writerand file]"
Writes random data to the specified \fIfile\fR upon exit.
This can be used with a subsequent \fB\-rand\fR flag.
.IP "\fB\-newkey arg\fR" 4
.IX Item "-newkey arg"
This option creates a new certificate request and a new private
key. The argument takes one of several forms. \fBrsa:nbits\fR, where
\&\fBnbits\fR is the number of bits, generates an RSA key \fBnbits\fR
in size. If \fBnbits\fR is omitted, i.e. \fB\-newkey rsa\fR specified,
the default key size, specified in the configuration file is used.
.Sp
All other algorithms support the \fB\-newkey alg:file\fR form, where file may be
an algorithm parameter file, created by the \fBgenpkey \-genparam\fR command
or and X.509 certificate for a key with appropriate algorithm.
.Sp
\&\fBparam:file\fR generates a key using the parameter file or certificate \fBfile\fR,
the algorithm is determined by the parameters. \fBalgname:file\fR use algorithm
\&\fBalgname\fR and parameter file \fBfile\fR: the two algorithms must match or an
error occurs. \fBalgname\fR just uses algorithm \fBalgname\fR, and parameters,
if necessary should be specified via \fB\-pkeyopt\fR parameter.
.Sp
\&\fBdsa:filename\fR generates a DSA key using the parameters
in the file \fBfilename\fR. \fBec:filename\fR generates EC key (usable both with
ECDSA or ECDH algorithms), \fBgost2001:filename\fR generates GOST R
34.10\-2001 key (requires \fBccgost\fR engine configured in the configuration
file). If just \fBgost2001\fR is specified a parameter set should be
specified by \fB\-pkeyopt paramset:X\fR
.IP "\fB\-pkeyopt opt:value\fR" 4
.IX Item "-pkeyopt opt:value"
Set the public key algorithm option \fBopt\fR to \fBvalue\fR. The precise set of
options supported depends on the public key algorithm used and its
implementation. See \fBKEY GENERATION OPTIONS\fR in the \fBgenpkey\fR manual page
for more details.
.IP "\fB\-key filename\fR" 4
.IX Item "-key filename"
This specifies the file to read the private key from. It also
accepts PKCS#8 format private keys for PEM format files.
.IP "\fB\-keyform PEM|DER\fR" 4
.IX Item "-keyform PEM|DER"
The format of the private key file specified in the \fB\-key\fR
argument. PEM is the default.
.IP "\fB\-keyout filename\fR" 4
.IX Item "-keyout filename"
This gives the filename to write the newly created private key to.
If this option is not specified then the filename present in the
configuration file is used.
.IP \fB\-nodes\fR 4
.IX Item "-nodes"
If this option is specified then if a private key is created it
will not be encrypted.
.IP \fB\-\fR\f(BIdigest\fR 4
.IX Item "-digest"
This specifies the message digest to sign the request.
Any digest supported by the OpenSSL \fBdgst\fR command can be used.
This overrides the digest algorithm specified in
the configuration file.
.Sp
Some public key algorithms may override this choice. For instance, DSA
signatures always use SHA1, GOST R 34.10 signatures always use
GOST R 34.11\-94 (\fB\-md_gost94\fR), Ed25519 and Ed448 never use any digest.
.IP "\fB\-config filename\fR" 4
.IX Item "-config filename"
This allows an alternative configuration file to be specified.
Optional; for a description of the default value,
see "COMMAND SUMMARY" in \fBopenssl\fR\|(1).
.IP "\fB\-subj arg\fR" 4
.IX Item "-subj arg"
Sets subject name for new request or supersedes the subject name
when processing a request.
The arg must be formatted as \fI/type0=value0/type1=value1/type2=...\fR.
Keyword characters may be escaped by \e (backslash), and whitespace is retained.
Empty values are permitted, but the corresponding type will not be included
in the request.
.IP \fB\-multivalue\-rdn\fR 4
.IX Item "-multivalue-rdn"
This option causes the \-subj argument to be interpreted with full
support for multivalued RDNs. Example:
.Sp
\&\fI/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe\fR
.Sp
If \-multi\-rdn is not used then the UID value is \fI123456+CN=John Doe\fR.
.IP \fB\-x509\fR 4
.IX Item "-x509"
This option outputs a self signed certificate instead of a certificate
request. This is typically used to generate a test certificate or
a self signed root CA. The extensions added to the certificate
(if any) are specified in the configuration file. Unless specified
using the \fBset_serial\fR option, a large random number will be used for
the serial number.
.Sp
If existing request is specified with the \fB\-in\fR option, it is converted
to the self signed certificate otherwise new request is created.
.IP "\fB\-days n\fR" 4
.IX Item "-days n"
When the \fB\-x509\fR option is being used this specifies the number of
days to certify the certificate for, otherwise it is ignored. \fBn\fR should
be a positive integer. The default is 30 days.
.IP "\fB\-set_serial n\fR" 4
.IX Item "-set_serial n"
Serial number to use when outputting a self signed certificate. This
may be specified as a decimal value or a hex value if preceded by \fB0x\fR.
.IP "\fB\-addext ext\fR" 4
.IX Item "-addext ext"
Add a specific extension to the certificate (if the \fB\-x509\fR option is
present) or certificate request. The argument must have the form of
a key=value pair as it would appear in a config file.
.Sp
This option can be given multiple times.
.IP "\fB\-extensions section\fR" 4
.IX Item "-extensions section"
.PD 0
.IP "\fB\-reqexts section\fR" 4
.IX Item "-reqexts section"
.PD
These options specify alternative sections to include certificate
extensions (if the \fB\-x509\fR option is present) or certificate
request extensions. This allows several different sections to
be used in the same configuration file to specify requests for
a variety of purposes.
.IP \fB\-precert\fR 4
.IX Item "-precert"
A poison extension will be added to the certificate, making it a
"pre-certificate" (see RFC6962). This can be submitted to Certificate
Transparency logs in order to obtain signed certificate timestamps (SCTs).
These SCTs can then be embedded into the pre-certificate as an extension, before
removing the poison and signing the certificate.
.Sp
This implies the \fB\-new\fR flag.
.IP \fB\-utf8\fR 4
.IX Item "-utf8"
This option causes field values to be interpreted as UTF8 strings, by
default they are interpreted as ASCII. This means that the field
values, whether prompted from a terminal or obtained from a
configuration file, must be valid UTF8 strings.
.IP "\fB\-nameopt option\fR" 4
.IX Item "-nameopt option"
Option which determines how the subject or issuer names are displayed. The
\&\fBoption\fR argument can be a single option or multiple options separated by
commas. Alternatively the \fB\-nameopt\fR switch may be used more than once to
set multiple options. See the \fBx509\fR\|(1) manual page for details.
.IP \fB\-reqopt\fR 4
.IX Item "-reqopt"
Customise the output format used with \fB\-text\fR. The \fBoption\fR argument can be
a single option or multiple options separated by commas.
.Sp
See discussion of the \fB\-certopt\fR parameter in the \fBx509\fR\|(1)
command.
.IP \fB\-newhdr\fR 4
.IX Item "-newhdr"
Adds the word \fBNEW\fR to the PEM file header and footer lines on the outputted
request. Some software (Netscape certificate server) and some CAs need this.
.IP \fB\-batch\fR 4
.IX Item "-batch"
Non-interactive mode.
.IP \fB\-verbose\fR 4
.IX Item "-verbose"
Print extra details about the operations being performed.
.IP "\fB\-engine id\fR" 4
.IX Item "-engine id"
Specifying an engine (by its unique \fBid\fR string) will cause \fBreq\fR
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms.
.IP "\fB\-keygen_engine id\fR" 4
.IX Item "-keygen_engine id"
Specifies an engine (by its unique \fBid\fR string) which would be used
for key generation operations.
.SH "CONFIGURATION FILE FORMAT"
.IX Header "CONFIGURATION FILE FORMAT"
The configuration options are specified in the \fBreq\fR section of
the configuration file. As with all configuration files if no
value is specified in the specific section (i.e. \fBreq\fR) then
the initial unnamed or \fBdefault\fR section is searched too.
.PP
The options available are described in detail below.
.IP "\fBinput_password output_password\fR" 4
.IX Item "input_password output_password"
The passwords for the input private key file (if present) and
the output private key file (if one will be created). The
command line options \fBpassin\fR and \fBpassout\fR override the
configuration file values.
.IP \fBdefault_bits\fR 4
.IX Item "default_bits"
Specifies the default key size in bits.
.Sp
This option is used in conjunction with the \fB\-new\fR option to generate
a new key. It can be overridden by specifying an explicit key size in
the \fB\-newkey\fR option. The smallest accepted key size is 512 bits. If
no key size is specified then 2048 bits is used.
.IP \fBdefault_keyfile\fR 4
.IX Item "default_keyfile"
This is the default filename to write a private key to. If not
specified the key is written to standard output. This can be
overridden by the \fB\-keyout\fR option.
.IP \fBoid_file\fR 4
.IX Item "oid_file"
This specifies a file containing additional \fBOBJECT IDENTIFIERS\fR.
Each line of the file should consist of the numerical form of the
object identifier followed by white space then the short name followed
by white space and finally the long name.
.IP \fBoid_section\fR 4
.IX Item "oid_section"
This specifies a section in the configuration file containing extra
object identifiers. Each line should consist of the short name of the
object identifier followed by \fB=\fR and the numerical form. The short
and long names are the same when this option is used.
.IP \fBRANDFILE\fR 4
.IX Item "RANDFILE"
At startup the specified file is loaded into the random number generator,
and at exit 256 bytes will be written to it.
It is used for private key generation.
.IP \fBencrypt_key\fR 4
.IX Item "encrypt_key"
If this is set to \fBno\fR then if a private key is generated it is
\&\fBnot\fR encrypted. This is equivalent to the \fB\-nodes\fR command line
option. For compatibility \fBencrypt_rsa_key\fR is an equivalent option.
.IP \fBdefault_md\fR 4
.IX Item "default_md"
This option specifies the digest algorithm to use. Any digest supported by the
OpenSSL \fBdgst\fR command can be used. This option can be overridden on the
command line. Certain signing algorithms (i.e. Ed25519 and Ed448) will ignore
any digest that has been set.
.IP \fBstring_mask\fR 4
.IX Item "string_mask"
This option masks out the use of certain string types in certain
fields. Most users will not need to change this option.
.Sp
It can be set to several values \fBdefault\fR which is also the default
option uses PrintableStrings, T61Strings and BMPStrings if the
\&\fBpkix\fR value is used then only PrintableStrings and BMPStrings will
be used. This follows the PKIX recommendation in RFC2459. If the
\&\fButf8only\fR option is used then only UTF8Strings will be used: this
is the PKIX recommendation in RFC2459 after 2003. Finally the \fBnombstr\fR
option just uses PrintableStrings and T61Strings: certain software has
problems with BMPStrings and UTF8Strings: in particular Netscape.
.IP \fBreq_extensions\fR 4
.IX Item "req_extensions"
This specifies the configuration file section containing a list of
extensions to add to the certificate request. It can be overridden
by the \fB\-reqexts\fR command line switch. See the
\&\fBx509v3_config\fR\|(5) manual page for details of the
extension section format.
.IP \fBx509_extensions\fR 4
.IX Item "x509_extensions"
This specifies the configuration file section containing a list of
extensions to add to certificate generated when the \fB\-x509\fR switch
is used. It can be overridden by the \fB\-extensions\fR command line switch.
.IP \fBprompt\fR 4
.IX Item "prompt"
If set to the value \fBno\fR this disables prompting of certificate fields
and just takes values from the config file directly. It also changes the
expected format of the \fBdistinguished_name\fR and \fBattributes\fR sections.
.IP \fButf8\fR 4
.IX Item "utf8"
If set to the value \fByes\fR then field values to be interpreted as UTF8
strings, by default they are interpreted as ASCII. This means that
the field values, whether prompted from a terminal or obtained from a
configuration file, must be valid UTF8 strings.
.IP \fBattributes\fR 4
.IX Item "attributes"
This specifies the section containing any request attributes: its format
is the same as \fBdistinguished_name\fR. Typically these may contain the
challengePassword or unstructuredName types. They are currently ignored
by OpenSSL's request signing utilities but some CAs might want them.
.IP \fBdistinguished_name\fR 4
.IX Item "distinguished_name"
This specifies the section containing the distinguished name fields to
prompt for when generating a certificate or certificate request. The format
is described in the next section.
.SH "DISTINGUISHED NAME AND ATTRIBUTE SECTION FORMAT"
.IX Header "DISTINGUISHED NAME AND ATTRIBUTE SECTION FORMAT"
There are two separate formats for the distinguished name and attribute
sections. If the \fBprompt\fR option is set to \fBno\fR then these sections
just consist of field names and values: for example,
.PP
.Vb 3
\& CN=My Name
\& OU=My Organization
\& emailAddress=someone@somewhere.org
.Ve
.PP
This allows external programs (e.g. GUI based) to generate a template file
with all the field names and values and just pass it to \fBreq\fR. An example
of this kind of configuration file is contained in the \fBEXAMPLES\fR section.
.PP
Alternatively if the \fBprompt\fR option is absent or not set to \fBno\fR then the
file contains field prompting information. It consists of lines of the form:
.PP
.Vb 4
\& fieldName="prompt"
\& fieldName_default="default field value"
\& fieldName_min= 2
\& fieldName_max= 4
.Ve
.PP
"fieldName" is the field name being used, for example commonName (or CN).
The "prompt" string is used to ask the user to enter the relevant
details. If the user enters nothing then the default value is used if no
default value is present then the field is omitted. A field can
still be omitted if a default value is present if the user just
enters the '.' character.
.PP
The number of characters entered must be between the fieldName_min and
fieldName_max limits: there may be additional restrictions based
on the field being used (for example countryName can only ever be
two characters long and must fit in a PrintableString).
.PP
Some fields (such as organizationName) can be used more than once
in a DN. This presents a problem because configuration files will
not recognize the same name occurring twice. To avoid this problem
if the fieldName contains some characters followed by a full stop
they will be ignored. So for example a second organizationName can
be input by calling it "1.organizationName".
.PP
The actual permitted field names are any object identifier short or
long names. These are compiled into OpenSSL and include the usual
values such as commonName, countryName, localityName, organizationName,
organizationalUnitName, stateOrProvinceName. Additionally emailAddress
is included as well as name, surname, givenName, initials, and dnQualifier.
.PP
Additional object identifiers can be defined with the \fBoid_file\fR or
\&\fBoid_section\fR options in the configuration file. Any additional fields
will be treated as though they were a DirectoryString.
.SH EXAMPLES
.IX Header "EXAMPLES"
Examine and verify certificate request:
.PP
.Vb 1
\& openssl req \-in req.pem \-text \-verify \-noout
.Ve
.PP
Create a private key and then generate a certificate request from it:
.PP
.Vb 2
\& openssl genrsa \-out key.pem 2048
\& openssl req \-new \-key key.pem \-out req.pem
.Ve
.PP
The same but just using req:
.PP
.Vb 1
\& openssl req \-newkey rsa:2048 \-keyout key.pem \-out req.pem
.Ve
.PP
Generate a self signed root certificate:
.PP
.Vb 1
\& openssl req \-x509 \-newkey rsa:2048 \-keyout key.pem \-out req.pem
.Ve
.PP
Example of a file pointed to by the \fBoid_file\fR option:
.PP
.Vb 2
\& 1.2.3.4 shortName A longer Name
\& 1.2.3.6 otherName Other longer Name
.Ve
.PP
Example of a section pointed to by \fBoid_section\fR making use of variable
expansion:
.PP
.Vb 2
\& testoid1=1.2.3.5
\& testoid2=${testoid1}.6
.Ve
.PP
Sample configuration file prompting for field values:
.PP
.Vb 6
\& [ req ]
\& default_bits = 2048
\& default_keyfile = privkey.pem
\& distinguished_name = req_distinguished_name
\& attributes = req_attributes
\& req_extensions = v3_ca
\&
\& dirstring_type = nobmp
\&
\& [ req_distinguished_name ]
\& countryName = Country Name (2 letter code)
\& countryName_default = AU
\& countryName_min = 2
\& countryName_max = 2
\&
\& localityName = Locality Name (eg, city)
\&
\& organizationalUnitName = Organizational Unit Name (eg, section)
\&
\& commonName = Common Name (eg, YOUR name)
\& commonName_max = 64
\&
\& emailAddress = Email Address
\& emailAddress_max = 40
\&
\& [ req_attributes ]
\& challengePassword = A challenge password
\& challengePassword_min = 4
\& challengePassword_max = 20
\&
\& [ v3_ca ]
\&
\& subjectKeyIdentifier=hash
\& authorityKeyIdentifier=keyid:always,issuer:always
\& basicConstraints = critical, CA:true
.Ve
.PP
Sample configuration containing all field values:
.PP
.Vb 1
\& RANDFILE = $ENV::HOME/.rnd
\&
\& [ req ]
\& default_bits = 2048
\& default_keyfile = keyfile.pem
\& distinguished_name = req_distinguished_name
\& attributes = req_attributes
\& prompt = no
\& output_password = mypass
\&
\& [ req_distinguished_name ]
\& C = GB
\& ST = Test State or Province
\& L = Test Locality
\& O = Organization Name
\& OU = Organizational Unit Name
\& CN = Common Name
\& emailAddress = test@email.address
\&
\& [ req_attributes ]
\& challengePassword = A challenge password
.Ve
.PP
Example of giving the most common attributes (subject and extensions)
on the command line:
.PP
.Vb 4
\& openssl req \-new \-subj "/C=GB/CN=foo" \e
\& \-addext "subjectAltName = DNS:foo.co.uk" \e
\& \-addext "certificatePolicies = 1.2.3.4" \e
\& \-newkey rsa:2048 \-keyout key.pem \-out req.pem
.Ve
.SH NOTES
.IX Header "NOTES"
The header and footer lines in the \fBPEM\fR format are normally:
.PP
.Vb 2
\& \-\-\-\-\-BEGIN CERTIFICATE REQUEST\-\-\-\-\-
\& \-\-\-\-\-END CERTIFICATE REQUEST\-\-\-\-\-
.Ve
.PP
some software (some versions of Netscape certificate server) instead needs:
.PP
.Vb 2
\& \-\-\-\-\-BEGIN NEW CERTIFICATE REQUEST\-\-\-\-\-
\& \-\-\-\-\-END NEW CERTIFICATE REQUEST\-\-\-\-\-
.Ve
.PP
which is produced with the \fB\-newhdr\fR option but is otherwise compatible.
Either form is accepted transparently on input.
.PP
The certificate requests generated by \fBXenroll\fR with MSIE have extensions
added. It includes the \fBkeyUsage\fR extension which determines the type of
key (signature only or general purpose) and any additional OIDs entered
by the script in an extendedKeyUsage extension.
.SH DIAGNOSTICS
.IX Header "DIAGNOSTICS"
The following messages are frequently asked about:
.PP
.Vb 2
\& Using configuration from /some/path/openssl.cnf
\& Unable to load config info
.Ve
.PP
This is followed some time later by...
.PP
.Vb 2
\& unable to find \*(Aqdistinguished_name\*(Aq in config
\& problems making Certificate Request
.Ve
.PP
The first error message is the clue: it can't find the configuration
file! Certain operations (like examining a certificate request) don't
need a configuration file so its use isn't enforced. Generation of
certificates or requests however does need a configuration file. This
could be regarded as a bug.
.PP
Another puzzling message is this:
.PP
.Vb 2
\& Attributes:
\& a0:00
.Ve
.PP
this is displayed when no attributes are present and the request includes
the correct empty \fBSET OF\fR structure (the DER encoding of which is 0xa0
0x00). If you just see:
.PP
.Vb 1
\& Attributes:
.Ve
.PP
then the \fBSET OF\fR is missing and the encoding is technically invalid (but
it is tolerated). See the description of the command line option \fB\-asn1\-kludge\fR
for more information.
.SH BUGS
.IX Header "BUGS"
OpenSSL's handling of T61Strings (aka TeletexStrings) is broken: it effectively
treats them as ISO\-8859\-1 (Latin 1), Netscape and MSIE have similar behaviour.
This can cause problems if you need characters that aren't available in
PrintableStrings and you don't want to or can't use BMPStrings.
.PP
As a consequence of the T61String handling the only correct way to represent
accented characters in OpenSSL is to use a BMPString: unfortunately Netscape
currently chokes on these. If you have to use accented characters with Netscape
and MSIE then you currently need to use the invalid T61String form.
.PP
The current prompting is not very friendly. It doesn't allow you to confirm what
you've just entered. Other things like extensions in certificate requests are
statically defined in the configuration file. Some of these: like an email
address in subjectAltName should be input by the user.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBx509\fR\|(1), \fBca\fR\|(1), \fBgenrsa\fR\|(1),
\&\fBgendsa\fR\|(1), \fBconfig\fR\|(5),
\&\fBx509v3_config\fR\|(5)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�-p�] ] man/man1/genrsa.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "GENRSA 1"
.TH GENRSA 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-genrsa,
genrsa \- generate an RSA private key
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBgenrsa\fR
[\fB\-help\fR]
[\fB\-out filename\fR]
[\fB\-passout arg\fR]
[\fB\-aes128\fR]
[\fB\-aes192\fR]
[\fB\-aes256\fR]
[\fB\-aria128\fR]
[\fB\-aria192\fR]
[\fB\-aria256\fR]
[\fB\-camellia128\fR]
[\fB\-camellia192\fR]
[\fB\-camellia256\fR]
[\fB\-des\fR]
[\fB\-des3\fR]
[\fB\-idea\fR]
[\fB\-f4\fR]
[\fB\-3\fR]
[\fB\-rand file...\fR]
[\fB\-writerand file\fR]
[\fB\-engine id\fR]
[\fB\-primes num\fR]
[\fBnumbits\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBgenrsa\fR command generates an RSA private key.
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
Output the key to the specified file. If this argument is not specified then
standard output is used.
.IP "\fB\-passout arg\fR" 4
.IX Item "-passout arg"
The output file password source. For more information about the format
of \fBarg\fR see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP "\fB\-aes128\fR, \fB\-aes192\fR, \fB\-aes256\fR, \fB\-aria128\fR, \fB\-aria192\fR, \fB\-aria256\fR, \fB\-camellia128\fR, \fB\-camellia192\fR, \fB\-camellia256\fR, \fB\-des\fR, \fB\-des3\fR, \fB\-idea\fR" 4
.IX Item "-aes128, -aes192, -aes256, -aria128, -aria192, -aria256, -camellia128, -camellia192, -camellia256, -des, -des3, -idea"
These options encrypt the private key with specified
cipher before outputting it. If none of these options is
specified no encryption is used. If encryption is used a pass phrase is prompted
for if it is not supplied via the \fB\-passout\fR argument.
.IP \fB\-F4|\-3\fR 4
.IX Item "-F4|-3"
The public exponent to use, either 65537 or 3. The default is 65537.
.IP "\fB\-rand file...\fR" 4
.IX Item "-rand file..."
A file or files containing random data used to seed the random number
generator.
Multiple files can be specified separated by an OS-dependent character.
The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
all others.
.IP "[\fB\-writerand file\fR]" 4
.IX Item "[-writerand file]"
Writes random data to the specified \fIfile\fR upon exit.
This can be used with a subsequent \fB\-rand\fR flag.
.IP "\fB\-engine id\fR" 4
.IX Item "-engine id"
Specifying an engine (by its unique \fBid\fR string) will cause \fBgenrsa\fR
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms.
.IP "\fB\-primes num\fR" 4
.IX Item "-primes num"
Specify the number of primes to use while generating the RSA key. The \fBnum\fR
parameter must be a positive integer that is greater than 1 and less than 16.
If \fBnum\fR is greater than 2, then the generated key is called a 'multi\-prime'
RSA key, which is defined in RFC 8017.
.IP \fBnumbits\fR 4
.IX Item "numbits"
The size of the private key to generate in bits. This must be the last option
specified. The default is 2048 and values less than 512 are not allowed.
.SH NOTES
.IX Header "NOTES"
RSA private key generation essentially involves the generation of two or more
prime numbers. When generating a private key various symbols will be output to
indicate the progress of the generation. A \fB.\fR represents each number which
has passed an initial sieve test, \fB+\fR means a number has passed a single
round of the Miller-Rabin primality test, \fB*\fR means the current prime starts
a regenerating progress due to some failed tests. A newline means that the number
has passed all the prime tests (the actual number depends on the key size).
.PP
Because key generation is a random process the time taken to generate a key
may vary somewhat. But in general, more primes lead to less generation time
of a key.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBgendsa\fR\|(1)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]��S�7 7 man/man1/pkey.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "PKEY 1"
.TH PKEY 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-pkey,
pkey \- public or private key processing tool
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBpkey\fR
[\fB\-help\fR]
[\fB\-inform PEM|DER\fR]
[\fB\-outform PEM|DER\fR]
[\fB\-in filename\fR]
[\fB\-passin arg\fR]
[\fB\-out filename\fR]
[\fB\-passout arg\fR]
[\fB\-traditional\fR]
[\fB\-\fR\f(BIcipher\fR]
[\fB\-text\fR]
[\fB\-text_pub\fR]
[\fB\-noout\fR]
[\fB\-pubin\fR]
[\fB\-pubout\fR]
[\fB\-engine id\fR]
[\fB\-check\fR]
[\fB\-pubcheck\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBpkey\fR command processes public or private keys. They can be converted
between various forms and their components printed out.
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP "\fB\-inform DER|PEM\fR" 4
.IX Item "-inform DER|PEM"
This specifies the input format DER or PEM. The default format is PEM.
.IP "\fB\-outform DER|PEM\fR" 4
.IX Item "-outform DER|PEM"
This specifies the output format, the options have the same meaning and default
as the \fB\-inform\fR option.
.IP "\fB\-in filename\fR" 4
.IX Item "-in filename"
This specifies the input filename to read a key from or standard input if this
option is not specified. If the key is encrypted a pass phrase will be
prompted for.
.IP "\fB\-passin arg\fR" 4
.IX Item "-passin arg"
The input file password source. For more information about the format of \fBarg\fR
see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
This specifies the output filename to write a key to or standard output if this
option is not specified. If any encryption options are set then a pass phrase
will be prompted for. The output filename should \fBnot\fR be the same as the input
filename.
.IP "\fB\-passout password\fR" 4
.IX Item "-passout password"
The output file password source. For more information about the format of \fBarg\fR
see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP \fB\-traditional\fR 4
.IX Item "-traditional"
Normally a private key is written using standard format: this is PKCS#8 form
with the appropriate encryption algorithm (if any). If the \fB\-traditional\fR
option is specified then the older "traditional" format is used instead.
.IP \fB\-\fR\f(BIcipher\fR 4
.IX Item "-cipher"
These options encrypt the private key with the supplied cipher. Any algorithm
name accepted by \fBEVP_get_cipherbyname()\fR is acceptable such as \fBdes3\fR.
.IP \fB\-text\fR 4
.IX Item "-text"
Prints out the various public or private key components in
plain text in addition to the encoded version.
.IP \fB\-text_pub\fR 4
.IX Item "-text_pub"
Print out only public key components even if a private key is being processed.
.IP \fB\-noout\fR 4
.IX Item "-noout"
Do not output the encoded version of the key.
.IP \fB\-pubin\fR 4
.IX Item "-pubin"
By default a private key is read from the input file: with this
option a public key is read instead.
.IP \fB\-pubout\fR 4
.IX Item "-pubout"
By default a private key is output: with this option a public
key will be output instead. This option is automatically set if
the input is a public key.
.IP "\fB\-engine id\fR" 4
.IX Item "-engine id"
Specifying an engine (by its unique \fBid\fR string) will cause \fBpkey\fR
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms.
.IP \fB\-check\fR 4
.IX Item "-check"
This option checks the consistency of a key pair for both public and private
components.
.IP \fB\-pubcheck\fR 4
.IX Item "-pubcheck"
This option checks the correctness of either a public key or the public component
of a key pair.
.SH EXAMPLES
.IX Header "EXAMPLES"
To remove the pass phrase on an RSA private key:
.PP
.Vb 1
\& openssl pkey \-in key.pem \-out keyout.pem
.Ve
.PP
To encrypt a private key using triple DES:
.PP
.Vb 1
\& openssl pkey \-in key.pem \-des3 \-out keyout.pem
.Ve
.PP
To convert a private key from PEM to DER format:
.PP
.Vb 1
\& openssl pkey \-in key.pem \-outform DER \-out keyout.der
.Ve
.PP
To print out the components of a private key to standard output:
.PP
.Vb 1
\& openssl pkey \-in key.pem \-text \-noout
.Ve
.PP
To print out the public components of a private key to standard output:
.PP
.Vb 1
\& openssl pkey \-in key.pem \-text_pub \-noout
.Ve
.PP
To just output the public part of a private key:
.PP
.Vb 1
\& openssl pkey \-in key.pem \-pubout \-out pubkey.pem
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBgenpkey\fR\|(1), \fBrsa\fR\|(1), \fBpkcs8\fR\|(1),
\&\fBdsa\fR\|(1), \fBgenrsa\fR\|(1), \fBgendsa\fR\|(1)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2006\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�J man/man1/dhparam.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "DHPARAM 1"
.TH DHPARAM 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-dhparam,
dhparam \- DH parameter manipulation and generation
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl dhparam\fR
[\fB\-help\fR]
[\fB\-inform DER|PEM\fR]
[\fB\-outform DER|PEM\fR]
[\fB\-in\fR \fIfilename\fR]
[\fB\-out\fR \fIfilename\fR]
[\fB\-dsaparam\fR]
[\fB\-check\fR]
[\fB\-noout\fR]
[\fB\-text\fR]
[\fB\-C\fR]
[\fB\-2\fR]
[\fB\-5\fR]
[\fB\-rand file...\fR]
[\fB\-writerand file\fR]
[\fB\-engine id\fR]
[\fInumbits\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
This command is used to manipulate DH parameter files.
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP "\fB\-inform DER|PEM\fR" 4
.IX Item "-inform DER|PEM"
This specifies the input format. The \fBDER\fR option uses an ASN1 DER encoded
form compatible with the PKCS#3 DHparameter structure. The PEM form is the
default format: it consists of the \fBDER\fR format base64 encoded with
additional header and footer lines.
.IP "\fB\-outform DER|PEM\fR" 4
.IX Item "-outform DER|PEM"
This specifies the output format, the options have the same meaning and default
as the \fB\-inform\fR option.
.IP "\fB\-in\fR \fIfilename\fR" 4
.IX Item "-in filename"
This specifies the input filename to read parameters from or standard input if
this option is not specified.
.IP "\fB\-out\fR \fIfilename\fR" 4
.IX Item "-out filename"
This specifies the output filename parameters to. Standard output is used
if this option is not present. The output filename should \fBnot\fR be the same
as the input filename.
.IP \fB\-dsaparam\fR 4
.IX Item "-dsaparam"
If this option is used, DSA rather than DH parameters are read or created;
they are converted to DH format. Otherwise, "strong" primes (such
that (p\-1)/2 is also prime) will be used for DH parameter generation.
.Sp
DH parameter generation with the \fB\-dsaparam\fR option is much faster,
and the recommended exponent length is shorter, which makes DH key
exchange more efficient. Beware that with such DSA-style DH
parameters, a fresh DH key should be created for each use to
avoid small-subgroup attacks that may be possible otherwise.
.IP \fB\-check\fR 4
.IX Item "-check"
Performs numerous checks to see if the supplied parameters are valid and
displays a warning if not.
.IP "\fB\-2\fR, \fB\-5\fR" 4
.IX Item "-2, -5"
The generator to use, either 2 or 5. If present then the
input file is ignored and parameters are generated instead. If not
present but \fBnumbits\fR is present, parameters are generated with the
default generator 2.
.IP "\fB\-rand file...\fR" 4
.IX Item "-rand file..."
A file or files containing random data used to seed the random number
generator.
Multiple files can be specified separated by an OS-dependent character.
The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
all others.
.IP "[\fB\-writerand file\fR]" 4
.IX Item "[-writerand file]"
Writes random data to the specified \fIfile\fR upon exit.
This can be used with a subsequent \fB\-rand\fR flag.
.IP \fInumbits\fR 4
.IX Item "numbits"
This option specifies that a parameter set should be generated of size
\&\fInumbits\fR. It must be the last option. If this option is present then
the input file is ignored and parameters are generated instead. If
this option is not present but a generator (\fB\-2\fR or \fB\-5\fR) is
present, parameters are generated with a default length of 2048 bits.
.IP \fB\-noout\fR 4
.IX Item "-noout"
This option inhibits the output of the encoded version of the parameters.
.IP \fB\-text\fR 4
.IX Item "-text"
This option prints out the DH parameters in human readable form.
.IP \fB\-C\fR 4
.IX Item "-C"
This option converts the parameters into C code. The parameters can then
be loaded by calling the \fBget_dhNNNN()\fR function.
.IP "\fB\-engine id\fR" 4
.IX Item "-engine id"
Specifying an engine (by its unique \fBid\fR string) will cause \fBdhparam\fR
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms.
.SH WARNINGS
.IX Header "WARNINGS"
The program \fBdhparam\fR combines the functionality of the programs \fBdh\fR and
\&\fBgendh\fR in previous versions of OpenSSL. The \fBdh\fR and \fBgendh\fR
programs are retained for now but may have different purposes in future
versions of OpenSSL.
.SH NOTES
.IX Header "NOTES"
PEM format DH parameters use the header and footer lines:
.PP
.Vb 2
\& \-\-\-\-\-BEGIN DH PARAMETERS\-\-\-\-\-
\& \-\-\-\-\-END DH PARAMETERS\-\-\-\-\-
.Ve
.PP
OpenSSL currently only supports the older PKCS#3 DH, not the newer X9.42
DH.
.PP
This program manipulates DH parameters not keys.
.SH BUGS
.IX Header "BUGS"
There should be a way to generate and manipulate DH keys.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBdsaparam\fR\|(1)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]��q Q Q man/man1/smime.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "SMIME 1"
.TH SMIME 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-smime,
smime \- S/MIME utility
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBsmime\fR
[\fB\-help\fR]
[\fB\-encrypt\fR]
[\fB\-decrypt\fR]
[\fB\-sign\fR]
[\fB\-resign\fR]
[\fB\-verify\fR]
[\fB\-pk7out\fR]
[\fB\-binary\fR]
[\fB\-crlfeol\fR]
[\fB\-\fR\f(BIcipher\fR]
[\fB\-in file\fR]
[\fB\-CAfile file\fR]
[\fB\-CApath dir\fR]
[\fB\-no\-CAfile\fR]
[\fB\-no\-CApath\fR]
[\fB\-attime timestamp\fR]
[\fB\-check_ss_sig\fR]
[\fB\-crl_check\fR]
[\fB\-crl_check_all\fR]
[\fB\-explicit_policy\fR]
[\fB\-extended_crl\fR]
[\fB\-ignore_critical\fR]
[\fB\-inhibit_any\fR]
[\fB\-inhibit_map\fR]
[\fB\-partial_chain\fR]
[\fB\-policy arg\fR]
[\fB\-policy_check\fR]
[\fB\-policy_print\fR]
[\fB\-purpose purpose\fR]
[\fB\-suiteB_128\fR]
[\fB\-suiteB_128_only\fR]
[\fB\-suiteB_192\fR]
[\fB\-trusted_first\fR]
[\fB\-no_alt_chains\fR]
[\fB\-use_deltas\fR]
[\fB\-auth_level num\fR]
[\fB\-verify_depth num\fR]
[\fB\-verify_email email\fR]
[\fB\-verify_hostname hostname\fR]
[\fB\-verify_ip ip\fR]
[\fB\-verify_name name\fR]
[\fB\-x509_strict\fR]
[\fB\-certfile file\fR]
[\fB\-signer file\fR]
[\fB\-recip file\fR]
[\fB\-inform SMIME|PEM|DER\fR]
[\fB\-passin arg\fR]
[\fB\-inkey file_or_id\fR]
[\fB\-out file\fR]
[\fB\-outform SMIME|PEM|DER\fR]
[\fB\-content file\fR]
[\fB\-to addr\fR]
[\fB\-from ad\fR]
[\fB\-subject s\fR]
[\fB\-text\fR]
[\fB\-indef\fR]
[\fB\-noindef\fR]
[\fB\-stream\fR]
[\fB\-rand file...\fR]
[\fB\-writerand file\fR]
[\fB\-md digest\fR]
[cert.pem]...
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBsmime\fR command handles S/MIME mail. It can encrypt, decrypt, sign and
verify S/MIME messages.
.SH OPTIONS
.IX Header "OPTIONS"
There are six operation options that set the type of operation to be performed.
The meaning of the other options varies according to the operation type.
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP \fB\-encrypt\fR 4
.IX Item "-encrypt"
Encrypt mail for the given recipient certificates. Input file is the message
to be encrypted. The output file is the encrypted mail in MIME format.
.Sp
Note that no revocation check is done for the recipient cert, so if that
key has been compromised, others may be able to decrypt the text.
.IP \fB\-decrypt\fR 4
.IX Item "-decrypt"
Decrypt mail using the supplied certificate and private key. Expects an
encrypted mail message in MIME format for the input file. The decrypted mail
is written to the output file.
.IP \fB\-sign\fR 4
.IX Item "-sign"
Sign mail using the supplied certificate and private key. Input file is
the message to be signed. The signed message in MIME format is written
to the output file.
.IP \fB\-verify\fR 4
.IX Item "-verify"
Verify signed mail. Expects a signed mail message on input and outputs
the signed data. Both clear text and opaque signing is supported.
.IP \fB\-pk7out\fR 4
.IX Item "-pk7out"
Takes an input message and writes out a PEM encoded PKCS#7 structure.
.IP \fB\-resign\fR 4
.IX Item "-resign"
Resign a message: take an existing message and one or more new signers.
.IP "\fB\-in filename\fR" 4
.IX Item "-in filename"
The input message to be encrypted or signed or the MIME message to
be decrypted or verified.
.IP "\fB\-inform SMIME|PEM|DER\fR" 4
.IX Item "-inform SMIME|PEM|DER"
This specifies the input format for the PKCS#7 structure. The default
is \fBSMIME\fR which reads an S/MIME format message. \fBPEM\fR and \fBDER\fR
format change this to expect PEM and DER format PKCS#7 structures
instead. This currently only affects the input format of the PKCS#7
structure, if no PKCS#7 structure is being input (for example with
\&\fB\-encrypt\fR or \fB\-sign\fR) this option has no effect.
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
The message text that has been decrypted or verified or the output MIME
format message that has been signed or verified.
.IP "\fB\-outform SMIME|PEM|DER\fR" 4
.IX Item "-outform SMIME|PEM|DER"
This specifies the output format for the PKCS#7 structure. The default
is \fBSMIME\fR which write an S/MIME format message. \fBPEM\fR and \fBDER\fR
format change this to write PEM and DER format PKCS#7 structures
instead. This currently only affects the output format of the PKCS#7
structure, if no PKCS#7 structure is being output (for example with
\&\fB\-verify\fR or \fB\-decrypt\fR) this option has no effect.
.IP "\fB\-stream \-indef \-noindef\fR" 4
.IX Item "-stream -indef -noindef"
The \fB\-stream\fR and \fB\-indef\fR options are equivalent and enable streaming I/O
for encoding operations. This permits single pass processing of data without
the need to hold the entire contents in memory, potentially supporting very
large files. Streaming is automatically set for S/MIME signing with detached
data if the output format is \fBSMIME\fR it is currently off by default for all
other operations.
.IP \fB\-noindef\fR 4
.IX Item "-noindef"
Disable streaming I/O where it would produce and indefinite length constructed
encoding. This option currently has no effect. In future streaming will be
enabled by default on all relevant operations and this option will disable it.
.IP "\fB\-content filename\fR" 4
.IX Item "-content filename"
This specifies a file containing the detached content, this is only
useful with the \fB\-verify\fR command. This is only usable if the PKCS#7
structure is using the detached signature form where the content is
not included. This option will override any content if the input format
is S/MIME and it uses the multipart/signed MIME content type.
.IP \fB\-text\fR 4
.IX Item "-text"
This option adds plain text (text/plain) MIME headers to the supplied
message if encrypting or signing. If decrypting or verifying it strips
off text headers: if the decrypted or verified message is not of MIME
type text/plain then an error occurs.
.IP "\fB\-CAfile file\fR" 4
.IX Item "-CAfile file"
A file containing trusted CA certificates, only used with \fB\-verify\fR.
.IP "\fB\-CApath dir\fR" 4
.IX Item "-CApath dir"
A directory containing trusted CA certificates, only used with
\&\fB\-verify\fR. This directory must be a standard certificate directory: that
is a hash of each subject name (using \fBx509 \-hash\fR) should be linked
to each certificate.
.IP \fB\-no\-CAfile\fR 4
.IX Item "-no-CAfile"
Do not load the trusted CA certificates from the default file location.
.IP \fB\-no\-CApath\fR 4
.IX Item "-no-CApath"
Do not load the trusted CA certificates from the default directory location.
.IP "\fB\-md digest\fR" 4
.IX Item "-md digest"
Digest algorithm to use when signing or resigning. If not present then the
default digest algorithm for the signing key will be used (usually SHA1).
.IP \fB\-\fR\f(BIcipher\fR 4
.IX Item "-cipher"
The encryption algorithm to use. For example DES (56 bits) \- \fB\-des\fR,
triple DES (168 bits) \- \fB\-des3\fR,
\&\fBEVP_get_cipherbyname()\fR function) can also be used preceded by a dash, for
example \fB\-aes\-128\-cbc\fR. See \fBenc\fR for list of ciphers
supported by your version of OpenSSL.
.Sp
If not specified triple DES is used. Only used with \fB\-encrypt\fR.
.IP \fB\-nointern\fR 4
.IX Item "-nointern"
When verifying a message normally certificates (if any) included in
the message are searched for the signing certificate. With this option
only the certificates specified in the \fB\-certfile\fR option are used.
The supplied certificates can still be used as untrusted CAs however.
.IP \fB\-noverify\fR 4
.IX Item "-noverify"
Do not verify the signers certificate of a signed message.
.IP \fB\-nochain\fR 4
.IX Item "-nochain"
Do not do chain verification of signers certificates: that is don't
use the certificates in the signed message as untrusted CAs.
.IP \fB\-nosigs\fR 4
.IX Item "-nosigs"
Don't try to verify the signatures on the message.
.IP \fB\-nocerts\fR 4
.IX Item "-nocerts"
When signing a message the signer's certificate is normally included
with this option it is excluded. This will reduce the size of the
signed message but the verifier must have a copy of the signers certificate
available locally (passed using the \fB\-certfile\fR option for example).
.IP \fB\-noattr\fR 4
.IX Item "-noattr"
Normally when a message is signed a set of attributes are included which
include the signing time and supported symmetric algorithms. With this
option they are not included.
.IP \fB\-binary\fR 4
.IX Item "-binary"
Normally the input message is converted to "canonical" format which is
effectively using CR and LF as end of line: as required by the S/MIME
specification. When this option is present no translation occurs. This
is useful when handling binary data which may not be in MIME format.
.IP \fB\-crlfeol\fR 4
.IX Item "-crlfeol"
Normally the output file uses a single \fBLF\fR as end of line. When this
option is present \fBCRLF\fR is used instead.
.IP \fB\-nodetach\fR 4
.IX Item "-nodetach"
When signing a message use opaque signing: this form is more resistant
to translation by mail relays but it cannot be read by mail agents that
do not support S/MIME. Without this option cleartext signing with
the MIME type multipart/signed is used.
.IP "\fB\-certfile file\fR" 4
.IX Item "-certfile file"
Allows additional certificates to be specified. When signing these will
be included with the message. When verifying these will be searched for
the signers certificates. The certificates should be in PEM format.
.IP "\fB\-signer file\fR" 4
.IX Item "-signer file"
A signing certificate when signing or resigning a message, this option can be
used multiple times if more than one signer is required. If a message is being
verified then the signers certificates will be written to this file if the
verification was successful.
.IP "\fB\-recip file\fR" 4
.IX Item "-recip file"
The recipients certificate when decrypting a message. This certificate
must match one of the recipients of the message or an error occurs.
.IP "\fB\-inkey file_or_id\fR" 4
.IX Item "-inkey file_or_id"
The private key to use when signing or decrypting. This must match the
corresponding certificate. If this option is not specified then the
private key must be included in the certificate file specified with
the \fB\-recip\fR or \fB\-signer\fR file. When signing this option can be used
multiple times to specify successive keys.
If no engine is used, the argument is taken as a file; if an engine is
specified, the argument is given to the engine as a key identifier.
.IP "\fB\-passin arg\fR" 4
.IX Item "-passin arg"
The private key password source. For more information about the format of \fBarg\fR
see "Pass Phrase Options" in \fBopenssl\fR\|(1).
.IP "\fB\-rand file...\fR" 4
.IX Item "-rand file..."
A file or files containing random data used to seed the random number
generator.
Multiple files can be specified separated by an OS-dependent character.
The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
all others.
.IP "[\fB\-writerand file\fR]" 4
.IX Item "[-writerand file]"
Writes random data to the specified \fIfile\fR upon exit.
This can be used with a subsequent \fB\-rand\fR flag.
.IP \fBcert.pem...\fR 4
.IX Item "cert.pem..."
One or more certificates of message recipients: used when encrypting
a message.
.IP "\fB\-to, \-from, \-subject\fR" 4
.IX Item "-to, -from, -subject"
The relevant mail headers. These are included outside the signed
portion of a message so they may be included manually. If signing
then many S/MIME mail clients check the signers certificate's email
address matches that specified in the From: address.
.IP "\fB\-attime\fR, \fB\-check_ss_sig\fR, \fB\-crl_check\fR, \fB\-crl_check_all\fR, \fB\-explicit_policy\fR, \fB\-extended_crl\fR, \fB\-ignore_critical\fR, \fB\-inhibit_any\fR, \fB\-inhibit_map\fR, \fB\-no_alt_chains\fR, \fB\-partial_chain\fR, \fB\-policy\fR, \fB\-policy_check\fR, \fB\-policy_print\fR, \fB\-purpose\fR, \fB\-suiteB_128\fR, \fB\-suiteB_128_only\fR, \fB\-suiteB_192\fR, \fB\-trusted_first\fR, \fB\-use_deltas\fR, \fB\-auth_level\fR, \fB\-verify_depth\fR, \fB\-verify_email\fR, \fB\-verify_hostname\fR, \fB\-verify_ip\fR, \fB\-verify_name\fR, \fB\-x509_strict\fR" 4
.IX Item "-attime, -check_ss_sig, -crl_check, -crl_check_all, -explicit_policy, -extended_crl, -ignore_critical, -inhibit_any, -inhibit_map, -no_alt_chains, -partial_chain, -policy, -policy_check, -policy_print, -purpose, -suiteB_128, -suiteB_128_only, -suiteB_192, -trusted_first, -use_deltas, -auth_level, -verify_depth, -verify_email, -verify_hostname, -verify_ip, -verify_name, -x509_strict"
Set various options of certificate chain verification. See
\&\fBverify\fR\|(1) manual page for details.
.SH NOTES
.IX Header "NOTES"
The MIME message must be sent without any blank lines between the
headers and the output. Some mail programs will automatically add
a blank line. Piping the mail directly to sendmail is one way to
achieve the correct format.
.PP
The supplied message to be signed or encrypted must include the
necessary MIME headers or many S/MIME clients won't display it
properly (if at all). You can use the \fB\-text\fR option to automatically
add plain text headers.
.PP
A "signed and encrypted" message is one where a signed message is
then encrypted. This can be produced by encrypting an already signed
message: see the examples section.
.PP
This version of the program only allows one signer per message but it
will verify multiple signers on received messages. Some S/MIME clients
choke if a message contains multiple signers. It is possible to sign
messages "in parallel" by signing an already signed message.
.PP
The options \fB\-encrypt\fR and \fB\-decrypt\fR reflect common usage in S/MIME
clients. Strictly speaking these process PKCS#7 enveloped data: PKCS#7
encrypted data is used for other purposes.
.PP
The \fB\-resign\fR option uses an existing message digest when adding a new
signer. This means that attributes must be present in at least one existing
signer using the same message digest or this operation will fail.
.PP
The \fB\-stream\fR and \fB\-indef\fR options enable streaming I/O support.
As a result the encoding is BER using indefinite length constructed encoding
and no longer DER. Streaming is supported for the \fB\-encrypt\fR operation and the
\&\fB\-sign\fR operation if the content is not detached.
.PP
Streaming is always used for the \fB\-sign\fR operation with detached data but
since the content is no longer part of the PKCS#7 structure the encoding
remains DER.
.SH "EXIT CODES"
.IX Header "EXIT CODES"
.IP 0 4
The operation was completely successfully.
.IP 1 4
.IX Item "1"
An error occurred parsing the command options.
.IP 2 4
.IX Item "2"
One of the input files could not be read.
.IP 3 4
.IX Item "3"
An error occurred creating the PKCS#7 file or when reading the MIME
message.
.IP 4 4
.IX Item "4"
An error occurred decrypting or verifying the message.
.IP 5 4
.IX Item "5"
The message was verified correctly but an error occurred writing out
the signers certificates.
.SH EXAMPLES
.IX Header "EXAMPLES"
Create a cleartext signed message:
.PP
.Vb 2
\& openssl smime \-sign \-in message.txt \-text \-out mail.msg \e
\& \-signer mycert.pem
.Ve
.PP
Create an opaque signed message:
.PP
.Vb 2
\& openssl smime \-sign \-in message.txt \-text \-out mail.msg \-nodetach \e
\& \-signer mycert.pem
.Ve
.PP
Create a signed message, include some additional certificates and
read the private key from another file:
.PP
.Vb 2
\& openssl smime \-sign \-in in.txt \-text \-out mail.msg \e
\& \-signer mycert.pem \-inkey mykey.pem \-certfile mycerts.pem
.Ve
.PP
Create a signed message with two signers:
.PP
.Vb 2
\& openssl smime \-sign \-in message.txt \-text \-out mail.msg \e
\& \-signer mycert.pem \-signer othercert.pem
.Ve
.PP
Send a signed message under Unix directly to sendmail, including headers:
.PP
.Vb 3
\& openssl smime \-sign \-in in.txt \-text \-signer mycert.pem \e
\& \-from steve@openssl.org \-to someone@somewhere \e
\& \-subject "Signed message" | sendmail someone@somewhere
.Ve
.PP
Verify a message and extract the signer's certificate if successful:
.PP
.Vb 1
\& openssl smime \-verify \-in mail.msg \-signer user.pem \-out signedtext.txt
.Ve
.PP
Send encrypted mail using triple DES:
.PP
.Vb 3
\& openssl smime \-encrypt \-in in.txt \-from steve@openssl.org \e
\& \-to someone@somewhere \-subject "Encrypted message" \e
\& \-des3 user.pem \-out mail.msg
.Ve
.PP
Sign and encrypt mail:
.PP
.Vb 4
\& openssl smime \-sign \-in ml.txt \-signer my.pem \-text \e
\& | openssl smime \-encrypt \-out mail.msg \e
\& \-from steve@openssl.org \-to someone@somewhere \e
\& \-subject "Signed and Encrypted message" \-des3 user.pem
.Ve
.PP
Note: the encryption command does not include the \fB\-text\fR option because the
message being encrypted already has MIME headers.
.PP
Decrypt mail:
.PP
.Vb 1
\& openssl smime \-decrypt \-in mail.msg \-recip mycert.pem \-inkey key.pem
.Ve
.PP
The output from Netscape form signing is a PKCS#7 structure with the
detached signature format. You can use this program to verify the
signature by line wrapping the base64 encoded structure and surrounding
it with:
.PP
.Vb 2
\& \-\-\-\-\-BEGIN PKCS7\-\-\-\-\-
\& \-\-\-\-\-END PKCS7\-\-\-\-\-
.Ve
.PP
and using the command:
.PP
.Vb 1
\& openssl smime \-verify \-inform PEM \-in signature.pem \-content content.txt
.Ve
.PP
Alternatively you can base64 decode the signature and use:
.PP
.Vb 1
\& openssl smime \-verify \-inform DER \-in signature.der \-content content.txt
.Ve
.PP
Create an encrypted message using 128 bit Camellia:
.PP
.Vb 1
\& openssl smime \-encrypt \-in plain.txt \-camellia128 \-out mail.msg cert.pem
.Ve
.PP
Add a signer to an existing message:
.PP
.Vb 1
\& openssl smime \-resign \-in mail.msg \-signer newsign.pem \-out mail2.msg
.Ve
.SH BUGS
.IX Header "BUGS"
The MIME parser isn't very clever: it seems to handle most messages that I've
thrown at it but it may choke on others.
.PP
The code currently will only write out the signer's certificate to a file: if
the signer has a separate encryption certificate this must be manually
extracted. There should be some heuristic that determines the correct
encryption certificate.
.PP
Ideally a database should be maintained of a certificates for each email
address.
.PP
The code doesn't currently take note of the permitted symmetric encryption
algorithms as supplied in the SMIMECapabilities signed attribute. This means the
user has to manually include the correct encryption algorithm. It should store
the list of permitted ciphers in a database and only use those.
.PP
No revocation checking is done on the signer's certificate.
.PP
The current code can only handle S/MIME v2 messages, the more complex S/MIME v3
structures may cause parsing errors.
.SH HISTORY
.IX Header "HISTORY"
The use of multiple \fB\-signer\fR options and the \fB\-resign\fR command were first
added in OpenSSL 1.0.0
.PP
The \-no_alt_chains option was added in OpenSSL 1.1.0.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]zD�� � man/man1/rsautl.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "RSAUTL 1"
.TH RSAUTL 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-rsautl,
rsautl \- RSA utility
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBrsautl\fR
[\fB\-help\fR]
[\fB\-in file\fR]
[\fB\-out file\fR]
[\fB\-inkey file\fR]
[\fB\-keyform PEM|DER|ENGINE\fR]
[\fB\-pubin\fR]
[\fB\-certin\fR]
[\fB\-sign\fR]
[\fB\-verify\fR]
[\fB\-encrypt\fR]
[\fB\-decrypt\fR]
[\fB\-rand file...\fR]
[\fB\-writerand file\fR]
[\fB\-pkcs\fR]
[\fB\-ssl\fR]
[\fB\-raw\fR]
[\fB\-hexdump\fR]
[\fB\-asn1parse\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBrsautl\fR command can be used to sign, verify, encrypt and decrypt
data using the RSA algorithm.
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP "\fB\-in filename\fR" 4
.IX Item "-in filename"
This specifies the input filename to read data from or standard input
if this option is not specified.
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
Specifies the output filename to write to or standard output by
default.
.IP "\fB\-inkey file\fR" 4
.IX Item "-inkey file"
The input key file, by default it should be an RSA private key.
.IP "\fB\-keyform PEM|DER|ENGINE\fR" 4
.IX Item "-keyform PEM|DER|ENGINE"
The key format PEM, DER or ENGINE.
.IP \fB\-pubin\fR 4
.IX Item "-pubin"
The input file is an RSA public key.
.IP \fB\-certin\fR 4
.IX Item "-certin"
The input is a certificate containing an RSA public key.
.IP \fB\-sign\fR 4
.IX Item "-sign"
Sign the input data and output the signed result. This requires
an RSA private key.
.IP \fB\-verify\fR 4
.IX Item "-verify"
Verify the input data and output the recovered data.
.IP \fB\-encrypt\fR 4
.IX Item "-encrypt"
Encrypt the input data using an RSA public key.
.IP \fB\-decrypt\fR 4
.IX Item "-decrypt"
Decrypt the input data using an RSA private key.
.IP "\fB\-rand file...\fR" 4
.IX Item "-rand file..."
A file or files containing random data used to seed the random number
generator.
Multiple files can be specified separated by an OS-dependent character.
The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
all others.
.IP "[\fB\-writerand file\fR]" 4
.IX Item "[-writerand file]"
Writes random data to the specified \fIfile\fR upon exit.
This can be used with a subsequent \fB\-rand\fR flag.
.IP "\fB\-pkcs, \-oaep, \-ssl, \-raw\fR" 4
.IX Item "-pkcs, -oaep, -ssl, -raw"
The padding to use: PKCS#1 v1.5 (the default), PKCS#1 OAEP,
special padding used in SSL v2 backwards compatible handshakes,
or no padding, respectively.
For signatures, only \fB\-pkcs\fR and \fB\-raw\fR can be used.
.IP \fB\-hexdump\fR 4
.IX Item "-hexdump"
Hex dump the output data.
.IP \fB\-asn1parse\fR 4
.IX Item "-asn1parse"
Parse the ASN.1 output data, this is useful when combined with the
\&\fB\-verify\fR option.
.SH NOTES
.IX Header "NOTES"
\&\fBrsautl\fR because it uses the RSA algorithm directly can only be
used to sign or verify small pieces of data.
.SH EXAMPLES
.IX Header "EXAMPLES"
Sign some data using a private key:
.PP
.Vb 1
\& openssl rsautl \-sign \-in file \-inkey key.pem \-out sig
.Ve
.PP
Recover the signed data
.PP
.Vb 1
\& openssl rsautl \-verify \-in sig \-inkey key.pem
.Ve
.PP
Examine the raw signed data:
.PP
.Vb 1
\& openssl rsautl \-verify \-in sig \-inkey key.pem \-raw \-hexdump
\&
\& 0000 \- 00 01 ff ff ff ff ff ff\-ff ff ff ff ff ff ff ff ................
\& 0010 \- ff ff ff ff ff ff ff ff\-ff ff ff ff ff ff ff ff ................
\& 0020 \- ff ff ff ff ff ff ff ff\-ff ff ff ff ff ff ff ff ................
\& 0030 \- ff ff ff ff ff ff ff ff\-ff ff ff ff ff ff ff ff ................
\& 0040 \- ff ff ff ff ff ff ff ff\-ff ff ff ff ff ff ff ff ................
\& 0050 \- ff ff ff ff ff ff ff ff\-ff ff ff ff ff ff ff ff ................
\& 0060 \- ff ff ff ff ff ff ff ff\-ff ff ff ff ff ff ff ff ................
\& 0070 \- ff ff ff ff 00 68 65 6c\-6c 6f 20 77 6f 72 6c 64 .....hello world
.Ve
.PP
The PKCS#1 block formatting is evident from this. If this was done using
encrypt and decrypt the block would have been of type 2 (the second byte)
and random padding data visible instead of the 0xff bytes.
.PP
It is possible to analyse the signature of certificates using this
utility in conjunction with \fBasn1parse\fR. Consider the self signed
example in certs/pca\-cert.pem . Running \fBasn1parse\fR as follows yields:
.PP
.Vb 1
\& openssl asn1parse \-in pca\-cert.pem
\&
\& 0:d=0 hl=4 l= 742 cons: SEQUENCE
\& 4:d=1 hl=4 l= 591 cons: SEQUENCE
\& 8:d=2 hl=2 l= 3 cons: cont [ 0 ]
\& 10:d=3 hl=2 l= 1 prim: INTEGER :02
\& 13:d=2 hl=2 l= 1 prim: INTEGER :00
\& 16:d=2 hl=2 l= 13 cons: SEQUENCE
\& 18:d=3 hl=2 l= 9 prim: OBJECT :md5WithRSAEncryption
\& 29:d=3 hl=2 l= 0 prim: NULL
\& 31:d=2 hl=2 l= 92 cons: SEQUENCE
\& 33:d=3 hl=2 l= 11 cons: SET
\& 35:d=4 hl=2 l= 9 cons: SEQUENCE
\& 37:d=5 hl=2 l= 3 prim: OBJECT :countryName
\& 42:d=5 hl=2 l= 2 prim: PRINTABLESTRING :AU
\& ....
\& 599:d=1 hl=2 l= 13 cons: SEQUENCE
\& 601:d=2 hl=2 l= 9 prim: OBJECT :md5WithRSAEncryption
\& 612:d=2 hl=2 l= 0 prim: NULL
\& 614:d=1 hl=3 l= 129 prim: BIT STRING
.Ve
.PP
The final BIT STRING contains the actual signature. It can be extracted with:
.PP
.Vb 1
\& openssl asn1parse \-in pca\-cert.pem \-out sig \-noout \-strparse 614
.Ve
.PP
The certificate public key can be extracted with:
.PP
.Vb 1
\& openssl x509 \-in test/testx509.pem \-pubkey \-noout >pubkey.pem
.Ve
.PP
The signature can be analysed with:
.PP
.Vb 1
\& openssl rsautl \-in sig \-verify \-asn1parse \-inkey pubkey.pem \-pubin
\&
\& 0:d=0 hl=2 l= 32 cons: SEQUENCE
\& 2:d=1 hl=2 l= 12 cons: SEQUENCE
\& 4:d=2 hl=2 l= 8 prim: OBJECT :md5
\& 14:d=2 hl=2 l= 0 prim: NULL
\& 16:d=1 hl=2 l= 16 prim: OCTET STRING
\& 0000 \- f3 46 9e aa 1a 4a 73 c9\-37 ea 93 00 48 25 08 b5 .F...Js.7...H%..
.Ve
.PP
This is the parsed version of an ASN1 DigestInfo structure. It can be seen that
the digest used was md5. The actual part of the certificate that was signed can
be extracted with:
.PP
.Vb 1
\& openssl asn1parse \-in pca\-cert.pem \-out tbs \-noout \-strparse 4
.Ve
.PP
and its digest computed with:
.PP
.Vb 2
\& openssl md5 \-c tbs
\& MD5(tbs)= f3:46:9e:aa:1a:4a:73:c9:37:ea:93:00:48:25:08:b5
.Ve
.PP
which it can be seen agrees with the recovered value above.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBdgst\fR\|(1), \fBrsa\fR\|(1), \fBgenrsa\fR\|(1)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]�
}�4 4 man/man1/nseq.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "NSEQ 1"
.TH NSEQ 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-nseq,
nseq \- create or examine a Netscape certificate sequence
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBnseq\fR
[\fB\-help\fR]
[\fB\-in filename\fR]
[\fB\-out filename\fR]
[\fB\-toseq\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBnseq\fR command takes a file containing a Netscape certificate
sequence and prints out the certificates contained in it or takes a
file of certificates and converts it into a Netscape certificate
sequence.
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP "\fB\-in filename\fR" 4
.IX Item "-in filename"
This specifies the input filename to read or standard input if this
option is not specified.
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
Specifies the output filename or standard output by default.
.IP \fB\-toseq\fR 4
.IX Item "-toseq"
Normally a Netscape certificate sequence will be input and the output
is the certificates contained in it. With the \fB\-toseq\fR option the
situation is reversed: a Netscape certificate sequence is created from
a file of certificates.
.SH EXAMPLES
.IX Header "EXAMPLES"
Output the certificates in a Netscape certificate sequence
.PP
.Vb 1
\& openssl nseq \-in nseq.pem \-out certs.pem
.Ve
.PP
Create a Netscape certificate sequence
.PP
.Vb 1
\& openssl nseq \-in certs.pem \-toseq \-out nseq.pem
.Ve
.SH NOTES
.IX Header "NOTES"
The \fBPEM\fR encoded form uses the same headers and footers as a certificate:
.PP
.Vb 2
\& \-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-
\& \-\-\-\-\-END CERTIFICATE\-\-\-\-\-
.Ve
.PP
A Netscape certificate sequence is a Netscape specific format that can be sent
to browsers as an alternative to the standard PKCS#7 format when several
certificates are sent to the browser: for example during certificate enrollment.
It is used by Netscape certificate server for example.
.SH BUGS
.IX Header "BUGS"
This program needs a few more options: like allowing DER or PEM input and
output files and allowing multiple certificate files to be used.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]D2
� � man/man1/gendsa.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "GENDSA 1"
.TH GENDSA 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-gendsa,
gendsa \- generate a DSA private key from a set of parameters
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl\fR \fBgendsa\fR
[\fB\-help\fR]
[\fB\-out filename\fR]
[\fB\-aes128\fR]
[\fB\-aes192\fR]
[\fB\-aes256\fR]
[\fB\-aria128\fR]
[\fB\-aria192\fR]
[\fB\-aria256\fR]
[\fB\-camellia128\fR]
[\fB\-camellia192\fR]
[\fB\-camellia256\fR]
[\fB\-des\fR]
[\fB\-des3\fR]
[\fB\-idea\fR]
[\fB\-rand file...\fR]
[\fB\-writerand file\fR]
[\fB\-engine id\fR]
[\fBparamfile\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBgendsa\fR command generates a DSA private key from a DSA parameter file
(which will be typically generated by the \fBopenssl dsaparam\fR command).
.SH OPTIONS
.IX Header "OPTIONS"
.IP \fB\-help\fR 4
.IX Item "-help"
Print out a usage message.
.IP "\fB\-out filename\fR" 4
.IX Item "-out filename"
Output the key to the specified file. If this argument is not specified then
standard output is used.
.IP "\fB\-aes128\fR, \fB\-aes192\fR, \fB\-aes256\fR, \fB\-aria128\fR, \fB\-aria192\fR, \fB\-aria256\fR, \fB\-camellia128\fR, \fB\-camellia192\fR, \fB\-camellia256\fR, \fB\-des\fR, \fB\-des3\fR, \fB\-idea\fR" 4
.IX Item "-aes128, -aes192, -aes256, -aria128, -aria192, -aria256, -camellia128, -camellia192, -camellia256, -des, -des3, -idea"
These options encrypt the private key with specified
cipher before outputting it. A pass phrase is prompted for.
If none of these options is specified no encryption is used.
.IP "\fB\-rand file...\fR" 4
.IX Item "-rand file..."
A file or files containing random data used to seed the random number
generator.
Multiple files can be specified separated by an OS-dependent character.
The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
all others.
.IP "[\fB\-writerand file\fR]" 4
.IX Item "[-writerand file]"
Writes random data to the specified \fIfile\fR upon exit.
This can be used with a subsequent \fB\-rand\fR flag.
.IP "\fB\-engine id\fR" 4
.IX Item "-engine id"
Specifying an engine (by its unique \fBid\fR string) will cause \fBgendsa\fR
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms.
.IP \fBparamfile\fR 4
.IX Item "paramfile"
This option specifies the DSA parameter file to use. The parameters in this
file determine the size of the private key. DSA parameters can be generated
and examined using the \fBopenssl dsaparam\fR command.
.SH NOTES
.IX Header "NOTES"
DSA key generation is little more than random number generation so it is
much quicker that RSA key generation for example.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBdsaparam\fR\|(1), \fBdsa\fR\|(1), \fBgenrsa\fR\|(1),
\&\fBrsa\fR\|(1)
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J] �B� � man/man1/prime.1nu �[��� .\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "PRIME 1"
.TH PRIME 1 2026-06-12 1.1.1w OpenSSL
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
openssl\-prime,
prime \- compute prime numbers
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBopenssl prime\fR
[\fB\-help\fR]
[\fB\-hex\fR]
[\fB\-generate\fR]
[\fB\-bits\fR]
[\fB\-safe\fR]
[\fB\-checks\fR]
[\fInumber...\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The \fBprime\fR command checks if the specified numbers are prime.
.PP
If no numbers are given on the command line, the \fB\-generate\fR flag should
be used to generate primes according to the requirements specified by the
rest of the flags.
.SH OPTIONS
.IX Header "OPTIONS"
.IP [\fB\-help\fR] 4
.IX Item "[-help]"
Display an option summary.
.IP [\fB\-hex\fR] 4
.IX Item "[-hex]"
Generate hex output.
.IP [\fB\-generate\fR] 4
.IX Item "[-generate]"
Generate a prime number.
.IP "[\fB\-bits num\fR]" 4
.IX Item "[-bits num]"
Generate a prime with \fBnum\fR bits.
.IP [\fB\-safe\fR] 4
.IX Item "[-safe]"
When used with \fB\-generate\fR, generates a "safe" prime. If the number
generated is \fBn\fR, then check that \fB(n\-1)/2\fR is also prime.
.IP "[\fB\-checks num\fR]" 4
.IX Item "[-checks num]"
Perform the checks \fBnum\fR times to see that the generated number
is prime. The default is 20.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (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>.
PK !J]@#_"