Latest update.

This commit is contained in:
2020-01-17 19:45:12 +09:00
parent 016df9f433
commit 0f7abb4eb6
1100 changed files with 47785 additions and 16292 deletions
-319
View File
@@ -1,319 +0,0 @@
HOWTO proxy certificates
0. WARNING
NONE OF THE CODE PRESENTED HERE HAS BEEN CHECKED! The code is just examples to
show you how things could be done. There might be typos or type conflicts, and
you will have to resolve them.
1. Introduction
Proxy certificates are defined in RFC 3820. They are really usual certificates
with the mandatory extension proxyCertInfo.
Proxy certificates are issued by an End Entity (typically a user), either
directly with the EE certificate as issuing certificate, or by extension through
an already issued proxy certificate. Proxy certificates 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 certificate.
See https://www.ietf.org/rfc/rfc3820.txt for more information.
2. A warning about proxy certificates
No one seems to have tested proxy certificates with security in mind. To this
date, it seems that proxy certificates have only been used in a context highly
aware of them.
Existing applications might misbehave when trying to validate a chain of
certificates which use a proxy certificate. They might incorrectly consider the
leaf to be the certificate to check for authorisation data, which is controlled
by the EE certificate owner.
subjectAltName and issuerAltName 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.
Possible threats we can think of at this time include:
- impersonation through commonName (think server certificates).
- use of additional extensions, possibly non-standard ones used in certain
environments, that would grant extra or different authorisation rights.
For these reasons, OpenSSL requires that the use of proxy certificates be
explicitly allowed. Currently, this can be done using the following methods:
- if the application directly calls X509_verify_cert(), it can first call:
X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS);
Where ctx is the pointer which then gets passed to X509_verify_cert().
- proxy certificate validation can be enabled before starting the application
by setting the environment variable OPENSSL_ALLOW_PROXY_CERTS.
In the future, it might be possible to enable proxy certificates by editing
openssl.cnf.
3. How to create proxy certificates
Creating proxy certificates is quite easy, by taking advantage of a lack of
checks in the 'openssl x509' application (*ahem*). You must first create a
configuration section that contains a definition of the proxyCertInfo extension,
for example:
[ 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
It's also possible to specify the proxy extension in a separate section:
proxyCertInfo=critical,@proxy_ext
[ proxy_ext ]
language=id-ppl-anyLanguage
pathlen=0
policy=text:BC
The policy value has a specific syntax, {syntag}:{string}, where the syntag
determines what will be done with the string. The following syntags are
recognised:
text indicates that the string is simply bytes, without any encoding:
policy=text:räksmörgås
Previous versions of this design had a specific tag for UTF-8 text.
However, since the bytes are copied as-is anyway, there is no need for
such a specific tag.
hex indicates the string is encoded in hex, with colons between each byte
(every second hex digit):
policy=hex:72:E4:6B:73:6D:F6:72:67:E5:73
Previous versions of this design had a tag to insert a complete DER
blob. However, the only legal use for this would be to surround the
bytes that would go with the hex: tag with whatever is needed to
construct a correct OCTET STRING. The DER tag therefore felt
superfluous, and was removed.
file indicates that the text of the policy should really be taken from a
file. The string is then really a filename. This is useful for
policies that are large (more than a few lines, e.g. XML documents).
The 'policy' setting can be split up in multiple lines like this:
0.policy=This is
1.policy= a multi-
2.policy=line policy.
NOTE: the proxy policy value is the part which determines the rights granted to
the process using the proxy certificate. The value is completely dependent on
the application reading and interpreting it!
Now that you have created an extension section for your proxy certificate, you
can easily create a proxy certificate by doing:
openssl req -new -config openssl.cnf -out proxy.req -keyout proxy.key
openssl x509 -req -CAcreateserial -in proxy.req -days 7 -out proxy.crt \
-CA user.crt -CAkey user.key -extfile openssl.cnf -extensions v3_proxy
You can also create a proxy certificate using another proxy certificate as
issuer (note: I'm using a different configuration section for it):
openssl req -new -config openssl.cnf -out proxy2.req -keyout proxy2.key
openssl x509 -req -CAcreateserial -in proxy2.req -days 7 -out proxy2.crt \
-CA proxy.crt -CAkey proxy.key -extfile openssl.cnf -extensions v3_proxy2
4. How to have your application interpret the policy?
The basic way to interpret proxy policies is to start with some default rights,
then compute the resulting rights by checking the proxy certificate against
the chain of proxy certificates, user certificate and CA certificates. You then
use the final computed rights. Sounds easy, huh? It almost is.
The slightly complicated part is figuring out how to pass data between your
application and the certificate validation procedure.
You need the following ingredients:
- a callback function that will be called for every certificate being
validated. The callback be 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.
- a data structure that is shared between your application code and the
callback.
- a wrapper function that sets it all up.
- an ex_data index function that creates an index into the generic ex_data
store that is attached to an X509 validation context.
Here is some skeleton code you can fill in:
#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's 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's REALLY important you keep the proxy policy
* check within this section. It's 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's 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;
}
If you use SSL or TLS, you can easily set up a callback to have the
certificates checked properly, using the code above:
SSL_CTX_set_cert_verify_callback(s_ctx, my_X509_verify_cert, &needed_rights);
--
Richard Levitte
+66
View File
@@ -0,0 +1,66 @@
SUBDIRS = man1
{-
use File::Spec::Functions qw(:DEFAULT abs2rel rel2abs);
use File::Basename;
foreach my $section ((1, 3, 5, 7)) {
my @htmlfiles = ();
my @manfiles = ();
my %podfiles =
map { $_ => 1 } glob catfile($sourcedir, "man$section", "*.pod");
my %podinfiles =
map { $_ => 1 } glob catfile($sourcedir, "man$section", "*.pod.in");
foreach (keys %podinfiles) {
(my $p = $_) =~ s|\.in$||i;
$podfiles{$p} = 1;
}
foreach my $p (sort keys %podfiles) {
my $podfile = abs2rel($p, $sourcedir);
my $podname = basename($podfile, '.pod');
my $podinfile = $podinfiles{"$p.in"} ? "$podfile.in" : undef;
my $podname = basename($podfile, ".pod");
my $htmlfile = abs2rel(catfile($buildtop, "doc", "html", "man$section",
"$podname.html"),
catdir($buildtop, "doc"));
my $manfile = abs2rel(catfile($buildtop, "doc", "man", "man$section",
"$podname.$section"),
catdir($buildtop, "doc"));
# The build.info format requires file specs to be in Unix format.
# Especially, since VMS file specs use [ and ], the build.info parser
# will otherwise get terribly confused.
if ($^O eq 'VMS') {
$htmlfile = VMS::Filespec::unixify($htmlfile);
$manfile = VMS::Filespec::unixify($manfile);
$podfile = VMS::Filespec::unixify($podfile);
$podinfile = VMS::Filespec::unixify($podinfile)
if defined $podinfile;
} elsif ($^O eq 'MSWin32') {
$htmlfile =~ s|\\|/|g;
$manfile =~ s|\\|/|g;
$podfile =~ s|\\|/|g;
$podinfile =~ s|\\|/|g
if defined $podinfile;
}
push @htmlfiles, $htmlfile;
push @manfiles, $manfile;
$OUT .= << "_____";
DEPEND[$htmlfile]=$podfile
GENERATE[$htmlfile]=$podfile
DEPEND[$manfile]=$podfile
GENERATE[$manfile]=$podfile
_____
$OUT .= << "_____" if $podinfile;
DEPEND[$podfile]=$podinfile ../configdata.pm
GENERATE[$podfile]=$podinfile
_____
}
$OUT .= "HTMLDOCS[man$section]=" . join(" \\\n", @htmlfiles) . "\n";
$OUT .= "MANDOCS[man$section]=" . join(" \\\n", @manfiles) . "\n";
}
-}
+6 -1
View File
@@ -33,7 +33,9 @@ ossl_method_store_cache_get, ossl_method_store_cache_set
int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid,
const char *prop_query, void **method);
int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, int nid,
const char *prop_query, void *method);
const char *prop_query, void *method,
int (*method_up_ref)(void *),
void (*method_destruct)(void *));
=head1 DESCRIPTION
@@ -95,6 +97,9 @@ The result, if any, is returned in I<method>.
ossl_method_store_cache_set() sets a cache entry identified by I<nid> with the
property query I<prop_query> in the I<store>.
Future calls to ossl_method_store_cache_get() will return the specified I<method>.
The I<method_up_ref> function is called to increment the
reference count of the method and the I<method_destruct> function is called
to decrement it.
=head1 RETURN VALUES
+1 -1
View File
@@ -27,7 +27,7 @@ which updates Section 5.4 of RFC 2634.
This attribute is mandatory to make a CMS compliant with CAdES-BES
(European Standard ETSI EN 319 122-1 V1.1.1).
For a fuller description see L<cms(1)>).
For a fuller description see L<openssl-cms(1)>).
=head1 RETURN VALUES
+1 -1
View File
@@ -252,7 +252,7 @@ And finally, the library functions:
=head1 SEE ALSO
L<ossl_method_construct>
L<ossl_method_construct(3)>
=head1 HISTORY
+2 -2
View File
@@ -41,11 +41,11 @@ The function described here are mainly useful for discovery, and
possibly display of what has been discovered, for example an
application that wants to display the loaded providers and what they
may offer, but also for constructors, such as
L<ossl_construct_method(3)>.
L<ossl_method_construct(3)>.
=head1 SEE ALSO
L<ossl_construct_method(3)>, L<EVP_MAC_do_all(3)>
L<ossl_method_construct(3)>, L<EVP_MAC_do_all_provided(3)>
=head1 HISTORY
+127
View File
@@ -0,0 +1,127 @@
=pod
=head1 NAME
ossl_cmp_hdr_set_pvno,
ossl_cmp_hdr_get_pvno,
ossl_cmp_hdr_get0_sendernonce,
ossl_cmp_hdr_set1_sender,
ossl_cmp_hdr_set1_recipient,
ossl_cmp_hdr_update_messagetime,
ossl_cmp_hdr_set1_senderKID,
ossl_cmp_hdr_push0_freeText,
ossl_cmp_hdr_push1_freeText,
ossl_cmp_hdr_generalinfo_item_push0,
ossl_cmp_hdr_generalinfo_items_push1,
ossl_cmp_hdr_set_implicitConfirm,
ossl_cmp_hdr_check_implicitConfirm,
ossl_cmp_hdr_init
- functions manipulating CMP message headers
=head1 SYNOPSIS
#include "cmp_int.h"
int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno);
int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr);
ASN1_OCTET_STRING
*ossl_cmp_hdr_get0_sendernonce(const OSSL_CMP_PKIHEADER *hdr);
int ossl_cmp_hdr_set1_sender(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm);
int ossl_cmp_hdr_set1_recipient(OSSL_CMP_PKIHEADER *hdr, const X509_NAME *nm);
int ossl_cmp_hdr_update_messagetime(OSSL_CMP_PKIHEADER *hdr);
int ossl_cmp_hdr_set1_senderKID(OSSL_CMP_PKIHEADER *hdr,
const ASN1_OCTET_STRING *senderKID);
int ossl_cmp_hdr_generalinfo_item_push0(OSSL_CMP_PKIHEADER *hdr,
OSSL_CMP_ITAV *itav);
int ossl_cmp_hdr_generalinfo_items_push1(OSSL_CMP_PKIHEADER *hdr,
STACK_OF(OSSL_CMP_ITAV) *itavs);
int ossl_cmp_hdr_push0_freeText(OSSL_CMP_PKIHEADER *hdr,
ASN1_UTF8STRING *text);
int ossl_cmp_hdr_push1_freeText(OSSL_CMP_PKIHEADER *hdr,
ASN1_UTF8STRING *text);
int ossl_cmp_hdr_set_implicitConfirm(OSSL_CMP_PKIHEADER *hdr);
int ossl_cmp_hdr_check_implicitConfirm(OSSL_CMP_PKIHEADER *hdr);
int ossl_cmp_hdr_init(OSSL_CMP_CTX *ctx, OSSL_CMP_PKIHEADER *hdr);
=head1 DESCRIPTION
ossl_cmp_hdr_set_pvno() sets hdr->pvno to the given B<pvno>.
ossl_cmp_hdr_get_pvno() returns the pvno of the given B<hdr> or -1 on error.
ossl_cmp_hdr_get0_sendernonce() returns the sender nonce of the given PKIHeader.
ossl_cmp_hdr_set1_sender() sets the sender field in the given PKIHeader
to the given X509 Name value, without consuming the pointer.
ossl_cmp_hdr_set1_recipient() sets the recipient field in the given
PKIHeader to the given X509 Name value, without consuming the pointer.
If B<nm> is NULL, recipient is set to the NULL DN (the empty list of strings).
ossl_cmp_hdr_update_messagetime() (re-)sets the messageTime to the current
system time. As written in RFC 4210, section 5.1.1:
The messageTime field contains the time at which the sender created the message.
This may be useful to allow end entities to correct/check their local time for
consistency with the time on a central system.
ossl_cmp_hdr_set1_senderKID() Sets hdr->senderKID to the given string.
In an PBMAC-protected IR this usually is a reference number issued by the CA,
else the subject key ID of the sender's protecting certificate.
ossl_cmp_hdr_push0_freeText() pushes an ASN1_UTF8STRING to
hdr->freeText and consumes the given pointer.
ossl_cmp_hdr_push1_freeText() pushes an ASN1_UTF8STRING to
hdr->freeText and does not consume the pointer.
ossl_cmp_hdr_generalinfo_item_push0() adds the given InfoTypeAndValue
item to the hdr->generalInfo stack. Consumes the B<itav> pointer.
ossl_cmp_hdr_generalinfo_items_push1() adds a copy of the B<itavs> stack to
the generalInfo field of PKIheader of the B<hdr>. Does not consume the B<itavs>
pointer.
ossl_cmp_hdr_set_implicitConfirm() sets implicitConfirm in the generalInfo field
of the PKIMessage header.
ossl_cmp_hdr_check_implicitConfirm() returns 1 if implicitConfirm is
set int generalInfo field of the given PKIMessage header, 0 if not.
ossl_cmp_hdr_init() initializes a PKIHeader structure based on the
values in the given OSSL_CMP_CTX structure.
This starts a new transaction in case ctx->transactionID is NULL.
The sender name is copied from the subject of the client cert, if any,
or else from the subject name provided for certification requests.
As required by RFC 4210 section 5.1.1., if the sender name is not known
to the client it set to the NULL-DN. In this case for identification at least
the senderKID must be set, which we take from any referenceValue provided.
=head1 NOTES
CMP is defined in RFC 4210 (and CRMF in RFC 4211).
=head1 RETURN VALUES
ossl_cmp_hdr_get_pvno() returns the pvno of the given B<hdr> or -1 on error.
ossl_cmp_hdr_get0_sendernonce() returns the respective nonce.
All other functions return 1 on success, 0 on error.
See the individual functions above.
=head1 HISTORY
The OpenSSL CMP support was added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
@@ -0,0 +1,107 @@
=pod
=head1 NAME
ossl_cmp_statusinfo_new,
ossl_cmp_pkisi_pkistatus_get,
ossl_cmp_pkisi_pkifailureinfo_get,
ossl_cmp_pkisi_pkifailureinfo_check,
ossl_cmp_pkisi_failinfo_get0,
ossl_cmp_pkisi_statusstring_get0,
ossl_pkisi_snprint
- functions for managing PKI status information
=head1 SYNOPSIS
#include "cmp.h"
# define OSSL_CMP_PKIFAILUREINFO_badAlg 0
# define OSSL_CMP_PKIFAILUREINFO_badMessageCheck 1
# define OSSL_CMP_PKIFAILUREINFO_badRequest 2
# define OSSL_CMP_PKIFAILUREINFO_badTime 3
# define OSSL_CMP_PKIFAILUREINFO_badCertId 4
# define OSSL_CMP_PKIFAILUREINFO_badDataFormat 5
# define OSSL_CMP_PKIFAILUREINFO_wrongAuthority 6
# define OSSL_CMP_PKIFAILUREINFO_incorrectData 7
# define OSSL_CMP_PKIFAILUREINFO_missingTimeStamp 8
# define OSSL_CMP_PKIFAILUREINFO_badPOP 9
# define OSSL_CMP_PKIFAILUREINFO_certRevoked 10
# define OSSL_CMP_PKIFAILUREINFO_certConfirmed 11
# define OSSL_CMP_PKIFAILUREINFO_wrongIntegrity 12
# define OSSL_CMP_PKIFAILUREINFO_badRecipientNonce 13
# define OSSL_CMP_PKIFAILUREINFO_timeNotAvailable 14
# define OSSL_CMP_PKIFAILUREINFO_unacceptedPolicy 15
# define OSSL_CMP_PKIFAILUREINFO_unacceptedExtension 16
# define OSSL_CMP_PKIFAILUREINFO_addInfoNotAvailable 17
# define OSSL_CMP_PKIFAILUREINFO_badSenderNonce 18
# define OSSL_CMP_PKIFAILUREINFO_badCertTemplate 19
# define OSSL_CMP_PKIFAILUREINFO_signerNotTrusted 20
# define OSSL_CMP_PKIFAILUREINFO_transactionIdInUse 21
# define OSSL_CMP_PKIFAILUREINFO_unsupportedVersion 22
# define OSSL_CMP_PKIFAILUREINFO_notAuthorized 23
# define OSSL_CMP_PKIFAILUREINFO_systemUnavail 24
# define OSSL_CMP_PKIFAILUREINFO_systemFailure 25
# define OSSL_CMP_PKIFAILUREINFO_duplicateCertReq 26
# define OSSL_CMP_PKIFAILUREINFO_MAX 26
OSSL_CMP_PKISI *ossl_cmp_statusinfo_new(int status, int fail_info,
const char *text);
int ossl_cmp_pkisi_pkistatus_get(OSSL_CMP_PKISI *si);
int ossl_cmp_pkisi_pkifailureinfo_get(OSSL_CMP_PKISI *si);
int ossl_cmp_pkisi_pkifailureinfo_check(OSSL_CMP_PKISI *si, int bit_index);
OSSL_CMP_PKIFAILUREINFO *ossl_cmp_pkisi_failinfo_get0(const OSSL_CMP_PKISI *si);
OSSL_CMP_PKIFREETEXT *ossl_cmp_pkisi_statusstring_get0(const OSSL_CMP_PKISI *si);
char *ossl_pkisi_snprint(OSSL_CMP_PKISI *si, char *buf, int bufsize);
=head1 DESCRIPTION
ossl_cmp_statusinfo_new() creates a new PKIStatusInfo structure and fills it
with the given values. It sets the status field to B<status>.
If B<text> is not NULL, it is copied to statusString.
B<fail_info> is is interpreted as bit pattern for the failInfo field.
Returns a pointer to the structure on success, or NULL on error.
ossl_cmp_pkisi_pkistatus_get() returns the PKIStatus of B<si>, or -1 on error.
ossl_cmp_pkisi_pkifailureinfo_get() returns the PKIFailureInfo bits
of B<si>, encoded as integer, or -1 on error.
ossl_cmp_pkisi_pkifailureinfo_check() returns the state of the bit (0 or 1)
with index B<bit_index> in the PKIFailureInfo of the B<si>, or -1 on error.
ossl_cmp_pkisi_failinfo_get0() returns a direct pointer to the failInfo
field contained in B<si>, or NULL on error.
ossl_cmp_pkisi_statusstring_get0() returns a direct pointer to the statusString
field contained in B<si>.
ossl_pkisi_snprint() places at max B<bufsize> characters of human-readable
error string of B<si> in pre-allocated B<buf>. Returns pointer to the same
B<buf> containing the string, or NULL on error.
=head1 NOTES
CMP is defined in RFC 4210 (and CRMF in RFC 4211).
=head1 RETURN VALUES
See the individual functions above.
=head1 SEE ALSO
L<OSSL_CMP_CTX_new(3)>, L<ossl_cmp_certreq_new(3)>
=head1 HISTORY
The OpenSSL CMP support was added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
@@ -32,7 +32,7 @@ thread local variable and then register a stop handler. When the thread is
stopping the stop handler is called (while on that thread) and the code can
clean up the value stored in the thread local variable.
A new stop handler is registerd using the function ossl_init_thread_start().
A new stop handler is registered using the function ossl_init_thread_start().
The I<index> parameter should be a unique value that can be used to identify a
set of common stop handlers and is passed in a later call to
ossl_init_thread_deregister. If no later call to ossl_init_thread_deregister is
+29 -11
View File
@@ -2,8 +2,8 @@
=head1 NAME
ossl_namemap_new, ossl_namemap_free, ossl_namemap_stored,
ossl_namemap_add, ossl_namemap_add_n,
ossl_namemap_new, ossl_namemap_free, ossl_namemap_stored, ossl_namemap_empty,
ossl_namemap_add_name, ossl_namemap_add_name_n, ossl_namemap_add_names,
ossl_namemap_name2num, ossl_namemap_name2num_n,
ossl_namemap_doall_names
- internal number E<lt>-E<gt> name map
@@ -16,10 +16,11 @@ ossl_namemap_doall_names
OSSL_NAMEMAP *ossl_namemap_new(void);
void ossl_namemap_free(OSSL_NAMEMAP *namemap);
int ossl_namemap_empty(OSSL_NAMEMAP *namemap);
int ossl_namemap_add(OSSL_NAMEMAP *namemap, int number, const char *name);
int ossl_namemap_add_n(OSSL_NAMEMAP *namemap, int number,
const char *name, size_t name_len);
int ossl_namemap_add_name(OSSL_NAMEMAP *namemap, int number, const char *name);
int ossl_namemap_add_name_n(OSSL_NAMEMAP *namemap, int number,
const char *name, size_t name_len);
int ossl_namemap_name2num(const OSSL_NAMEMAP *namemap, const char *name);
int ossl_namemap_name2num_n(const OSSL_NAMEMAP *namemap,
@@ -28,6 +29,9 @@ ossl_namemap_doall_names
void (*fn)(const char *name, void *data),
void *data);
int ossl_namemap_add_names(OSSL_NAMEMAP *namemap, int number,
const char *names, const char separator);
=head1 DESCRIPTION
A B<OSSL_NAMEMAP> is a one-to-many number E<lt>-E<gt> names map, which
@@ -40,12 +44,15 @@ new B<OSSL_NAMEMAP>.
This is suitable to use when the B<OSSL_NAMEMAP> is embedded in other
structures, or should be independent for any reason.
ossl_namemap_empty() checks if the given B<OSSL_NAMEMAP> is empty or
not.
ossl_namemap_stored() finds or auto-creates the default namemap in the
given library context.
The returned B<OSSL_NAMEMAP> can't be destructed using
ossl_namemap_free().
ossl_namemap_add() adds a new name to the namemap if it's not already
ossl_namemap_add_name() adds a new name to the namemap if it's not already
present.
If the given I<number> is zero, a new number will be allocated to
identify this I<name>.
@@ -55,25 +62,33 @@ names already associated with that number.
ossl_namemap_name2num() finds the number corresponding to the given
I<name>.
ossl_namemap_add_n() and ossl_namemap_name2num_n() do the same thing
as ossl_namemap_add() and ossl_namemap_name2num(), but take a string
ossl_namemap_add_name_n() and ossl_namemap_name2num_n() do the same thing
as ossl_namemap_add_name() and ossl_namemap_name2num(), but take a string
length I<name_len> as well, allowing the caller to use a fragment of
a string as a name.
ossl_namemap_doall_names() walks through all names associated with
I<number> in the given I<namemap> and calls the function I<fn> for
each of them.
I<fn> is also passed the I<data> argument, which allows any caller to
pass extra data for that function to use.
ossl_namemap_add_names() divides up a set of names given in I<names>,
separated by I<separator>, and adds each to the I<namemap>, all with
the same number. If some of them already exist in the I<namemap>,
they must all have the same associated number, which will be adopted
for any name that doesn't exist yet.
=head1 RETURN VALUES
ossl_namemap_new() and ossl_namemap_stored() return the pointer to a
B<OSSL_NAMEMAP>, or NULL on error.
ossl_namemap_add() and ossl_namemap_add_n() return the number associated
with the added string, or zero on error.
ossl_namemap_empty() returns 1 if the B<OSSL_NAMEMAP> is NULL or
empty, or 0 if it's not empty.
ossl_namemap_add_name() and ossl_namemap_add_name_n() return the number
associated with the added string, or zero on error.
ossl_namemap_num2names() returns a pointer to a NULL-terminated list of
pointers to the names corresponding to the given number, or NULL if
@@ -83,6 +98,9 @@ ossl_namemap_name2num() and ossl_namemap_name2num_n() return the number
corresponding to the given name, or 0 if it's undefined in the given
B<OSSL_NAMEMAP>.
ossl_namemap_add_names() returns the number associated with the added
names, or zero on error.
=head1 NOTES
The result from ossl_namemap_num2names() isn't thread safe, other threads
+1 -1
View File
@@ -178,7 +178,7 @@ public key.
=head1 SEE ALSO
L<OSSL_PARAM_int>, L<OSSL_PARAM>
L<OSSL_PARAM_int(3)>, L<OSSL_PARAM(3)>
=head1 HISTORY
+1 -1
View File
@@ -261,7 +261,7 @@ ossl_provider_library_context() return a pointer to the library context.
This may be NULL, and is perfectly valid, as it denotes the default
global library context.
ossl_provider_teardown() doesnt't return any value.
ossl_provider_teardown() doesn't return any value.
ossl_provider_gettable_params() returns a pointer to a constant
I<OSSL_PARAM> array if this function is available in the provider,
+75
View File
@@ -0,0 +1,75 @@
=pod
=head1 NAME
rsa_set0_all_params, rsa_get0_all_params
- Internal routines for getting and setting data in an RSA object
=head1 SYNOPSIS
#include "crypto/rsa.h"
int rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
STACK_OF(BIGNUM_const) *exps,
STACK_OF(BIGNUM_const) *coeffs);
int rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
const STACK_OF(BIGNUM) *exps,
const STACK_OF(BIGNUM) *coeffs);
=head1 DESCRIPTION
rsa_set0_all_params() sets all primes, CRT exponents and CRT coefficients
in the B<RSA> object I<r> to the contents of the stacks of BIGNUMs I<primes>,
I<exps> and I<coeffs>. The B<RSA> object takes ownership of the BIGNUMs,
but not of the stacks.
rsa_get0_all_params() gets all primes, CRT exponents and CRT coefficients
in the B<RSA> object I<r> and pushes them on the stacks of constant BIGNUMs
I<primes>, I<exps> and I<coeffs>. The B<RSA> object retains ownership of the
BIGNUMs, but not of the stacks.
=head1 NOTES
For RSA_set0_all_params() and RSA_get0_all_params():
=over 4
=item *
the I<primes> stack contains I<p>, I<q>, and then the rest of the primes
if the B<RSA> object is a multi-prime RSA key.
=item *
the I<exps> stack contains I<dP>, I<dQ>, and then the rest of the exponents
if the B<RSA> object is a multi-prime RSA key.
=item *
the I<coeffs> stack contains I<qInv>, and then the rest of the coefficients
if the B<RSA> object is a multi-prime RSA key.
=back
The number of primes must always be equal to the number of exponents, and
the number of coefficients must be one less than the number of primes.
=head1 RETURN VALUES
rsa_get0_all_params() and rsa_set0_all_params() return 1 on success, or
0 on failure.
=head1 SEE ALSO
L<RSA_set0_multi_prime_params(3)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+149
View File
@@ -0,0 +1,149 @@
=pod
=head1 NAME
VERSION - OpenSSL version information
=head1 SYNOPSIS
MAJOR=3
MINOR=0
PATCH=0
PRE_RELEASE_TAG=dev
BUILD_METADATA=
RELEASE_DATE=
SHLIB_VERSION=3
=head1 DESCRIPTION
This file is a set of keyed information looking like simple variable
assignments. When given an empty value, they are seen as unassigned.
The keys that are recognised are:
=over 4
=item B<MAJOR>, B<MINOR>, B<PATCH>
The three parts of OpenSSL's 3 numbered version number, MAJOR.MINOR.PATCH.
These are used to compose the values for the C macros B<OPENSSL_VERSION_MAJOR>,
B<OPENSSL_VERSION_MINOR>, B<OPENSSL_VERSION_PACTH>.
=item B<PRE_RELEASE_TAG>
This is the added pre-release tag, which is added to the version separated by
a dash. For a value C<foo>, the C macro B<OPENSSL_VERSION_PRE_RELEASE> gets
the string C<-foo> (dash added).
=item B<BUILD_METADATA>
Extra metadata to be used by anyone for their own purposes. This is added to
the version and possible pre-release tag, separated by a plus sign. For a
value C<bar>, the C macro B<OPENSSL_VERSION_BUILD_METADATA> gets the string
C<+bar>.
=item B<RELEASE_DATE>
Defined in releases. When not set, it gets the value C<xx XXX xxxx>.
=item B<SHLIB_VERSION>
The shared library version, which is something other than the project version.
=back
It is a configuration error if B<MAJOR>, B<MINOR>, B<PATCH> and B<SHLIB_VERSION>
don't have values. Configuration will stop in that case.
=head2 Affected configuration data
The following items in %config from F<configdata.pm> are affected:
=over 4
=item $config{major}, $config{minor}, $config{patch}, $config{shlib_version}
These items get their values from B<MAJOR>, B<MINOR>, B<PATCH>, and
B<SHLIB_VERSION>, respectively.
=item $config{prerelease}
If B<PRERELEASE> is assigned a value, $config{prerelease} gets that same value,
prefixed by a dash, otherwise the empty string.
=item $config{build_metadata}
If B<BUILD_METADATA> is assigned a value, $config{build_metadata} gets that same
value, prefixed by a plus sign, otherwise the empty string.
=item $config{release_date}
If B<RELEASE_DATE> is assigned a value, $config{release_date} gets that same
value, otherwise the string C<xx XXX yyyy>.
=item $config{version}
The minimal version number, a string composed from B<MAJOR>, B<MINOR> and
B<PATCH>, separated by periods. For C<MAJOR=3>, C<MINOR=0> and C<PATCH=0>,
the string will be C<3.0.0>.
=item $config{full_version}
The fully loaded version number, a string composed from $config{version},
$config{prerelease} and $config{build_metadata}. See See L</EXAMPLES> for
a few examples.
=back
=head1 EXAMPLES
=over 4
=item 1.
MAJOR=3
MINOR=0
PATCH=0
PRE_RELEASE_TAG=dev
BUILD_METADATA=
The fully loaded version number ($config{full_version}) will be
C<3.0.0-dev>.
=item 2.
MAJOR=3
MINOR=0
PATCH=0
PRE_RELEASE_TAG=
BUILD_METADATA=something
The fully loaded version number ($config{full_version}) will be
C<3.0.0+something>.
=item 3.
MAJOR=3
MINOR=0
PATCH=0
PRE_RELEASE_TAG=alpha3
BUILD_METADATA=something
The fully loaded version number ($config{full_version}) will be
C<3.0.0-alpha3+something>.
=back
=head1 SEE ALSO
L<OpenSSL_version(3)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+2 -2
View File
@@ -73,7 +73,7 @@ generators, and are used to specify exactly what end product files
(programs, libraries, modules or scripts) are to be produced, and from
what sources.
Intermediate files, such as object files, are seldom refered to at
Intermediate files, such as object files, are seldom referred to at
all. They sometimes can be, if there's a need, but this should happen
very rarely, and support for that sort of thing is added on as-needed
basis.
@@ -534,7 +534,7 @@ dependency is maintained:
DEPEND[libfoo.a]{weak}=libfoo.a libcookie.a
This is useful in complex dependecy trees where two libraries can be
This is useful in complex dependency trees where two libraries can be
used as alternatives for each other. In this example, C<lib1.a> and
C<lib2.a> have alternative implementations of the same thing, and
C<libmandatory.a> has unresolved references to that same thing, and is
+84
View File
@@ -0,0 +1,84 @@
DEPEND[]= \
openssl-ca.pod \
openssl-cms.pod \
openssl-crl.pod \
openssl-dgst.pod \
openssl-dhparam.pod \
openssl-dsaparam.pod \
openssl-ecparam.pod \
openssl-enc.pod \
openssl-gendsa.pod \
openssl-genrsa.pod \
openssl-ocsp.pod \
openssl-passwd.pod \
openssl-pkcs12.pod \
openssl-pkcs8.pod \
openssl-pkeyutl.pod \
openssl-rand.pod \
openssl-req.pod \
openssl-rsautl.pod \
openssl-s_client.pod \
openssl-s_server.pod \
openssl-s_time.pod \
openssl-smime.pod \
openssl-speed.pod \
openssl-srp.pod \
openssl-ts.pod \
openssl-verify.pod \
openssl-x509.pod
DEPEND[openssl-ca.pod]=../perlvars.pm
GENERATE[openssl-ca.pod]=openssl-ca.pod.in
DEPEND[openssl-cms.pod]=../perlvars.pm
GENERATE[openssl-cms.pod]=openssl-cms.pod.in
DEPEND[openssl-crl.pod]=../perlvars.pm
GENERATE[openssl-crl.pod]=openssl-crl.pod.in
DEPEND[openssl-dgst.pod]=../perlvars.pm
GENERATE[openssl-dgst.pod]=openssl-dgst.pod.in
DEPEND[openssl-dhparam.pod]=../perlvars.pm
GENERATE[openssl-dhparam.pod]=openssl-dhparam.pod.in
DEPEND[openssl-dsaparam.pod]=../perlvars.pm
GENERATE[openssl-dsaparam.pod]=openssl-dsaparam.pod.in
DEPEND[openssl-ecparam.pod]=../perlvars.pm
GENERATE[openssl-ecparam.pod]=openssl-ecparam.pod.in
DEPEND[openssl-enc.pod]=../perlvars.pm
GENERATE[openssl-enc.pod]=openssl-enc.pod.in
DEPEND[openssl-gendsa.pod]=../perlvars.pm
GENERATE[openssl-gendsa.pod]=openssl-gendsa.pod.in
DEPEND[openssl-genrsa.pod]=../perlvars.pm
GENERATE[openssl-genrsa.pod]=openssl-genrsa.pod.in
DEPEND[openssl-ocsp.pod]=../perlvars.pm
GENERATE[openssl-ocsp.pod]=openssl-ocsp.pod.in
DEPEND[openssl-passwd.pod]=../perlvars.pm
GENERATE[openssl-passwd.pod]=openssl-passwd.pod.in
DEPEND[openssl-pkcs8.pod]=../perlvars.pm
GENERATE[openssl-pkcs8.pod]=openssl-pkcs8.pod.in
DEPEND[openssl-pkcs12.pod]=../perlvars.pm
GENERATE[openssl-pkcs12.pod]=openssl-pkcs12.pod.in
DEPEND[openssl-pkeyutl.pod]=../perlvars.pm
GENERATE[openssl-pkeyutl.pod]=openssl-pkeyutl.pod.in
DEPEND[openssl-rand.pod]=../perlvars.pm
GENERATE[openssl-rand.pod]=openssl-rand.pod.in
DEPEND[openssl-req.pod]=../perlvars.pm
GENERATE[openssl-req.pod]=openssl-req.pod.in
DEPEND[openssl-rsautl.pod]=../perlvars.pm
GENERATE[openssl-rsautl.pod]=openssl-rsautl.pod.in
DEPEND[openssl-s_client.pod]=../perlvars.pm
GENERATE[openssl-s_client.pod]=openssl-s_client.pod.in
DEPEND[openssl-s_server.pod]=../perlvars.pm
GENERATE[openssl-s_server.pod]=openssl-s_server.pod.in
DEPEND[openssl-s_time.pod]=../perlvars.pm
GENERATE[openssl-s_time.pod]=openssl-s_time.pod.in
DEPEND[openssl-smime.pod]=../perlvars.pm
GENERATE[openssl-smime.pod]=openssl-smime.pod.in
DEPEND[openssl-speed.pod]=../perlvars.pm
GENERATE[openssl-speed.pod]=openssl-speed.pod.in
DEPEND[openssl-srp.pod]=../perlvars.pm
GENERATE[openssl-srp.pod]=openssl-srp.pod.in
DEPEND[openssl-ts.pod]=../perlvars.pm
GENERATE[openssl-ts.pod]=openssl-ts.pod.in
DEPEND[openssl-verify.pod]=../perlvars.pm
GENERATE[openssl-verify.pod]=openssl-verify.pod.in
DEPEND[openssl-x509.pod]=../perlvars.pm
GENERATE[openssl-x509.pod]=openssl-x509.pod.in
+2 -2
View File
@@ -39,8 +39,8 @@ Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
The input format. B<DER> is binary format and B<PEM> (the default) is base64
encoded.
The input format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-in> I<filename>
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -47,17 +48,17 @@ B<openssl> B<ca>
[B<-msie_hack>]
[B<-extensions> I<section>]
[B<-extfile> I<section>]
[B<-engine> I<id>]
[B<-subj> I<arg>]
[B<-utf8>]
[B<-sigopt> I<nm>:I<v>]
[B<-create_serial>]
[B<-rand_serial>]
[B<-multivalue-rdn>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-sm2-id> I<string>]
[B<-sm2-hex-id> I<hex-string>]
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
[I<certreq>...]
=for openssl ifdef engine sm2-id sm2-hex-id
@@ -65,8 +66,11 @@ B<openssl> B<ca>
This command is a minimal CA application. It can be used
to sign certificate requests in a variety of forms and generate
CRLs it also maintains a text database of issued certificates
CRLs. It also maintains a text database of issued certificates
and their status.
When signing certificates, a single certificate request can be specified
with the B<-in> option, or multiple requests can be processed by
specifying a set of B<certreq> files after all options.
The options descriptions will be divided into each purpose.
@@ -135,8 +139,8 @@ The private key to sign requests with.
=item B<-keyform> B<DER>|B<PEM>
The format of the data in the private key file.
The default is PEM.
The format of the private key file; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-sigopt> I<nm>:I<v>
@@ -249,13 +253,6 @@ An additional configuration file to read certificate extensions from
(using the default section unless the B<-extensions> option is also
used).
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause B<ca>
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.
=item B<-subj> I<arg>
Supersedes subject name given in the request.
@@ -294,10 +291,6 @@ C</DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe>
If B<-multi-rdn> is not used then the UID value is C<123456+CN=John Doe>.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-sm2-id> I<string>
Specify the ID string to use when verifying an SM2 certificate. The ID string is
@@ -308,6 +301,10 @@ required by the SM2 signature algorithm for signing and verification.
Specify a binary ID string to use when signing or verifying using an SM2
certificate. The argument for this option is string of hexadecimal digits.
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 CRL OPTIONS
@@ -440,7 +437,8 @@ CA private key. Mandatory.
=item B<RANDFILE>
At startup the specified file is loaded into the random number generator,
and at exit 256 bytes will be written to it.
and at exit 256 bytes will be written to it. (Note: Using a RANDFILE is
not necessary anymore, see the L</HISTORY> section.
=item B<default_days>
@@ -648,7 +646,6 @@ A sample configuration file with the relevant sections for this command:
serial = $dir/serial # serial no file
#rand_serial = yes # for random serial#'s
private_key = $dir/private/cakey.pem# CA private key
RANDFILE = $dir/private/.rand # random number file
default_days = 365 # how long to certify for
default_crl_days= 30 # how long before next CRL
@@ -684,7 +681,6 @@ The values below reflect the default values.
./demoCA/index.txt - CA text database file
./demoCA/index.txt.old - CA text database backup file
./demoCA/certs - certificate output file
./demoCA/.rnd - CA random seed information
=head1 RESTRICTIONS
@@ -761,6 +757,11 @@ B<-enddate> and B<-days>) will be encoded as UTCTime if the dates are
earlier than year 2049 (included), and as GeneralizedTime if the dates
are in year 2050 or later.
OpenSSL 1.1.1 introduced a new random generator (CSPRNG) with an improved
seeding mechanism. The new seeding mechanism makes it unnecessary to
define a RANDFILE for saving and restoring randomness. This option is
retained mainly for compatibility reasons.
=head1 SEE ALSO
L<openssl(1)>,
+1 -1
View File
@@ -149,7 +149,7 @@ cipher list in order of encryption algorithm key length.
The cipher string B<@SECLEVEL>=I<n> can be used at any point to set the security
level to I<n>, which should be a number between zero and five, inclusive.
See L<SSL_CTX_set_security_level> for a description of what each level means.
See L<SSL_CTX_set_security_level(3)> for a description of what each level means.
The cipher list can be prefixed with the B<DEFAULT> keyword, which enables
the default cipher list as defined below. Unlike cipher strings,
+1 -1
View File
@@ -149,7 +149,7 @@ cipher list in order of encryption algorithm key length.
The cipher string B<@SECLEVEL>=I<n> can be used at any point to set the security
level to I<n>, which should be a number between zero and five, inclusive.
See L<SSL_CTX_set_security_level> for a description of what each level means.
See L<SSL_CTX_set_security_level(3)> for a description of what each level means.
The cipher list can be prefixed with the B<DEFAULT> keyword, which enables
the default cipher list as defined below. Unlike cipher strings,
+4
View File
@@ -2,6 +2,8 @@
=head1 NAME
=for openssl names: openssl-cmds
asn1parse,
ca,
ciphers,
@@ -53,6 +55,8 @@ version,
x509
- OpenSSL application commands
=for comment foreign manuals: apropos(1)
=head1 SYNOPSIS
=for openssl generic
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -25,10 +26,11 @@ B<openssl> B<cms>
[B<-sign_receipt>]
[B<-verify_receipt> I<receipt>]
[B<-in> I<filename>]
[B<-inform> B<DER>|B<PEM>|B<SMIME>]
[B<-rctform> B<DER>|B<PEM>|B<SMIME>]
[B<-out> I<filename>]
[B<-inform> B<DER>|B<PEM>|B<SMIME>]
[B<-outform> B<DER>|B<PEM>|B<SMIME>]
[B<-rctform> B<DER>|B<PEM>|B<SMIME>]
[B<-keyform> B<DER>|B<PEM>|B<ENGINE>]
[B<-stream>]
[B<-indef>]
[B<-noindef>]
@@ -37,10 +39,6 @@ B<openssl> B<cms>
[B<-text>]
[B<-noout>]
[B<-print>]
[B<-CAfile> I<file>]
[B<-CApath> I<dir>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-attime> I<timestamp>]
[B<-check_ss_sig>]
[B<-crl_check>]
@@ -96,11 +94,11 @@ B<openssl> B<cms>
[B<-inkey> I<file>]
[B<-keyopt> I<name>:I<parameter>]
[B<-passin> I<arg>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-to> I<addr>]
[B<-from> I<addr>]
[B<-subject> I<subj>]
{- $OpenSSL::safe::opt_trust_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
[I<cert.pem> ...]
=for openssl ifdef des-wrap engine
@@ -216,33 +214,33 @@ to the B<-verify> operation.
The input message to be encrypted or signed or the message to be decrypted
or verified.
=item B<-inform> B<DER>|B<PEM>|B<SMIME>
This specifies the input format for the CMS structure. The default
is B<SMIME> which reads an S/MIME format message. B<PEM> and B<DER>
format change this to expect PEM and DER format CMS structures
instead. This currently only affects the input format of the CMS
structure, if no CMS structure is being input (for example with
B<-encrypt> or B<-sign>) this option has no effect.
=item B<-rctform> B<DER>|B<PEM>|B<SMIME>
Specify the format for a signed receipt for use with the B<-receipt_verify>
operation.
=item B<-out> I<filename>
The message text that has been decrypted or verified or the output MIME
format message that has been signed or verified.
=item B<-inform> B<DER>|B<PEM>|B<SMIME>
The input format of the CMS structure (if one is being read);
the default is B<SMIME>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>|B<SMIME>
This specifies the output format for the CMS structure. The default
is B<SMIME> which writes an S/MIME format message. B<PEM> and B<DER>
format change this to write PEM and DER format CMS structures
instead. This currently only affects the output format of the CMS
structure, if no CMS structure is being output (for example with
B<-verify> or B<-decrypt>) this option has no effect.
The output format of the CMS structure (if one is being written);
the default is B<SMIME>.
See L<openssl(1)/Format Options> for details.
=item B<-keyform> B<DER>|B<PEM>|B<ENGINE>
The format of the private key file; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-rctform> B<DER>|B<PEM>|B<SMIME>
The signed receipt format for use with the B<-receipt_verify>; the default
is B<SMIME>.
See L<openssl(1)/Format Options> for details.
=item B<-stream>, B<-indef>, B<-noindef>
@@ -285,10 +283,6 @@ structure is being checked.
For the B<-cmsout> operation print out all fields of the CMS structure. This
is mainly useful for testing purposes.
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
See L<openssl(1)/Trusted Certificate Options> for more information.
=item B<-md> I<digest>
Digest algorithm to use when signing or resigning. If not present then the
@@ -461,15 +455,6 @@ or to modify default parameters for ECDH.
The private key password source. For more information about the format of B<arg>
see L<openssl(1)/Pass Phrase Options>.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item I<cert.pem> ...
One or more certificates of message recipients: used when encrypting
a message.
=item B<-to>, B<-from>, B<-subject>
The relevant mail headers. These are included outside the signed
@@ -488,6 +473,15 @@ B<-verify_ip>, B<-verify_name>, B<-x509_strict>
Set various certificate chain validation options. See the
L<openssl-verify(1)> manual page for details.
{- $OpenSSL::safe::opt_trust_item -}
{- $OpenSSL::safe::opt_r_item -}
=item I<cert.pem> ...
One or more certificates of message recipients: used when encrypting
a message.
=back
=head1 NOTES
@@ -738,6 +732,10 @@ the list of permitted ciphers in a database and only use those.
No revocation checking is done on the signer's certificate.
=head1 SEE ALSO
L<ossl_store-file(7)>
=head1 HISTORY
The use of multiple B<-signer> options and the B<-resign> command were first
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -10,19 +11,17 @@ B<openssl> B<crl>
[B<-help>]
[B<-inform> B<DER>|B<PEM>]
[B<-outform> B<DER>|B<PEM>]
[B<-keyform> B<DER>|B<PEM>|B<ENGINE>]
[B<-text>]
[B<-in> I<filename>]
[B<-out> I<filename>]
[B<-nameopt> I<option>]
[B<-noout>]
[B<-hash>]
[B<-issuer>]
[B<-lastupdate>]
[B<-nextupdate>]
[B<-CAfile> I<file>]
[B<-CApath> I<dir>]
[B<-no-CAfile>]
[B<-no-CApath>]
{- $OpenSSL::safe::opt_name_synopsis -}
{- $OpenSSL::safe::opt_trust_synopsis -}
=for openssl ifdef hash_old
@@ -38,16 +37,15 @@ This command processes CRL files in DER or PEM format.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format. B<DER> format is DER encoded CRL
structure. B<PEM> (the default) is a base64 encoded version of
the DER form with header and footer lines.
The input and output formats of the CRL; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
=item B<-keyform> B<DER>|B<PEM>|B<ENGINE>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
The format of the private key file; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-in> I<filename>
@@ -63,11 +61,6 @@ default.
Print out the CRL in text form.
=item B<-nameopt> I<option>
Option which determines how the subject or issuer names are displayed. See
the description of B<-nameopt> in L<openssl-x509(1)>.
=item B<-noout>
Don't output the encoded version of the CRL.
@@ -94,19 +87,12 @@ Output the lastUpdate field.
Output the nextUpdate field.
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
{- $OpenSSL::safe::opt_name_item -}
See L<openssl(1)/Trusted Certificate Options> for more information.
{- $OpenSSL::safe::opt_trust_item -}
=back
=head1 NOTES
The PEM CRL format uses the header and footer lines:
-----BEGIN X509 CRL-----
-----END X509 CRL-----
=head1 EXAMPLES
Convert a CRL file from PEM to DER:
@@ -127,7 +113,8 @@ and files too.
L<openssl(1)>,
L<openssl-crl2pkcs7(1)>,
L<openssl-ca(1)>,
L<openssl-x509(1)>
L<openssl-x509(1)>,
L<ossl_store-file(7)>
=head1 COPYRIGHT
+4 -6
View File
@@ -31,15 +31,13 @@ Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
This specifies the CRL input format. B<DER> format is DER encoded CRL
structure.B<PEM> (the default) is a base64 encoded version of
the DER form with header and footer lines. The default format is PEM.
The input format of the CRL; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
This specifies the PKCS#7 structure output format. B<DER> format is DER
encoded PKCS#7 structure.B<PEM> (the default) is a base64 encoded version of
the DER form with header and footer lines. The default format is PEM.
The output format of the PKCS#7 object; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-in> I<filename>
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -11,12 +12,13 @@ B<openssl> B<dgst>|I<digest>
[B<-help>]
[B<-c>]
[B<-d>]
[B<-list>]
[B<-hex>]
[B<-binary>]
[B<-r>]
[B<-out> I<filename>]
[B<-sign> I<filename>]
[B<-keyform> I<arg>]
[B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
[B<-passin> I<arg>]
[B<-verify> I<filename>]
[B<-prverify> I<filename>]
@@ -24,10 +26,9 @@ B<openssl> B<dgst>|I<digest>
[B<-sigopt> I<nm>:I<v>]
[B<-hmac> I<key>]
[B<-fips-fingerprint>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-engine> I<id>]
[B<-engine_impl>]
{- $OpenSSL::safe::opt_engine_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
[I<file> ...]
=head1 DESCRIPTION
@@ -64,6 +65,10 @@ the B<-hex> option is given as well.
Print out BIO debugging information.
=item B<-list>
Prints out a list of supported message digests.
=item B<-hex>
Digest is to be output as a hex dump. This is the default case for a "normal"
@@ -89,10 +94,10 @@ Digitally sign the digest using the private key in "filename". Note this option
does not support Ed25519 or Ed448 private keys. Use the L<openssl-pkeyutl(1)>
command instead for this.
=item B<-keyform> I<arg>
=item B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
Specifies the key format to sign digest with. The DER, PEM, P12,
and ENGINE formats are supported.
The format of the key to sign with; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-sigopt> I<nm>:I<v>
@@ -159,26 +164,21 @@ for example exactly 32 chars for gost-mac.
The L<openssl-mac(1)> command should be preferred to using this command line
option.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-fips-fingerprint>
Compute HMAC using a specific key for certain OpenSSL-FIPS operations.
=item B<-engine> I<id>
Use engine I<id> for operations (including private key storage).
This engine is not used as source for digest algorithms, unless it is
also specified in the configuration file or B<-engine_impl> is also
specified.
=item B<-engine_impl>
When used with the B<-engine> option, it specifies to also use
engine I<id> for digest operations.
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
The engine is not used for digests unless the B<-engine_impl> option is
used or it is configured to do so, see L<config(5)/Engine Configuration Module>.
=item I<file> ...
File or files to digest. If no files are specified then standard input is
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -20,9 +21,8 @@ B<openssl dhparam>
[B<-2>]
[B<-3>]
[B<-5>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
[I<numbits>]
=for openssl ifdef dsaparam engine
@@ -39,17 +39,11 @@ This command is used to manipulate DH parameter files.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format. The B<DER> 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 B<DER> format base64 encoded with
additional header and footer lines.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
The input format and output format; the default is B<PEM>.
The object is compatible with the PKCS#3 B<DHparameter> structure.
See L<openssl(1)/Format Options> for details.
=item B<-in> I<filename>
@@ -86,10 +80,6 @@ input file is ignored and parameters are generated instead. If not
present but I<numbits> is present, parameters are generated with the
default generator 2.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item I<numbits>
This option specifies that a parameter set should be generated of size
@@ -112,12 +102,9 @@ This option prints out the DH parameters in human readable form.
This option converts the parameters into C code. The parameters can then
be loaded by calling the get_dhNNNN() function.
=item B<-engine> I<id>
{- $OpenSSL::safe::opt_engine_item -}
Specifying an engine (by its unique I<id> string) will cause B<dhparam>
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.
{- $OpenSSL::safe::opt_r_item -}
=back
@@ -130,11 +117,6 @@ may have different purposes in future versions of OpenSSL.
=head1 NOTES
PEM format DH parameters use the header and footer lines:
-----BEGIN DH PARAMETERS-----
-----END DH PARAMETERS-----
OpenSSL currently only supports the older PKCS#3 DH, not the newer X9.42
DH.
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-dsa - DSA key processing
@@ -31,7 +36,7 @@ B<openssl> B<dsa>
[B<-modulus>]
[B<-pubin>]
[B<-pubout>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef pvk-string pvk-weak pvk-none engine
@@ -50,22 +55,16 @@ applications should use the more secure PKCS#8 format using the B<pkcs8>
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format. The B<DER> option with a private key uses
an ASN1 DER encoded form of an ASN.1 SEQUENCE consisting of the values of
version (currently zero), p, q, g, the public and private key components
respectively as ASN.1 INTEGERs. When used with a public key it uses a
SubjectPublicKeyInfo structure: it is an error if the key is not DSA.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
The B<PEM> form is the default format: it consists of the B<DER> format base64
encoded with additional header and footer lines. In the case of a private key
PKCS#8 format is also accepted.
Private keys are a sequence of B<ASN.1 INTEGERS>: the version (zero), B<p>,
B<q>, B<g>, and the public and and private key components. Public keys
are a B<SubjectPublicKeyInfo> structure with the B<DSA> type.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
The B<PEM> format also accepts PKCS#8 data.
=item B<-in> I<filename>
@@ -119,27 +118,10 @@ 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.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause L<openssl-dsa(1)>
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.
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 NOTES
The PEM private key format uses the header and footer lines:
-----BEGIN DSA PRIVATE KEY-----
-----END DSA PRIVATE KEY-----
The PEM public key format uses the header and footer lines:
-----BEGIN PUBLIC KEY-----
-----END PUBLIC KEY-----
=head1 EXAMPLES
To remove the pass phrase on a DSA private key:
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -15,17 +16,19 @@ B<openssl dsaparam>
[B<-noout>]
[B<-text>]
[B<-C>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-genkey>]
[B<-engine> I<id>]
[B<-verbose>]
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
[I<numbits>]
=head1 DESCRIPTION
This command is used to manipulate or generate DSA parameter files.
DSA parameter generation can be a slow process and as a result the same set of
DSA parameters is often used to generate several distinct keys.
=head1 OPTIONS
=over 4
@@ -34,17 +37,13 @@ This command is used to manipulate or generate DSA parameter files.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format. The B<DER> option uses an ASN1 DER encoded
form compatible with RFC2459 (PKIX) DSS-Parms that is a SEQUENCE consisting
of p, q and g respectively. The PEM form is the default format: it consists
of the B<DER> format base64 encoded with additional header and footer lines.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
Parameters are a sequence of B<ASN.1 INTEGER>s: B<p>, B<q>, and B<g>.
This is compatible with RFC 2459 B<DSS-Parms> structure.
=item B<-in> I<filename>
@@ -76,21 +75,15 @@ be loaded by calling the get_dsaXXX() function.
This option will generate a DSA either using the specified or generated
parameters.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-verbose>
Print extra details about the operations being performed.
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=item I<numbits>
This option specifies that a parameter set should be generated of size
@@ -99,16 +92,6 @@ the input file (if any) is ignored.
=back
=head1 NOTES
PEM format DSA parameters use the header and footer lines:
-----BEGIN DSA PARAMETERS-----
-----END DSA PARAMETERS-----
DSA parameter generation is a slow process and as a result the same set of
DSA parameters is often used to generate several distinct keys.
=head1 SEE ALSO
L<openssl(1)>,
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-ec - EC key processing
@@ -26,7 +31,7 @@ B<openssl> B<ec>
[B<-param_enc> I<arg>]
[B<-no_public>]
[B<-check>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine
@@ -46,19 +51,13 @@ PKCS#8 private key format use the L<openssl-pkcs8(1)> command.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format. The B<DER> option with a private key uses
an ASN.1 DER encoded SEC1 private key. When used with a public key it
uses the SubjectPublicKeyInfo structure as specified in RFC 3280.
The B<PEM> form is the default format: it consists of the B<DER> format base64
encoded with additional header and footer lines. In the case of a private key
PKCS#8 format is also accepted.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
Private keys are an SEC1 private key or PKCS#8 format.
Public keys are a B<SubjectPublicKeyInfo> as specified in IETF RFC 3280.
=item B<-in> I<filename>
@@ -137,27 +136,10 @@ This option omits the public key components from the private key output.
This option checks the consistency of an EC private or public key.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 NOTES
The PEM private key format uses the header and footer lines:
-----BEGIN EC PRIVATE KEY-----
-----END EC PRIVATE KEY-----
The PEM public key format uses the header and footer lines:
-----BEGIN PUBLIC KEY-----
-----END PUBLIC KEY-----
=head1 EXAMPLES
To encrypt a private key using triple DES:
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -22,10 +23,9 @@ B<openssl ecparam>
[B<-conv_form> I<arg>]
[B<-param_enc> I<arg>]
[B<-no_seed>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-genkey>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
=for openssl ifdef engine
@@ -33,6 +33,9 @@ B<openssl ecparam>
This command is used to manipulate or generate EC parameter files.
OpenSSL is currently not able to generate new groups and therefore
this command can only create EC parameters from known (named) curves.
=head1 OPTIONS
=over 4
@@ -41,17 +44,12 @@ This command is used to manipulate or generate EC parameter files.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format. The B<DER> option uses an ASN.1 DER encoded
form compatible with RFC 3279 EcpkParameters. The PEM form is the default
format: it consists of the B<DER> format base64 encoded with additional
header and footer lines.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
Parameters are encoded as B<EcpkParameters> as specified in IETF RFC 3279.
=item B<-in> I<filename>
@@ -124,29 +122,12 @@ is included in the ECParameters structure (see RFC 3279).
This option will generate an EC private key using the specified parameters.
=item B<-rand> I<files>, B<-writerand> I<file>
{- $OpenSSL::safe::opt_engine_item -}
See L<openssl(1)/Random State Options> for more information.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause B<ecparam>
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.
{- $OpenSSL::safe::opt_r_item -}
=back
=head1 NOTES
PEM format EC parameters use the header and footer lines:
-----BEGIN EC PARAMETERS-----
-----END EC PARAMETERS-----
OpenSSL is currently not able to generate new groups and therefore
B<openssl ecparam> can only create EC parameters from known (named) curves.
=head1 EXAMPLES
To create EC parameters with the group 'prime192v1':
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -9,6 +10,7 @@ openssl-enc - symmetric cipher routines
B<openssl> B<enc>|I<cipher>
[B<-I<cipher>>]
[B<-help>]
[B<-list>]
[B<-ciphers>]
[B<-in> I<filename>]
[B<-out> I<filename>]
@@ -35,9 +37,8 @@ B<openssl> B<enc>|I<cipher>
[B<-nopad>]
[B<-debug>]
[B<-none>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
=for openssl ifdef z engine
@@ -58,10 +59,14 @@ either by itself or in addition to the encryption or decryption.
Print out a usage message.
=item B<-ciphers>
=item B<-list>
List all supported ciphers.
=item B<-ciphers>
Alias of -list to display all supported ciphers.
=item B<-in> I<filename>
The input filename, standard input by default.
@@ -185,9 +190,9 @@ or zlib-dynamic option.
Use NULL cipher (no encryption or decryption of input).
=item B<-rand> I<files>, B<-writerand> I<file>
{- $OpenSSL::safe::opt_r_item -}
See L<openssl(1)/Random State Options> for more information.
{- $OpenSSL::safe::opt_engine_item -}
=back
@@ -201,8 +206,8 @@ Use the L<openssl-list(1)> command to get a list of supported ciphers.
Engines which provide entirely new encryption algorithms (such as the ccgost
engine which provides gost89 algorithm) should be configured in the
configuration file. Engines specified on the command line using -engine
options can only be used for hardware-assisted implementations of
configuration file. Engines specified on the command line using B<-engine>
option can only be used for hardware-assisted implementations of
ciphers which are supported by the OpenSSL core or another engine specified
in the configuration file.
@@ -411,6 +416,10 @@ certain parameters. So if, for example, you want to use RC2 with a
The default digest was changed from MD5 to SHA256 in OpenSSL 1.1.0.
The B<-list> option was added in OpenSSL 1.1.1e.
The B<-ciphers> option was deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
+25
View File
@@ -16,6 +16,9 @@ B<openssl fipsinstall>
[B<-verify>]
[B<-mac_name> I<macname>]
[B<-macopt> I<nm>:I<v>]
[B<-noout>]
[B<-corrupt_desc> I<selftest_description>]
[B<-corrupt_type> I<selftest_type>]
=head1 DESCRIPTION
@@ -106,6 +109,20 @@ C<openssl list -digest-commands>.
=back
=item B<-noout>
Disable logging of the self tests.
=item B<-corrupt_desc> I<selftest_description>
=item B<-corrupt_type> I<selftest_type>
The corrupt options can be used to test failure of one or more self test(s) by
name.
Either option or both may be used to select the self test(s) to corrupt.
Refer to the entries for "st-desc" and "st-type" in L<OSSL_PROVIDER-FIPS(7)> for
values that can be used.
=back
=head1 EXAMPLES
@@ -123,6 +140,13 @@ Verify that the configuration file F<fips.conf> contains the correct info:
-section_name fips_install -mac_name HMAC -macopt digest:SHA256 \
-macopt hexkey:000102030405060708090A0B0C0D0E0F10111213 -verify
Corrupt any self tests which have the description 'SHA1':
openssl fipsinstall -module ./fips.so -out fips.conf -provider_name fips \
-section_name fipsinstall -mac_name HMAC -macopt digest:SHA256 \
-macopt hexkey:000102030405060708090A0B0C0D0E0F10111213 \
-corrupt_desc', 'SHA1'
=head1 NOTES
The MAC mechanisms that are available will depend on the options
@@ -132,6 +156,7 @@ The command C<openssl list -mac-algorithms> command can be used to list them.
=head1 SEE ALSO
L<fips_config(5)>,
L<OSSL_PROVIDER-FIPS(7)>,
L<EVP_MAC(3)>
=head1 COPYRIGHT
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -21,10 +22,9 @@ B<openssl> B<gendsa>
[B<-des>]
[B<-des3>]
[B<-idea>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-engine> I<id>]
[B<-verbose>]
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
[I<paramfile>]
=for openssl ifdef engine
@@ -53,21 +53,14 @@ 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.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-verbose>
Print extra details about the operations being performed.
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=item I<paramfile>
The DSA parameter file to use. The parameters in this file determine
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-genpkey - generate a private key
@@ -12,12 +17,12 @@ B<openssl> B<genpkey>
[B<-outform> B<DER>|B<PEM>]
[B<-pass> I<arg>]
[B<-I<cipher>>]
[B<-engine> I<id>]
[B<-paramfile> I<file>]
[B<-algorithm> I<alg>]
[B<-pkeyopt> I<opt>:I<value>]
[B<-genparam>]
[B<-text>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine
@@ -40,7 +45,8 @@ standard output is used.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format DER or PEM. The default format is PEM.
The output format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-pass> I<arg>
@@ -52,14 +58,6 @@ see L<openssl(1)/Pass Phrase Options>.
This option encrypts the private key with the supplied cipher. Any algorithm
name accepted by EVP_get_cipherbyname() is acceptable such as B<des3>.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-algorithm> I<alg>
Public key algorithm to use such as RSA, DSA or DH. If used this option must
@@ -104,6 +102,8 @@ are mutually exclusive.
Print an (unencrypted) text representation of private and public keys and
parameters along with the PEM or DER structure.
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 KEY GENERATION OPTIONS
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -23,11 +24,10 @@ B<openssl> B<genrsa>
[B<-des3>]
[B<-idea>]
[B<-f4>|B<-3>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-engine> I<id>]
[B<-primes> I<num>]
[B<-verbose>]
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
[B<numbits>]
=for openssl ifdef engine
@@ -65,17 +65,6 @@ for if it is not supplied via the B<-passout> argument.
The public exponent to use, either 65537 or 3. The default is 65537.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-primes> I<num>
Specify the number of primes to use while generating the RSA key. The I<num>
@@ -87,6 +76,10 @@ RSA key, which is defined in RFC 8017.
Print extra details about the operations being performed.
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=item B<numbits>
The size of the private key to generate in bits. This must be the last option
+8 -8
View File
@@ -83,7 +83,7 @@ To see the list of supported digests, use the command I<list -digest-commands>.
Specifies the name of a supported KDF algorithm which will be used.
The supported algorithms names include TLS1-PRF, HKDF, SSKDF, PBKDF2,
SSHKDF, X942KDF, X963KDF and id-scrypt.
SSHKDF, X942KDF, X963KDF and SCRYPT.
=back
@@ -91,35 +91,35 @@ SSHKDF, X942KDF, X963KDF and id-scrypt.
Use TLS1-PRF to create a hex-encoded derived key from a secret key and seed:
openssl kdf -keylen 16 -kdfopt digest:SHA256 -kdfopt key:secret \
openssl kdf -keylen 16 -kdfopt digest:SHA2-256 -kdfopt key:secret \
-kdfopt seed:seed TLS1-PRF
Use HKDF to create a hex-encoded derived key from a secret key, salt and info:
openssl kdf -keylen 10 -kdfopt digest:SHA256 -kdfopt key:secret \
openssl kdf -keylen 10 -kdfopt digest:SHA2-256 -kdfopt key:secret \
-kdfopt salt:salt -kdfopt info:label HKDF
Use SSKDF with KMAC to create a hex-encoded derived key from a secret key, salt and info:
openssl kdf -keylen 64 -kdfopt mac:KMAC128 -kdfopt maclen:20 \
openssl kdf -keylen 64 -kdfopt mac:KMAC-128 -kdfopt maclen:20 \
-kdfopt hexkey:b74a149a161545 -kdfopt hexinfo:348a37a2 \
-kdfopt hexsalt:3638271ccd68a2 SSKDF
Use SSKDF with HMAC to create a hex-encoded derived key from a secret key, salt and info:
openssl kdf -keylen 16 -kdfopt mac:HMAC -kdfopt digest:SHA256 \
openssl kdf -keylen 16 -kdfopt mac:HMAC -kdfopt digest:SHA2-256 \
-kdfopt hexkey:b74a149a -kdfopt hexinfo:348a37a2 \
-kdfopt hexsalt:3638271c SSKDF
Use SSKDF with Hash to create a hex-encoded derived key from a secret key, salt and info:
openssl kdf -keylen 14 -kdfopt digest:SHA256 \
openssl kdf -keylen 14 -kdfopt digest:SHA2-256 \
-kdfopt hexkey:6dbdc23f045488 \
-kdfopt hexinfo:a1b2c3d4 SSKDF
Use SSHKDF to create a hex-encoded derived key from a secret key, hash and session_id:
openssl kdf -keylen 16 -kdfopt digest:SHA256 \
openssl kdf -keylen 16 -kdfopt digest:SHA2-256 \
-kdfopt hexkey:0102030405 \
-kdfopt hexxcghash:06090A \
-kdfopt hexsession_id:01020304 \
@@ -134,7 +134,7 @@ Use scrypt to create a hex-encoded derived key from a password and salt:
openssl kdf -keylen 64 -kdfopt pass:password -kdfopt salt:NaCl \
-kdfopt N:1024 -kdfopt r:8 -kdfopt p:16 \
-kdfopt maxmem_bytes:10485760 id-scrypt
-kdfopt maxmem_bytes:10485760 SCRYPT
=head1 NOTES
+4 -4
View File
@@ -87,7 +87,7 @@ printable characters only).
Used by GMAC to specify an IV in hexadecimal form (two hex digits per byte).
=item B<outlen:>I<int>
=item B<size:>I<int>
Used by KMAC128 or KMAC256 to specify an output length.
The default sizes are 32 or 64 bytes respectively.
@@ -127,7 +127,7 @@ To create a hex-encoded CMAC-AES-128-CBC MAC from a file:\
To create a hex-encoded KMAC128 MAC from a file with a Customisation String
'Tag' and output length of 16: \
openssl mac -macopt custom:Tag -macopt hexkey:40414243444546 \
-macopt outlen:16 -in msg.bin KMAC128
-macopt size:16 -in msg.bin KMAC128
To create a hex-encoded GMAC-AES-128-GCM with a IV from a file: \
openssl mac -macopt cipher:AES-128-GCM -macopt hexiv:E0E00F19FED7BA0136A797F3 \
@@ -147,8 +147,8 @@ L<EVP_MAC-CMAC(7)>,
L<EVP_MAC-GMAC(7)>,
L<EVP_MAC-HMAC(7)>,
L<EVP_MAC-KMAC(7)>,
L<EVP_MAC-SIPHASH(7)>,
L<EVP_MAC-POLY1305(7)>
L<EVP_MAC-Siphash(7)>,
L<EVP_MAC-Poly1305(7)>
=head1 COPYRIGHT
+5 -17
View File
@@ -19,6 +19,11 @@ sequence and prints out the certificates contained in it or takes a
file of certificates and converts it into a Netscape certificate
sequence.
A Netscape certificate sequence is an old Netscape-specific format that
can be sometimes 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 was also used by Netscape certificate server.
=head1 OPTIONS
=over 4
@@ -55,23 +60,6 @@ Create a Netscape certificate sequence
openssl nseq -in certs.pem -toseq -out nseq.pem
=head1 NOTES
The B<PEM> encoded form uses the same headers and footers as a certificate:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
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.
=head1 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.
=head1 COPYRIGHT
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -30,10 +31,6 @@ B<openssl> B<ocsp>
[B<-multi> I<process-count>]
[B<-header>]
[B<-path>]
[B<-CApath> I<dir>]
[B<-CAfile> I<file>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-attime> I<timestamp>]
[B<-check_ss_sig>]
[B<-crl_check>]
@@ -80,6 +77,7 @@ B<openssl> B<ocsp>
[B<-CA> I<file>]
[B<-rsigner> I<file>]
[B<-rkey> I<file>]
[B<-passin> I<arg>]
[B<-rother> I<file>]
[B<-rsigopt> I<nm>:I<v>]
[B<-resp_no_certs>]
@@ -89,6 +87,7 @@ B<openssl> B<ocsp>
[B<-nrequest> I<n>]
[B<-rcid> I<digest>]
[B<-I<digest>>]
{- $OpenSSL::safe::opt_trust_synopsis -}
=for openssl ifdef multi
@@ -207,10 +206,6 @@ each child is willing to wait for the client's OCSP response.
This option is available on POSIX systems (that support the fork() and other
required unix system-calls).
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
See L<openssl(1)/Trusted Certificate Options> for more information.
=item B<-attime>, B<-check_ss_sig>, B<-crl_check>, B<-crl_check_all>,
B<-explicit_policy>, B<-extended_crl>, B<-ignore_critical>, B<-inhibit_any>,
B<-inhibit_map>, B<-no_alt_chains>, B<-no_check_time>, B<-partial_chain>, B<-policy>,
@@ -310,6 +305,8 @@ OCSP request. Any digest supported by the OpenSSL B<dgst> command can be used.
The default is SHA-1. This option may be used multiple times to specify the
digest used by subsequent certificate identifiers.
{- $OpenSSL::safe::opt_trust_item -}
=back
=head2 OCSP Server Options
@@ -357,6 +354,11 @@ subject name.
The private key to sign OCSP responses with: if not present the file
specified in the B<-rsigner> option is used.
=item B<-passin> I<arg>
The private key password source. For more information about the format of I<arg>
see L<openssl(1)/Pass Phrase Options>.
=item B<-rsigopt> I<nm>:I<v>
Pass options to the signature algorithm when signing OCSP responses.
@@ -395,9 +397,9 @@ the OCSP request checked using the responder certificate's public key.
Then a normal certificate verify is performed on the OCSP responder certificate
building up a certificate chain in the process. The locations of the trusted
certificates used to build the chain can be specified by the B<-CAfile>
and B<-CApath> options or they will be looked for in the standard OpenSSL
certificates directory.
certificates used to build the chain can be specified by the B<-CAfile>,
B<-CApath> or B<-CAstore> options or they will be looked for in the
standard OpenSSL certificates directory.
If the initial verify fails then the OCSP verify process halts with an
error.
@@ -432,8 +434,8 @@ with the B<-VAfile> option.
=head1 NOTES
As noted, most of the verify options are for testing or debugging purposes.
Normally only the B<-CApath>, B<-CAfile> and (if the responder is a 'global
VA') B<-VAfile> options need to be used.
Normally only the B<-CApath>, B<-CAfile>, B<-CAstore> and (if the responder
is a 'global VA') B<-VAfile> options need to be used.
The OCSP server is only useful for test and demonstration purposes: it is
not really usable as a full OCSP responder. It contains only a very
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -20,9 +21,8 @@ B<openssl passwd>
[B<-noverify>]
[B<-quiet>]
[B<-table>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
{I<password>}
{- $OpenSSL::safe::opt_r_synopsis -}
[I<password>]
=for openssl ifdef crypt
@@ -93,9 +93,7 @@ Don't output warnings when passwords given at the command line are truncated.
In the output list, prepend the cleartext password and a TAB character
to each password hash.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
{- $OpenSSL::safe::opt_r_item -}
=back
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -24,8 +25,9 @@ B<openssl> B<pkcs12>
[B<-nokeys>]
[B<-info>]
[B<-des> B<-des3> B<-idea> B<-aes128> B<-aes192> B<-aes256> B<-aria128> B<-aria192> B<-aria256> B<-camellia128> B<-camellia192> B<-camellia256> B<-nodes>]
[B<-noiter>]
[B<-maciter> | B<-nomaciter> | B<-nomac>]
[B<-iter> I<count> | B<-noiter> | B<-nomaciter>]
[B<-maciter>]
[B<-nomac>]
[B<-twopass>]
[B<-descert>]
[B<-certpbe> I<cipher>]
@@ -36,13 +38,10 @@ B<openssl> B<pkcs12>
[B<-password> I<arg>]
[B<-passin> I<arg>]
[B<-passout> I<arg>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-CAfile> I<file>]
[B<-CApath> I<dir>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-CSP> I<name>]
{- $OpenSSL::safe::opt_trust_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine
@@ -236,17 +235,19 @@ the use of signing only keys for SSL client authentication.
Specify the MAC digest algorithm. If not included them SHA1 will be used.
=item B<-nomaciter>, B<-noiter>
=item B<-iter> I<count>
These options affect the iteration counts on the MAC and key algorithms.
Unless you wish to produce files compatible with MSIE 4.0 you should leave
these options alone.
This option specifies the iteration count for the encryption key and MAC. The
default value is 2048.
To discourage attacks by using large dictionaries of common passwords the
algorithm that derives keys from passwords can have an iteration count applied
to it: this causes a certain part of the algorithm to be repeated and slows it
down. The MAC is used to check the file integrity but since it will normally
have the same password as the keys and certificates it could also be attacked.
=item B<-nomaciter>, B<-noiter>
By default both MAC and encryption iteration counts are set to 2048, using
these options the MAC and encryption iteration counts can be set to 1, since
this reduces the file security you should not use these options unless you
@@ -263,18 +264,16 @@ to be needed to use MAC iterations counts but they are now used by default.
Don't attempt to provide the MAC integrity.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
See L<openssl(1)/Trusted Certificate Options> for more information.
=item B<-CSP> I<name>
Write I<name> as a Microsoft CSP name.
{- $OpenSSL::safe::opt_trust_item -}
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 NOTES
@@ -341,7 +340,8 @@ Include some extra certificates:
=head1 SEE ALSO
L<openssl(1)>,
L<openssl-pkcs8(1)>
L<openssl-pkcs8(1)>,
L<ossl_store-file(7)>
=head1 COPYRIGHT
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-pkcs7 - PKCS#7 utility
@@ -15,13 +20,17 @@ B<openssl> B<pkcs7>
[B<-print_certs>]
[B<-text>]
[B<-noout>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine
=head1 DESCRIPTION
This command processes PKCS#7 files in DER or PEM format.
This command processes PKCS#7 files. Note that it only understands PKCS#7
v 1.5 as specified in IETF RFC 2315. It cannot currently parse CMS as
described in IETF RFC 2630.
There is no option to print out all the fields of a PKCS#7 file.
=head1 OPTIONS
@@ -31,16 +40,12 @@ This command processes PKCS#7 files in DER or PEM format.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format. B<DER> format is DER encoded PKCS#7
v1.5 structure.B<PEM> (the default) is a base64 encoded version of
the DER form with header and footer lines.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
The data is a PKCS#7 Version 1.5 structure.
=item B<-in> I<filename>
@@ -67,12 +72,7 @@ issuer names.
Don't output the encoded version of the PKCS#7 structure (or certificates
is B<-print_certs> is set).
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
{- $OpenSSL::safe::opt_engine_item -}
=back
@@ -86,25 +86,6 @@ Output all certificates in a file:
openssl pkcs7 -in file.pem -print_certs -out certs.pem
=head1 NOTES
The PEM PKCS#7 format uses the header and footer lines:
-----BEGIN PKCS7-----
-----END PKCS7-----
For compatibility with some CAs it will also accept:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
=head1 RESTRICTIONS
There is no option to print out all the fields of a PKCS#7 file.
This PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC2315 they
cannot currently parse, for example, the new CMS as described in RFC2630.
=head1 SEE ALSO
L<openssl(1)>,
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -17,18 +18,17 @@ B<openssl> B<pkcs8>
[B<-passout> I<arg>]
[B<-iter> I<count>]
[B<-noiter>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-nocrypt>]
[B<-traditional>]
[B<-v2> I<alg>]
[B<-v2prf> I<alg>]
[B<-v1> I<alg>]
[B<-engine> I<id>]
[B<-scrypt>]
[B<-scrypt_N> I<N>]
[B<-scrypt_r> I<r>]
[B<-scrypt_p> I<p>]
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine scrypt scrypt_N scrypt_r scrypt_p
@@ -52,15 +52,26 @@ Normally a PKCS#8 private key is expected on input and a private key will be
written to the output file. With the B<-topk8> option the situation is
reversed: it reads a private key and writes a PKCS#8 format key.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format: see L<KEY FORMATS> for more details. The default
format is PEM.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
If a key is being converted from PKCS#8 form (i.e. the B<-topk8> option is
not used) then the input file must be in PKCS#8 format. An encrypted
key is expected unless B<-nocrypt> is included.
This specifies the output format: see L<KEY FORMATS> for more details. The default
format is PEM.
If B<-topk8> is not used and B<PEM> mode is set the output file will be an
unencrypted private key in PKCS#8 format. If the B<-traditional> option is
used then a traditional format private key is written instead.
If B<-topk8> is not used and B<DER> mode is set the output file will be an
unencrypted private key in traditional DER format.
If B<-topk8> is used then any supported private key can be used for the input
file in a format specified by B<-inform>. The output file will be encrypted
PKCS#8 format using the specified encryption parameters unless B<-nocrypt>
is included.
=item B<-traditional>
@@ -101,10 +112,6 @@ 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.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-v2> I<alg>
This option sets the PKCS#5 v2.0 algorithm.
@@ -128,13 +135,6 @@ 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.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-scrypt>
Uses the B<scrypt> algorithm for private key encryption using default
@@ -146,29 +146,12 @@ B<-scrypt_p> and B<-v2> options.
Sets the scrypt I<N>, I<r> or I<p> parameters.
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 KEY FORMATS
Various different formats are used by this command. These are detailed
below.
If a key is being converted from PKCS#8 form (i.e. the B<-topk8> option is
not used) then the input file must be in PKCS#8 format. An encrypted
key is expected unless B<-nocrypt> is included.
If B<-topk8> is not used and B<PEM> mode is set the output file will be an
unencrypted private key in PKCS#8 format. If the B<-traditional> option is
used then a traditional format private key is written instead.
If B<-topk8> is not used and B<DER> mode is set the output file will be an
unencrypted private key in traditional DER format.
If B<-topk8> is used then any supported private key can be used for the input
file in a format specified by B<-inform>. The output file will be encrypted
PKCS#8 format using the specified encryption parameters unless B<-nocrypt>
is included.
=head1 NOTES
By default, when converting a key to PKCS#8 format, PKCS#5 v2.0 using 256 bit
@@ -178,17 +161,6 @@ 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.
The encrypted form of a PEM encode PKCS#8 files uses the following
headers and footers:
-----BEGIN ENCRYPTED PRIVATE KEY-----
-----END ENCRYPTED PRIVATE KEY-----
The unencrypted form uses:
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
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
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-pkey - public or private key processing tool
@@ -21,9 +26,9 @@ B<openssl> B<pkey>
[B<-noout>]
[B<-pubin>]
[B<-pubout>]
[B<-engine> I<id>]
[B<-check>]
[B<-pubcheck>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine
@@ -40,14 +45,10 @@ converted between various forms and their components printed out.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format DER or PEM. The default format is PEM.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-in> I<filename>
@@ -103,13 +104,6 @@ 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.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-check>
This option checks the consistency of a key pair for both public and private
@@ -120,6 +114,8 @@ components.
This option checks the correctness of either a public key or the public component
of a key pair.
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 EXAMPLES
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-pkeyparam - public key algorithm parameter processing tool
@@ -12,8 +17,8 @@ B<openssl> B<pkeyparam>
[B<-out> I<filename>]
[B<-text>]
[B<-noout>]
[B<-engine> I<id>]
[B<-check>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine
@@ -48,17 +53,12 @@ Prints out the parameters in plain text in addition to the encoded version.
Do not output the encoded version of the parameters.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-check>
This option checks the correctness of parameters.
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 EXAMPLES
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -33,10 +34,9 @@ B<openssl> B<pkeyutl>
[B<-pkeyopt_passin> I<opt>[:I<passarg>]]
[B<-hexdump>]
[B<-asn1parse>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
[B<-engine_impl>]
{- $OpenSSL::safe::opt_r_synopsis -}
=for openssl ifdef engine engine_impl
@@ -90,7 +90,8 @@ The input key file, by default it should be a private key.
=item B<-keyform> B<DER>|B<PEM>|B<ENGINE>
The key format PEM, DER or ENGINE. Default is PEM.
The key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-passin> I<arg>
@@ -103,7 +104,8 @@ The peer key file, used by key derivation (agreement) operations.
=item B<-peerform> B<DER>|B<PEM>|B<ENGINE>
The peer key format B<PEM>, B<DER> or B<ENGINE>. Default is B<PEM>.
The peer key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-pubin>
@@ -177,22 +179,15 @@ hex dump the output data.
Parse the ASN.1 output data, this is useful when combined with the
B<-verifyrecover> option when an ASN1 structure is signed.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
{- $OpenSSL::safe::opt_engine_item -}
=item B<-engine_impl>
When used with the B<-engine> option, it specifies to also use
engine I<id> for crypto operations.
{- $OpenSSL::safe::opt_r_item -}
=back
=head1 NOTES
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -9,10 +10,9 @@ openssl-rand - generate pseudo-random bytes
B<openssl rand>
[B<-help>]
[B<-out> I<file>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-base64>]
[B<-hex>]
{- $OpenSSL::safe::opt_r_synopsis -}
I<num>
=for openssl ifdef engine
@@ -34,10 +34,6 @@ Print out a usage message.
Write to I<file> instead of standard output.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-base64>
Perform base64 encoding on the output.
@@ -46,6 +42,8 @@ Perform base64 encoding on the output.
Show the output as a hex string.
{- $OpenSSL::safe::opt_r_item -}
=back
=head1 SEE ALSO
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -20,8 +21,6 @@ B<openssl> B<req>
[B<-verify>]
[B<-modulus>]
[B<-new>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-newkey> I<arg>]
[B<-nodes>]
[B<-key> I<filename>]
@@ -40,16 +39,17 @@ B<openssl> B<req>
[B<-reqexts> I<section>]
[B<-precert>]
[B<-utf8>]
[B<-nameopt>]
[B<-reqopt>]
[B<-subject>]
[B<-subj> I<arg>]
[B<-sigopt> I<nm>:I<v>]
[B<-batch>]
[B<-verbose>]
[B<-engine> I<id>]
[B<-sm2-id> I<string>]
[B<-sm2-hex-id> I<hex-string>]
{- $OpenSSL::safe::opt_name_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine keygen_engine sm2-id sm2-hex-id
@@ -67,17 +67,12 @@ for use as root CAs for example.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format. The B<DER> option uses an ASN1 DER encoded
form compatible with the PKCS#10. The B<PEM> form is the default format: it
consists of the B<DER> format base64 encoded with additional header and
footer lines.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
The data is a PKCS#10 object.
=item B<-in> I<filename>
@@ -137,10 +132,6 @@ in the configuration file and any requested extensions.
If the B<-key> option is not used it will generate a new RSA private
key using information specified in the configuration file.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-newkey> I<arg>
This option creates a new certificate request and a new private
@@ -182,8 +173,8 @@ accepts PKCS#8 format private keys for PEM format files.
=item B<-keyform> B<DER>|B<PEM>
The format of the private key file specified in the B<-key>
argument. PEM is the default.
The format of the private key; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-keyout> I<filename>
@@ -289,13 +280,6 @@ 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.
=item B<-nameopt> I<option>
Option which determines how the subject or issuer names are displayed. The
I<option> argument can be a single option or multiple options separated by
commas. Alternatively the B<-nameopt> switch may be used more than once to
set multiple options. See the L<openssl-x509(1)> manual page for details.
=item B<-reqopt> I<option>
Customise the output format used with B<-text>. The I<option> argument can be
@@ -317,13 +301,6 @@ Non-interactive mode.
Print extra details about the operations being performed.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-keygen_engine> I<id>
Specifies an engine (by its unique I<id> string) which would be used
@@ -339,6 +316,12 @@ string is required by the SM2 signature algorithm for signing and verification.
Specify a binary ID string to use when verifying an SM2 certificate request. The
argument for this option is string of hexadecimal digits.
{- $OpenSSL::safe::opt_name_item -}
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 CONFIGURATION FILE FORMAT
@@ -595,8 +578,6 @@ Sample configuration file prompting for field values:
Sample configuration containing all field values:
RANDFILE = $ENV::HOME/.rnd
[ req ]
default_bits = 2048
default_keyfile = keyfile.pem
@@ -628,23 +609,10 @@ on the command line:
=head1 NOTES
The header and footer lines in the B<PEM> format are normally:
-----BEGIN CERTIFICATE REQUEST-----
-----END CERTIFICATE REQUEST-----
some software (some versions of Netscape certificate server) instead needs:
-----BEGIN NEW CERTIFICATE REQUEST-----
-----END NEW CERTIFICATE REQUEST-----
which is produced with the B<-newhdr> option but is otherwise compatible.
Either form is accepted transparently on input.
The certificate requests generated by B<Xenroll> with MSIE have extensions
added. It includes the B<keyUsage> extension which determines the type of
key (signature only or general purpose) and any additional OIDs entered
by the script in an extendedKeyUsage extension.
by the script in an B<extendedKeyUsage> extension.
=head1 DIAGNOSTICS
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-rsa - RSA key processing tool
@@ -34,7 +39,7 @@ B<openssl> B<rsa>
[B<-pubout>]
[B<-RSAPublicKey_in>]
[B<-RSAPublicKey_out>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef pvk-strong pvk-weak pvk-none engine
@@ -54,18 +59,16 @@ L<openssl-pkcs8(1)> command.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-inform> B<DER>|B<PEM>
This specifies the input format. The B<DER> option uses an ASN1 DER encoded
form compatible with the PKCS#1 RSAPrivateKey or SubjectPublicKeyInfo format.
The B<PEM> form is the default format: it consists of the B<DER> format base64
encoded with additional header and footer lines. On input PKCS#8 format private
keys are also accepted.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
The data is a PKCS#1 B<RSAPrivateKey> or B<SubjectPublicKey> object.
On input, PKCS#8 format private keys are also accepted.
=item B<-in> I<filename>
@@ -128,32 +131,10 @@ the input is a public key.
Like B<-pubin> and B<-pubout> except B<RSAPublicKey> format is used instead.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 NOTES
The PEM private key format uses the header and footer lines:
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
The PEM public key format uses the header and footer lines:
-----BEGIN PUBLIC KEY-----
-----END PUBLIC KEY-----
The PEM B<RSAPublicKey> format uses the header and footer lines:
-----BEGIN RSA PUBLIC KEY-----
-----END RSA PUBLIC KEY-----
=head1 EXAMPLES
To remove the pass phrase on an RSA private key:
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -18,13 +19,12 @@ B<openssl> B<rsautl>
[B<-verify>]
[B<-encrypt>]
[B<-decrypt>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-pkcs>]
[B<-ssl>]
[B<-raw>]
[B<-hexdump>]
[B<-asn1parse>]
{- $OpenSSL::safe::opt_r_synopsis -}
=for openssl ifdef engine
@@ -57,7 +57,8 @@ The input key file, by default it should be an RSA private key.
=item B<-keyform> B<DER>|B<PEM>|B<ENGINE>
The key format PEM, DER or ENGINE.
The key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-pubin>
@@ -84,10 +85,6 @@ Encrypt the input data using an RSA public key.
Decrypt the input data using an RSA private key.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-pkcs>, B<-oaep>, B<-ssl>, B<-raw>
The padding to use: PKCS#1 v1.5 (the default), PKCS#1 OAEP,
@@ -104,6 +101,8 @@ Hex dump the output data.
Parse the ASN.1 output data, this is useful when combined with the
B<-verify> option.
{- $OpenSSL::safe::opt_r_item -}
=back
=head1 NOTES
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -22,23 +23,15 @@ B<openssl> B<s_client>
[B<-verify_return_error>]
[B<-cert> I<filename>]
[B<-certform> B<DER>|B<PEM>]
[B<-CRLform> B<DER>|B<PEM>]
[B<-key> I<filename>]
[B<-keyform> B<DER>|B<PEM>]
[B<-cert_chain> I<filename>]
[B<-build_chain>]
[B<-xkey>]
[B<-xcert>]
[B<-xchain>]
[B<-xchain_build>]
[B<-xcertform> B<DER>|B<PEM>]
[B<-xkeyform> B<DER>|B<PEM>]
[B<-pass> I<arg>]
[B<-CApath> I<directory>]
[B<-CAfile> I<filename>]
[B<-chainCApath> I<directory>]
[B<-chainCAfile> I<filename>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-chainCAstore> I<uri>]
[B<-requestCAfile> I<filename>]
[B<-dane_tlsa_domain> I<domain>]
[B<-dane_tlsa_rrdata> I<rrdata>]
@@ -65,7 +58,6 @@ B<openssl> B<s_client>
[B<-no_alt_chains>]
[B<-use_deltas>]
[B<-auth_level> I<num>]
[B<-nameopt> I<option>]
[B<-verify_depth> I<num>]
[B<-verify_email> I<email>]
[B<-verify_hostname> I<hostname>]
@@ -87,19 +79,6 @@ B<openssl> B<s_client>
[B<-psk> I<key>]
[B<-psk_session> I<file>]
[B<-quiet>]
[B<-ssl3>]
[B<-tls1>]
[B<-tls1_1>]
[B<-tls1_2>]
[B<-tls1_3>]
[B<-no_ssl3>]
[B<-no_tls1>]
[B<-no_tls1_1>]
[B<-no_tls1_2>]
[B<-no_tls1_3>]
[B<-dtls>]
[B<-dtls1>]
[B<-dtls1_2>]
[B<-sctp>]
[B<-sctp_label_bug>]
[B<-fallback_scsv>]
@@ -120,13 +99,10 @@ B<openssl> B<s_client>
[B<-starttls> I<protocol>]
[B<-xmpphost> I<hostname>]
[B<-name> I<hostname>]
[B<-engine> I<id>]
[B<-tlsextdebug>]
[B<-no_ticket>]
[B<-sess_out> I<filename>]
[B<-sess_in> I<filename>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-serverinfo> I<types>]
[B<-status>]
[B<-alpn> I<protocols>]
@@ -137,6 +113,12 @@ B<openssl> B<s_client>
[B<-keylogfile> I<file>]
[B<-early_data> I<file>]
[B<-enable_pha>]
{- $OpenSSL::safe::opt_name_synopsis -}
{- $OpenSSL::safe::opt_version_synopsis -}
{- $OpenSSL::safe::opt_x_synopsis -}
{- $OpenSSL::safe::opt_trust_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
[I<host>:I<port>]
=for openssl ifdef engine ssl_client_engine ct noct ctlogfile
@@ -175,7 +157,7 @@ select the host and port using the optional target positional argument instead.
If neither this nor the target positional argument are specified then an attempt
is made to connect to the local host on port 4433.
=item B<-bind> I<host:port>]
=item B<-bind> I<host:port>
This specifies the host address and or port to bind as the source for the
connection. For Unix-domain sockets the port is ignored and the host is
@@ -217,14 +199,14 @@ Use IPv6 only.
=item B<-servername> I<name>
Set the TLS SNI (Server Name Indication) extension in the ClientHello message to
the given value.
If B<-servername> is not provided, the TLS SNI extension will be populated with
the name given to B<-connect> if it follows a DNS name format. If B<-connect> is
the given value.
If B<-servername> is not provided, the TLS SNI extension will be populated with
the name given to B<-connect> if it follows a DNS name format. If B<-connect> is
not provided either, the SNI is set to "localhost".
This is the default since OpenSSL 1.1.1.
Even though SNI should normally be a DNS name and not an IP address, if
B<-servername> is provided then that name will be sent, regardless of whether
Even though SNI should normally be a DNS name and not an IP address, if
B<-servername> is provided then that name will be sent, regardless of whether
it is a DNS name or not.
This option cannot be used in conjunction with B<-noservername>.
@@ -244,6 +226,11 @@ not to use a certificate.
The certificate format to use: DER or PEM. PEM is the default.
=item B<-CRLform> B<DER>|B<PEM>
The CRL format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-key> I<keyfile>
The private key to use. If not specified then the certificate file will
@@ -251,7 +238,8 @@ be used.
=item B<-keyform> I<format>
The private format to use: DER or PEM. PEM is the default.
The key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-cert_chain>
@@ -264,23 +252,6 @@ B<-cert> option.
Specify whether the application should build the certificate chain to be
provided to the server.
=item B<-xkey> I<infile>, B<-xcert> I<infile>, B<-xchain>
Specify an extra certificate, private key and certificate chain. These behave
in the same manner as the B<-cert>, B<-key> and B<-cert_chain> options. When
specified, the callback returning the first valid chain will be in use by the
client.
=item B<-xchain_build>
Specify whether the application should build the certificate chain to be
provided to the server for the extra certificates provided via B<-xkey> I<infile>,
B<-xcert> I<infile>, B<-xchain> options.
=item B<-xcertform> B<DER>|B<PEM>, B<-xkeyform> B<DER>|B<PEM>
Extra certificate and private key format respectively.
=item B<-pass> I<arg>
the private key password source. For more information about the format of I<arg>
@@ -299,17 +270,6 @@ will never fail due to a server certificate verify failure.
Return verification errors instead of continuing. This will typically
abort the handshake with a fatal error.
=item B<-nameopt> I<option>
Option which determines how the subject or issuer names are displayed. The
I<option> argument can be a single option or multiple options separated by
commas. Alternatively the B<-nameopt> switch may be used more than once to
set multiple options. See the L<openssl-x509(1)> manual page for details.
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
See L<openssl(1)/Trusted Certificate Options> for more information.
=item B<-chainCApath> I<directory>
The directory to use for building the chain provided to the server. This
@@ -321,6 +281,10 @@ information.
A file containing trusted certificates to use when attempting to build the
client certificate chain.
=item B<-chainCAstore> I<uri>
The URI to use when attempting to build the client certificate chain.
=item B<-requestCAfile> I<file>
A file containing a list of certificates whose subject names will be sent
@@ -482,23 +446,6 @@ This option must be provided in order to use a PSK cipher.
Use the pem encoded SSL_SESSION data stored in I<file> as the basis of a PSK.
Note that this will only work if TLSv1.3 is negotiated.
=item B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-tls1_3>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>, B<-no_tls1_3>
These options require or disable the use of the specified SSL or TLS protocols.
By default, this command will negotiate the highest mutually supported protocol
version.
When a specific TLS version is required, only that version will be offered to
and accepted from the server.
Note that not all protocols and flags may be available, depending on how
OpenSSL was built.
=item B<-dtls>, B<-dtls1>, B<-dtls1_2>
These options make this command use DTLS protocols instead of TLS.
With B<-dtls>, it will negotiate any supported DTLS protocol version,
whilst B<-dtls1> and B<-dtls1_2> will only support DTLS1.0 and DTLS1.2
respectively.
=item B<-sctp>
Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
@@ -652,17 +599,6 @@ Output SSL session to I<filename>.
Load SSL session from I<filename>. The client will attempt to resume a
connection from this session.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-serverinfo> I<types>
A list of comma-separated TLS Extension Types (numbers between 0 and
@@ -720,6 +656,18 @@ data and when the server accepts the early data.
For TLSv1.3 only, send the Post-Handshake Authentication extension. This will
happen whether or not a certificate has been provided via B<-cert>.
{- $OpenSSL::safe::opt_version_item -}
{- $OpenSSL::safe::opt_name_item -}
{- $OpenSSL::safe::opt_x_item -}
{- $OpenSSL::safe::opt_trust_item -}
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=item I<host>:I<port>
Rather than providing B<-connect>, the target hostname and optional port may
@@ -823,7 +771,8 @@ L<openssl-ciphers(1)>,
L<SSL_CONF_cmd(3)>,
L<SSL_CTX_set_max_send_fragment(3)>,
L<SSL_CTX_set_split_send_fragment(3)>,
L<SSL_CTX_set_max_pipelines(3)>
L<SSL_CTX_set_max_pipelines(3)>,
L<ossl_store-file(7)>
=head1 HISTORY
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -18,12 +19,11 @@ B<openssl> B<s_server>
[B<-verify> I<int>]
[B<-Verify> I<int>]
[B<-cert> I<infile>]
[B<-nameopt> I<val>]
[B<-naccept> I<+int>]
[B<-serverinfo> I<val>]
[B<-certform> B<DER>|B<PEM>]
[B<-key> I<infile>]
[B<-keyform> I<format>]
[B<-keyform> B<DER>|B<PEM>]
[B<-pass> I<val>]
[B<-dcert> I<infile>]
[B<-dcertform> B<DER>|B<PEM>]
@@ -36,10 +36,6 @@ B<openssl> B<s_server>
[B<-msg>]
[B<-msgfile> I<outfile>]
[B<-state>]
[B<-CAfile> I<infile>]
[B<-CApath> I<dir>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-nocert>]
[B<-quiet>]
[B<-no_resume_ephemeral>]
@@ -52,8 +48,6 @@ B<openssl> B<s_server>
[B<-tlsextdebug>]
[B<-HTTP>]
[B<-id_prefix> I<val>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-keymatexport> I<val>]
[B<-keymatexportlen> I<+int>]
[B<-CRL> I<infile>]
@@ -62,9 +56,10 @@ B<openssl> B<s_server>
[B<-dcert_chain> I<infile>]
[B<-chainCApath> I<dir>]
[B<-verifyCApath> I<dir>]
[B<-chainCAstore> I<uri>]
[B<-verifyCAstore> I<uri>]
[B<-no_cache>]
[B<-ext_cache>]
[B<-CRLform> B<DER>|B<PEM>]
[B<-verify_return_error>]
[B<-verify_quiet>]
[B<-build_chain>]
@@ -88,11 +83,6 @@ B<openssl> B<s_server>
[B<-split_send_frag> I<+int>]
[B<-max_pipelines> I<+int>]
[B<-read_buf> I<+int>]
[B<-no_ssl3>]
[B<-no_tls1>]
[B<-no_tls1_1>]
[B<-no_tls1_2>]
[B<-no_tls1_3>]
[B<-bugs>]
[B<-no_comp>]
[B<-comp>]
@@ -147,12 +137,6 @@ B<openssl> B<s_server>
[B<-no_alt_chains>]
[B<-no_check_time>]
[B<-allow_proxy_certs>]
[B<-xkey>]
[B<-xcert>]
[B<-xchain>]
[B<-xchain_build>]
[B<-xcertform> B<DER>|B<PEM>]
[B<-xkeyform> B<DER>|B<PEM>]
[B<-nbio>]
[B<-psk_identity> I<val>]
[B<-psk_hint> I<val>]
@@ -160,30 +144,27 @@ B<openssl> B<s_server>
[B<-psk_session> I<file>]
[B<-srpvfile> I<infile>]
[B<-srpuserseed> I<val>]
[B<-ssl3>]
[B<-tls1>]
[B<-tls1_1>]
[B<-tls1_2>]
[B<-tls1_3>]
[B<-dtls>]
[B<-timeout>]
[B<-mtu> I<+int>]
[B<-listen>]
[B<-dtls1>]
[B<-dtls1_2>]
[B<-sctp>]
[B<-sctp_label_bug>]
[B<-no_dhe>]
[B<-nextprotoneg> I<val>]
[B<-use_srtp> I<val>]
[B<-alpn> I<val>]
[B<-engine> I<val>]
[B<-keylogfile> I<outfile>]
[B<-max_early_data> I<int>]
[B<-early_data>]
[B<-anti_replay>]
[B<-no_anti_replay>]
[B<-http_server_binmode>]
{- $OpenSSL::safe::opt_name_synopsis -}
{- $OpenSSL::safe::opt_version_synopsis -}
{- $OpenSSL::safe::opt_x_synopsis -}
{- $OpenSSL::safe::opt_trust_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef unix 4 6 unlink no_dhe nextprotoneg use_srtp engine
@@ -270,13 +251,6 @@ B<-cert> option.
Specify whether the application should build the certificate chain to be
provided to the client.
=item B<-nameopt> I<val>
Option which determines how the subject or issuer names are displayed. The
I<val> argument can be a single option or multiple options separated by
commas. Alternatively the B<-nameopt> switch may be used more than once to
set multiple options. See the L<openssl-x509(1)> manual page for details.
=item B<-naccept> I<+int>
The server will exit after receiving the specified number of connections,
@@ -290,22 +264,25 @@ followed by "length" bytes of extension data). If the client sends
an empty TLS ClientHello extension matching the type, the corresponding
ServerHello extension will be returned.
=item B<-certform> B<DER>|B<PEM>
=item B<-certform> B<DER>|B<PEM>, B<-CRLForm> B<DER>|B<PEM>
The certificate format to use: DER or PEM. PEM is the default.
The certificate and CRL format; the default is PEM.
See L<openssl(1)/Format Options> for details.
=item B<-key> I<infile>
The private key to use. If not specified then the certificate file will
be used.
=item B<-keyform> I<format>
=item B<-keyform> B<DER>|B<PEM>
The private format to use: DER or PEM. PEM is the default.
The key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-pass> I<val>
The private key password source. For more information about the format of B<val>
The private key password source.
For more information about the format of I<val>,
see L<openssl(1)/Pass Phrase Options>.
=item B<-dcert> I<infile>, B<-dkey> I<infile>
@@ -325,26 +302,16 @@ A file containing trusted certificates to use when attempting to build the
server certificate chain when a certificate specified via the B<-dcert> option
is in use.
=item B<-dcertform> B<DER>|B<PEM>, B<-dkeyform> B<DER>|B<PEM>, B<-dpass> I<val>
=item B<-dcertform> B<DER>|B<PEM>, B<-dkeyform> B<DER>|B<PEM>
Additional certificate and private key format and passphrase respectively.
The format of the certificate and private key; the default is B<PEM>
see L<openssl(1)/Format Options>.
=item B<-xkey> I<infile>, B<-xcert> I<infile>, B<-xchain>
=item B<-dpass> I<val>
Specify an extra certificate, private key and certificate chain. These behave
in the same manner as the B<-cert>, B<-key> and B<-cert_chain> options. When
specified, the callback returning the first valid chain will be in use by
the server.
=item B<-xchain_build>
Specify whether the application should build the certificate chain to be
provided to the client for the extra certificates provided via B<-xkey> I<infile>,
B<-xcert> I<infile>, B<-xchain> options.
=item B<-xcertform> B<DER>|B<PEM>, B<-xkeyform> B<DER>|B<PEM>
Extra certificate and private key format respectively.
The passphrase for the additional private key.
For more information about the format of I<val>,
see L<openssl(1)/Pass Phrase Options>.
=item B<-nbio_test>
@@ -370,10 +337,6 @@ File to send output of B<-msg> or B<-trace> to, default standard output.
Prints the SSL session states.
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
See L<openssl(1)/Trusted Certificate Options> for more information.
=item B<-chainCApath> I<dir>
The directory to use for building the chain provided to the client. This
@@ -385,6 +348,16 @@ information.
A file containing trusted certificates to use when attempting to build the
server certificate chain.
=item B<-chainCAstore> I<uri>
The URI to a store to use for building the chain provided to the client.
The URI may indicate a single certificate, as well as a collection of
them.
With URIs in the C<file:> scheme, this acts as B<-chainCAfile> or
B<-chainCApath>, depending on if the URI indicates a directory or a
single file.
See L<ossl_store-file(7)> for more information on the C<file:> scheme.
=item B<-nocert>
If this option is set then no certificate is used. This restricts the
@@ -395,32 +368,34 @@ DH).
Inhibit printing of session and certificate information.
=item B<-www>
Sends a status message back to the client when it connects. This includes
information about the ciphers used and various session parameters.
The output is in HTML format so this option will normally be used with a
web browser. Cannot be used in conjunction with B<-early_data>.
=item B<-WWW>
Emulates a simple web server. Pages will be resolved relative to the
current directory, for example if the URL https://myhost/page.html is
requested the file F<./page.html> will be loaded. Cannot be used in conjunction
with B<-early_data>.
=item B<-tlsextdebug>
Print a hex dump of any TLS extensions received from the server.
=item B<-HTTP>
=item B<-www>
Sends a status message back to the client when it connects. This includes
information about the ciphers used and various session parameters.
The output is in HTML format so this option can be used with a web browser.
The special URL C</renegcert> turns on client cert validation, and C</reneg>
tells the server to request renegotiation.
The B<-early_data> option cannot be used with this option.
=item B<-WWW>, B<-HTTP>
Emulates a simple web server. Pages will be resolved relative to the
current directory, for example if the URL https://myhost/page.html is
requested the file F<./page.html> will be loaded. The files loaded are
assumed to contain a complete and correct HTTP response (lines that
are part of the HTTP response line and headers must end with CRLF). Cannot be
used in conjunction with B<-early_data>.
current directory, for example if the URL C<https://myhost/page.html> is
requested the file F<./page.html> will be sent.
If the B<-HTTP> flag is used, the files are sent directly, and should contain
any HTTP response headers (including status response line).
If the B<-WWW> option is used,
the response headers are generated by the server, and the file extension is
examined to determine the B<Content-Type> header.
Extensions of C<html>, C<htm>, and C<php> are C<text/html> and all others are
C<text/plain>.
In addition, the special URL C</stats> will return status
information like the B<-www> option.
Neither of these options can be used in conjunction with B<-early_data>.
=item B<-id_prefix> I<val>
@@ -429,10 +404,6 @@ for testing any SSL/TLS code (eg. proxies) that wish to deal with multiple
servers, when each of which might be generating a unique range of session
IDs (eg. with a certain prefix).
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-verify_return_error>
Verification errors normally just print a message but allow the
@@ -514,16 +485,6 @@ effect if the buffer size is larger than the size that would otherwise be used
and pipelining is in use (see L<SSL_CTX_set_default_read_buffer_len(3)> for
further information).
=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-tls1_3>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>, B<-no_tls1_3>
These options require or disable the use of the specified SSL or TLS protocols.
By default, this command will negotiate the highest mutually supported
protocol version.
When a specific TLS version is required, only that version will be accepted
from the client.
Note that not all protocols and flags may be available, depending on how
OpenSSL was built.
=item B<-bugs>
There are several known bugs in SSL and TLS implementations. Adding this
@@ -658,13 +619,6 @@ Any without a cookie will be responded to with a HelloVerifyRequest.
If a ClientHello with a cookie is received then this command will
connect to that peer and complete the handshake.
=item B<-dtls>, B<-dtls1>, B<-dtls1_2>
These options make this command use DTLS protocols instead of TLS.
With B<-dtls>, it will negotiate any supported DTLS protocol
version, whilst B<-dtls1> and B<-dtls1_2> will only support DTLSv1.0 and
DTLSv1.2 respectively.
=item B<-sctp>
Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
@@ -695,13 +649,6 @@ Protocol names are printable ASCII strings, for example "http/1.1" or
"spdy/3".
The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used.
=item B<-engine> I<val>
Specifying an engine (by its unique id string in I<val>) will cause
this command 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.
=item B<-keylogfile> I<outfile>
Appends TLS secrets to the specified keylog file such that external programs
@@ -733,6 +680,18 @@ data that was sent will be rejected.
When acting as web-server (using option B<-WWW> or B<-HTTP>) open files requested
by the client in binary mode.
{- $OpenSSL::safe::opt_name_item -}
{- $OpenSSL::safe::opt_version_item -}
{- $OpenSSL::safe::opt_x_item -}
{- $OpenSSL::safe::opt_trust_item -}
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 CONNECTED COMMANDS
@@ -824,7 +783,8 @@ L<openssl-ciphers(1)>,
L<SSL_CONF_cmd(3)>,
L<SSL_CTX_set_max_send_fragment(3)>,
L<SSL_CTX_set_split_send_fragment(3)>,
L<SSL_CTX_set_max_pipelines(3)>
L<SSL_CTX_set_max_pipelines(3)>,
L<ossl_store-file(7)>
=head1 HISTORY
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -12,23 +13,16 @@ B<openssl> B<s_time>
[B<-www> I<page>]
[B<-cert> I<filename>]
[B<-key> I<filename>]
[B<-CApath> I<directory>]
[B<-cafile> I<filename>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-reuse>]
[B<-new>]
[B<-verify> I<depth>]
[B<-nameopt> I<option>]
[B<-time> I<seconds>]
[B<-ssl3>]
[B<-tls1>]
[B<-tls1_1>]
[B<-tls1_2>]
[B<-tls1_3>]
{- $OpenSSL::safe::opt_versiontls_synopsis -}
[B<-bugs>]
[B<-cipher> I<cipherlist>]
[B<-ciphersuites> I<val>]
{- $OpenSSL::safe::opt_name_synopsis -}
{- $OpenSSL::safe::opt_trust_synopsis -}
=for openssl ifdef ssl3 tls1 tls1_1 tls1_2 tls1_3
@@ -78,23 +72,12 @@ Currently the verify operation continues after errors so all the problems
with a certificate chain can be seen. As a side effect the connection
will never fail due to a server certificate verify failure.
=item B<-nameopt> I<option>
Option which determines how the subject or issuer names are displayed. The
I<option> argument can be a single option or multiple options separated by
commas. Alternatively the B<-nameopt> switch may be used more than once to
set multiple options. See the L<openssl-x509(1)> manual page for details.
=item B<-CApath> I<directory>
The directory to use for server certificate verification. This directory
must be in "hash format", see L<openssl-verify(1)> for more information.
These are also used when building the client certificate chain.
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
See L<openssl(1)/Trusted Certificate Options> for more information.
=item B<-new>
Performs the timing test using a new session ID for each connection.
@@ -107,15 +90,6 @@ Performs the timing test using the same session ID; this can be used as a test
that session caching is working. If neither B<-new> nor B<-reuse> are
specified, they are both on by default and executed in sequence.
=item B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-tls1_3>
These options enable specific SSL or TLS protocol versions for the handshake
initiated by this command.
By default, it negotiates the highest mutually supported protocol
version.
Note that not all protocols and flags may be available, depending on how
OpenSSL was built.
=item B<-bugs>
There are several known bugs in SSL and TLS implementations. Adding this
@@ -145,6 +119,12 @@ and optionally transfer payload data from a server. Server and client
performance and the link speed determine how many connections it
can establish.
{- $OpenSSL::safe::opt_name_item -}
{- $OpenSSL::safe::opt_trust_item -}
{- $OpenSSL::safe::opt_versiontls_item -}
=back
=head1 NOTES
@@ -193,7 +173,8 @@ fails.
L<openssl(1)>,
L<openssl-s_client(1)>,
L<openssl-s_server(1)>,
L<openssl-ciphers(1)>
L<openssl-ciphers(1)>,
L<ossl_store-file(7)>
=head1 COPYRIGHT
+8 -15
View File
@@ -24,6 +24,9 @@ the SSL session master key) in human readable format. Since this is a
diagnostic tool that needs some knowledge of the SSL protocol to use
properly, most users will not need to use it.
The precise format of the data can vary across OpenSSL versions and
is not documented.
=head1 OPTIONS
=over 4
@@ -32,18 +35,13 @@ properly, most users will not need to use it.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>|B<NSS>
This specifies the input format. The B<DER> option uses an ASN1 DER encoded
format containing session details. The precise format can vary from one version
to the next. The B<PEM> form is the default format: it consists of the B<DER>
format base64 encoded with additional header and footer lines.
The input and output formats; the default is PEM.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>|B<NSS>
This specifies the output format. The B<PEM> and B<DER> options have the same
meaning and default as the B<-inform> option. The B<NSS> option outputs the
session id and the master key in NSS keylog format.
For B<NSS> output, the session ID and master key are reported in NSS "keylog"
format.
=item B<-in> I<filename>
@@ -134,11 +132,6 @@ This is the return code when an SSL client certificate is verified.
=head1 NOTES
The PEM encoded session format uses the header and footer lines:
-----BEGIN SSL SESSION PARAMETERS-----
-----END SSL SESSION PARAMETERS-----
Since the SSL session output contains the master key it is
possible to read the contents of an encrypted session using this
information. Therefore appropriate security precautions should be taken if
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -18,10 +19,6 @@ B<openssl> B<smime>
[B<-crlfeol>]
[B<-I<cipher>>]
[B<-in> I<file>]
[B<-CAfile> I<file>]
[B<-CApath> I<dir>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-attime> I<timestamp>]
[B<-check_ss_sig>]
[B<-crl_check>]
@@ -53,10 +50,11 @@ B<openssl> B<smime>
[B<-signer> I<file>]
[B<-recip> I< file>]
[B<-inform> B<DER>|B<PEM>|B<SMIME>]
[B<-outform> B<DER>|B<PEM>|B<SMIME>]
[B<-keyform> B<DER>|B<PEM>|B<ENGINE>]
[B<-passin> I<arg>]
[B<-inkey> I<file_or_id>]
[B<-out> I<file>]
[B<-outform> B<DER>|B<PEM>|B<SMIME>]
[B<-content> I<file>]
[B<-to> I<addr>]
[B<-from> I<ad>]
@@ -65,9 +63,9 @@ B<openssl> B<smime>
[B<-indef>]
[B<-noindef>]
[B<-stream>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-md> I<digest>]
{- $OpenSSL::safe::opt_trust_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
I<cert.pem> ...
=for openssl ifdef engine
@@ -126,28 +124,27 @@ Resign a message: take an existing message and one or more new signers.
The input message to be encrypted or signed or the MIME message to
be decrypted or verified.
=item B<-inform> B<DER>|B<PEM>|B<SMIME>
This specifies the input format for the PKCS#7 structure. The default
is B<SMIME> which reads an S/MIME format message. B<PEM> and B<DER>
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
B<-encrypt> or B<-sign>) this option has no effect.
=item B<-out> I<filename>
The message text that has been decrypted or verified or the output MIME
format message that has been signed or verified.
=item B<-inform> B<DER>|B<PEM>|B<SMIME>
The input format of the PKCS#7 (S/MIME) structure (if one is being read);
the default is B<SMIME>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>|B<SMIME>
This specifies the output format for the PKCS#7 structure. The default
is B<SMIME> which write an S/MIME format message. B<PEM> and B<DER>
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
B<-verify> or B<-decrypt>) this option has no effect.
The output format of the PKCS#7 (S/MIME) structure (if one is being written);
the default is B<SMIME>.
See L<openssl(1)/Format Options> for details.
=item B<-keyform> B<DER>|B<PEM>
The key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-stream>, B<-indef>, B<-noindef>
@@ -179,10 +176,6 @@ 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.
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
See L<openssl(1)/Trusted Certificate Options> for more information.
=item B<-md> I<digest>
Digest algorithm to use when signing or resigning. If not present then the
@@ -283,10 +276,6 @@ specified, the argument is given to the engine as a key identifier.
The private key password source. For more information about the format of I<arg>
see L<openssl(1)/Pass Phrase Options>.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-to>, B<-from>, B<-subject>
The relevant mail headers. These are included outside the signed
@@ -305,6 +294,10 @@ B<-verify_ip>, B<-verify_name>, B<-x509_strict>
Set various options of certificate chain verification. See
L<openssl-verify(1)> manual page for details.
{- $OpenSSL::safe::opt_trust_item -}
{- $OpenSSL::safe::opt_r_item -}
=item I<cert.pem> ...
One or more certificates of message recipients, used when encrypting
@@ -482,6 +475,10 @@ No revocation checking is done on the signer's certificate.
The current code can only handle S/MIME v2 messages, the more complex S/MIME v3
structures may cause parsing errors.
=head1 SEE ALSO
L<ossl_store-file(7)>
=head1 HISTORY
The use of multiple B<-signer> options and the B<-resign> command were first
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -8,17 +9,16 @@ openssl-speed - test library performance
B<openssl speed>
[B<-help>]
[B<-engine> I<id>]
[B<-elapsed>]
[B<-evp> I<algo>]
[B<-hmac> I<algo>]
[B<-cmac> I<algo>]
[B<-decrypt>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-primes> I<num>]
[B<-seconds> I<num>]
[B<-bytes> I<num>]
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
[I<algorithm> ...]
=for openssl ifdef cmac multi async_jobs engine
@@ -38,13 +38,6 @@ the B<rand> algorithm name.
Print out a usage message.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-elapsed>
When calculating operations- or bytes-per-second, use wall-clock time
@@ -71,10 +64,6 @@ C<openssl speed -cmac aes128>.
Time the decryption instead of encryption. Affects only the EVP testing.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-primes> I<num>
Generate a I<num>-prime RSA key and use it to run the benchmarks. This option
@@ -88,6 +77,10 @@ Run benchmarks for I<num> seconds.
Run benchmarks on I<num>-byte buffers. Affects ciphers, digests and the CSPRNG.
{- $OpenSSL::safe::opt_r_item -}
{- $OpenSSL::safe::opt_engine_item -}
=item I<algorithm> ...
If any I<algorithm> is given, then those algorithms are tested, otherwise a
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-spkac - SPKAC printing and generating utility
@@ -19,7 +24,7 @@ B<openssl> B<spkac>
[B<-spksect> I<section>]
[B<-noout>]
[B<-verify>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine
@@ -55,8 +60,8 @@ present.
=item B<-keyform> B<DER>|B<PEM>|B<ENGINE>
Whether the key format is PEM, DER, or an engine-backed key.
The default is PEM.
The key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-passin> I<arg>
@@ -92,12 +97,7 @@ being created).
Verifies the digital signature on the supplied SPKAC.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
{- $OpenSSL::safe::opt_engine_item -}
=back
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -20,8 +21,7 @@ B<openssl srp>
[B<-userinfo> I<text>]
[B<-passin> I<arg>]
[B<-passout> I<arg>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
{- $OpenSSL::safe::opt_r_synopsis -}
[I<user> ...]
=for openssl ifdef engine
@@ -71,9 +71,7 @@ The password source for the input and output file.
For more information about the format of B<arg>
see L<openssl(1)/Pass Phrase Options>.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
{- $OpenSSL::safe::opt_r_synopsis -}
=back
@@ -1,5 +1,10 @@
=pod
=begin comment
{- join("\n", @autowarntext) -}
=end comment
=head1 NAME
openssl-storeutl - STORE utility
@@ -12,7 +17,6 @@ B<openssl> B<storeutl>
[B<-noout>]
[B<-passin> I<arg>]
[B<-text> I<arg>]
[B<-engine> I<id>]
[B<-r>]
[B<-certs>]
[B<-keys>]
@@ -23,6 +27,7 @@ B<openssl> B<storeutl>
[B<-alias> I<arg>]
[B<-fingerprint> I<arg>]
[B<-I<digest>>]
{- $OpenSSL::safe::opt_engine_synopsis -}
I<uri> ...
=head1 DESCRIPTION
@@ -57,13 +62,6 @@ see L<openssl(1)/Pass Phrase Options>.
Prints out the objects in text form, similarly to the B<-text> output from
L<openssl-x509(1)>, L<openssl-pkey(1)>, etc.
=item B<-engine> I<id>
specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-r>
Fetch objects recursively when possible.
@@ -110,6 +108,8 @@ Search for an object having the given fingerprint.
The digest that was used to compute the fingerprint given with B<-fingerprint>.
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 SEE ALSO
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -8,8 +9,6 @@ openssl-ts - Time Stamping Authority tool (client/server)
B<openssl> B<ts>
B<-query>
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-config> I<configfile>]
[B<-data> I<file_to_hash>]
[B<-digest> I<digest_bytes>]
@@ -20,6 +19,7 @@ B<-query>
[B<-in> I<request.tsq>]
[B<-out> I<request.tsq>]
[B<-text>]
{- $OpenSSL::safe::opt_r_synopsis -}
B<openssl> B<ts>
B<-reply>
@@ -37,7 +37,7 @@ B<-reply>
[B<-out> I<response.tsr>]
[B<-token_out>]
[B<-text>]
[B<-engine> I<id>]
{- $OpenSSL::safe::opt_engine_synopsis -}
B<openssl> B<ts>
B<-verify>
@@ -48,6 +48,7 @@ B<-verify>
[B<-token_in>]
[B<-CApath> I<trusted_cert_path>]
[B<-CAfile> I<trusted_certs.pem>]
[B<-CAstore> I<trusted_certs_uri>]
[B<-untrusted> I<cert_file.pem>]
[I<verify options>]
@@ -134,10 +135,6 @@ request with the following options:
=over 4
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-config> I<configfile>
The configuration file to use.
@@ -200,6 +197,8 @@ is stdout. (Optional)
If this option is specified the output is human-readable text format
instead of DER. (Optional)
{- $OpenSSL::safe::opt_r_item -}
=back
=head2 Timestamp Response generation
@@ -304,12 +303,7 @@ response (TimeStampResp). (Optional)
If this option is specified the output is human-readable text format
instead of DER. (Optional)
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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. Default is built-in. (Optional)
{- $OpenSSL::safe::opt_engine_item -}
=back
@@ -350,10 +344,12 @@ This flag can be used together with the B<-in> option and indicates
that the input is a DER encoded timestamp token (ContentInfo) instead
of a timestamp response (TimeStampResp). (Optional)
=item B<-CAfile> I<file>, B<-CApath> I<dir>
=item B<-CAfile> I<file>, B<-CApath> I<dir>, B<-CAstore> I<uri>
See L<openssl(1)/Trusted Certificate Options> for more information.
At least one of B<-CApath>, B<-CAfile> or B<-CAstore> must be specified.
=item B<-untrusted> I<cert_file.pem>
Set of additional untrusted certificates in PEM format which may be
@@ -398,15 +394,23 @@ section can be overridden with the B<-section> command line switch. (Optional)
=item B<oid_file>
See L<openssl-ca(1)> for description. (Optional)
This specifies a file containing additional B<OBJECT IDENTIFIERS>.
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. (Optional)
=item B<oid_section>
See L<openssl-ca(1)> for description. (Optional)
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 B<=> and the numerical form. The short
and long names are the same when this option is used. (Optional)
=item B<RANDFILE>
See L<openssl-ca(1)> for description. (Optional)
At startup the specified file is loaded into the random number generator,
and at exit 256 bytes will be written to it. (Note: Using a RANDFILE is
not necessary anymore, see the L</HISTORY> section.
=item B<serial>
@@ -639,6 +643,13 @@ test/testtsa).
=back
=head1 HISTORY
OpenSSL 1.1.1 introduced a new random generator (CSPRNG) with an improved
seeding mechanism. The new seeding mechanism makes it unnecessary to
define a RANDFILE for saving and restoring randomness. This option is
retained mainly for compatibility reasons.
=head1 SEE ALSO
L<openssl(1)>,
@@ -647,7 +658,8 @@ L<openssl-req(1)>,
L<openssl-x509(1)>,
L<openssl-ca(1)>,
L<openssl-genrsa(1)>,
L<config(5)>
L<config(5)>,
L<ossl_store-file(7)>
=head1 COPYRIGHT
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -8,10 +9,6 @@ openssl-verify - Utility to verify certificates
B<openssl> B<verify>
[B<-help>]
[B<-CAfile> I<file>]
[B<-CApath> I<directory>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-allow_proxy_certs>]
[B<-attime> I<timestamp>]
[B<-check_ss_sig>]
@@ -19,13 +16,11 @@ B<openssl> B<verify>
[B<-crl_download>]
[B<-crl_check>]
[B<-crl_check_all>]
[B<-engine> I<id>]
[B<-explicit_policy>]
[B<-extended_crl>]
[B<-ignore_critical>]
[B<-inhibit_any>]
[B<-inhibit_map>]
[B<-nameopt> I<option>]
[B<-no_check_time>]
[B<-partial_chain>]
[B<-policy> I<arg>]
@@ -51,6 +46,9 @@ B<openssl> B<verify>
[B<-show_chain>]
[B<-sm2-id> I<string>]
[B<-sm2-hex-id> I<hex-string>]
{- $OpenSSL::safe::opt_name_synopsis -}
{- $OpenSSL::safe::opt_trust_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
[B<-->]
[I<certificate> ...]
@@ -68,10 +66,6 @@ This command verifies certificate chains.
Print out a usage message.
=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
See L<openssl(1)/Trusted Certificate Options> for more information.
=item B<-allow_proxy_certs>
Allow the verification of proxy certificates.
@@ -107,15 +101,6 @@ If a valid CRL cannot be found an error occurs.
Checks the validity of B<all> certificates in the chain by attempting
to look up valid CRLs.
=item B<-engine> I<id>
Specifying an engine I<id> will cause this command to attempt to load the
specified engine.
The engine will then be set as the default for all its supported algorithms.
If you want to load certificates or CRLs that require engine support via any of
the B<-trusted>, B<-untrusted> or B<-CRLfile> options, the B<-engine> option
must be specified before those options.
=item B<-explicit_policy>
Set policy variable require-explicit-policy (see RFC5280).
@@ -139,13 +124,6 @@ Set policy variable inhibit-any-policy (see RFC5280).
Set policy variable inhibit-policy-mapping (see RFC5280).
=item B<-nameopt> I<option>
Option which determines how the subject or issuer names are displayed. The
I<option> argument can be a single option or multiple options separated by
commas. Alternatively the B<-nameopt> switch may be used more than once to
set multiple options. See the L<openssl-x509(1)> manual page for details.
=item B<-no_check_time>
This option suppresses checking the validity period of certificates and CRLs
@@ -192,8 +170,8 @@ P-256 and P-384.
=item B<-trusted_first>
When constructing the certificate chain, use the trusted certificates specified
via B<-CAfile>, B<-CApath> or B<-trusted> before any certificates specified via
B<-untrusted>.
via B<-CAfile>, B<-CApath>, B<-CAstore> or B<-trusted> before any certificates
specified via B<-untrusted>.
This can be useful in environments with Bridge or Cross-Certified CAs.
As of OpenSSL 1.1.0 this option is on by default and cannot be disabled.
@@ -224,9 +202,9 @@ consulted.
That is, the only trust-anchors are those listed in I<file>.
This option can be specified more than once to include trusted certificates
from multiple I<file>s.
This option implies the B<-no-CAfile> and B<-no-CApath> options.
This option cannot be used in combination with either of the B<-CAfile> or
B<-CApath> options.
This option implies the B<-no-CAfile>, B<-no-CApath> and B<-no-CAstore> options.
This option cannot be used in combination with any of the B<-CAfile>,
B<-CApath> or B<-CAstore> options.
=item B<-use_deltas>
@@ -312,6 +290,15 @@ required by the SM2 signature algorithm for signing and verification.
Specify a binary ID string to use when signing or verifying using an SM2
certificate. The argument for this option is string of hexadecimal digits.
{- $OpenSSL::safe::opt_name_item -}
{- $OpenSSL::safe::opt_trust_item -}
{- $OpenSSL::safe::opt_engine_item -}
To load certificates or CRLs that require engine support, specify the
B<-engine> option before any of the
B<-trusted>, B<-untrusted> or B<-CRLfile> options.
=item B<-->
Indicates the last option. All arguments following this are assumed to be
@@ -743,8 +730,9 @@ Although the issuer checks are a considerable improvement over the old
technique they still suffer from limitations in the underlying X509_LOOKUP
API. One consequence of this is that trusted certificates with matching
subject name must either appear in a file (as specified by the B<-CAfile>
option) or a directory (as specified by B<-CApath>). If they occur in
both then only the certificates in the file will be recognised.
option), a directory (as specified by B<-CApath>), or a store (as specified
by B<-CAstore>). If they occur in more than one location then only the
certificates in the file will be recognised.
Previous versions of OpenSSL assume certificates with matching subject
name are identical and mishandled them.
@@ -756,7 +744,8 @@ B<X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY> error codes.
=head1 SEE ALSO
L<openssl(1)>,
L<openssl-x509(1)>
L<openssl-x509(1)>,
L<ossl_store-file(7)>
=head1 HISTORY
@@ -1,4 +1,5 @@
=pod
{- OpenSSL::safe::output_do_not_edit_headers(); -}
=head1 NAME
@@ -10,9 +11,9 @@ B<openssl> B<x509>
[B<-help>]
[B<-inform> B<DER>|B<PEM>]
[B<-outform> B<DER>|B<PEM>]
[B<-keyform> B<DER>|B<PEM>]
[B<-keyform> B<DER>|B<PEM>|B<ENGINE>]
[B<-CAform> B<DER>|B<PEM>]
[B<-CAkeyform> B<DER>|B<PEM>]
[B<-CAkeyform> B<DER>|B<PEM>|B<ENGINE>]
[B<-in> I<filename>]
[B<-out> I<filename>]
[B<-serial>]
@@ -22,7 +23,6 @@ B<openssl> B<x509>
[B<-ocspid>]
[B<-subject>]
[B<-issuer>]
[B<-nameopt> I<option>]
[B<-email>]
[B<-ocsp_uri>]
[B<-startdate>]
@@ -63,10 +63,10 @@ B<openssl> B<x509>
[B<-extfile> I<filename>]
[B<-extensions> I<section>]
[B<-sigopt> I<nm>:I<v>]
[B<-rand> I<files>]
[B<-writerand> I<file>]
[B<-engine> I<id>]
[B<-preserve_dates>]
{- $OpenSSL::safe::opt_name_synopsis -}
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine subject_hash_old issuer_hash_old
@@ -90,18 +90,13 @@ various sections.
Print out a usage message.
=item B<-inform> B<DER>|B<PEM>
=item B<-inform> B<DER>|B<PEM>, B<-outform> B<DER>|B<PEM>
This specifies the input format normally the command will expect an X509
certificate but this can change if other options such as B<-req> are
present. The DER format is the DER encoding of the certificate and PEM
is the base64 encoding of the DER encoding with header and footer lines
added. The default format is PEM.
The input and formats; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-outform> B<DER>|B<PEM>
This specifies the output format, the options have the same meaning and default
as the B<-inform> option.
The input is normally an X.509 certificate, but this can change if other
options such as B<-req> are used.
=item B<-in> I<filename>
@@ -122,23 +117,16 @@ Any digest supported by the L<openssl-dgst(1)> command can be used.
If not specified then SHA1 is used with B<-fingerprint> or
the default digest for the signing algorithm is used, typically SHA256.
=item B<-rand> I<files>, B<-writerand> I<file>
See L<openssl(1)/Random State Options> for more information.
=item B<-engine> I<id>
Specifying an engine (by its unique I<id> string) will cause this command
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.
=item B<-preserve_dates>
When signing a certificate, preserve the "notBefore" and "notAfter" dates
instead of adjusting them to current time and duration.
Cannot be used with the B<-days> option.
{- $OpenSSL::safe::opt_r_synopsis -}
{- $OpenSSL::safe::opt_engine_item -}
=back
=head2 Display Options
@@ -220,12 +208,7 @@ Outputs the subject name.
Outputs the issuer name.
=item B<-nameopt> I<option>
Option which determines how the subject or issuer names are displayed. The
I<option> argument can be a single option or multiple options separated by
commas. Alternatively the B<-nameopt> switch may be used more than once to
set multiple options. See the L</Name Options> section for more information.
{- $OpenSSL::safe::opt_name_item -}
=item B<-email>
@@ -376,8 +359,13 @@ retained.
=item B<-keyform> B<DER>|B<PEM>
Specifies the format (DER or PEM) of the private key file used in the
B<-signkey> option.
The key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-CAform> B<DER>|B<PEM>, B<-CAkeyform> B<DER>|B<PEM>
The format for the CA certificate and key; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-days> I<arg>
@@ -490,150 +478,6 @@ or certificate request.
=back
=head2 Name Options
The B<-nameopt> command line switch determines how the subject and issuer
names are displayed. If no B<-nameopt> switch is present the default "oneline"
format is used which is compatible with previous versions of OpenSSL.
Each option is described in detail below, all options can be preceded by
a B<-> to turn the option off. Only the first four will normally be used.
=over 4
=item B<compat>
Use the old format.
=item B<RFC2253>
Displays names compatible with RFC2253 equivalent to B<esc_2253>, B<esc_ctrl>,
B<esc_msb>, B<utf8>, B<dump_nostr>, B<dump_unknown>, B<dump_der>,
B<sep_comma_plus>, B<dn_rev> and B<sname>.
=item B<oneline>
A oneline format which is more readable than RFC2253. It is equivalent to
specifying the B<esc_2253>, B<esc_ctrl>, B<esc_msb>, B<utf8>, B<dump_nostr>,
B<dump_der>, B<use_quote>, B<sep_comma_plus_space>, B<space_eq> and B<sname>
options. This is the I<default> of no name options are given explicitly.
=item B<multiline>
A multiline format. It is equivalent B<esc_ctrl>, B<esc_msb>, B<sep_multiline>,
B<space_eq>, B<lname> and B<align>.
=item B<esc_2253>
Escape the "special" characters required by RFC2253 in a field. That is
B<,+"E<lt>E<gt>;>. Additionally B<#> is escaped at the beginning of a string
and a space character at the beginning or end of a string.
=item B<esc_2254>
Escape the "special" characters required by RFC2254 in a field. That is
the B<NUL> character as well as and B<()*>.
=item B<esc_ctrl>
Escape control characters. That is those with ASCII values less than
0x20 (space) and the delete (0x7f) character. They are escaped using the
RFC2253 \XX notation (where XX are two hex digits representing the
character value).
=item B<esc_msb>
Escape characters with the MSB set, that is with ASCII values larger than
127.
=item B<use_quote>
Escapes some characters by surrounding the whole string with B<"> characters,
without the option all escaping is done with the B<\> character.
=item B<utf8>
Convert all strings to UTF8 format first. This is required by RFC2253. If
you are lucky enough to have a UTF8 compatible terminal then the use
of this option (and B<not> setting B<esc_msb>) may result in the correct
display of multibyte (international) characters. Is this option is not
present then multibyte characters larger than 0xff will be represented
using the format \UXXXX for 16 bits and \WXXXXXXXX for 32 bits.
Also if this option is off any UTF8Strings will be converted to their
character form first.
=item B<ignore_type>
This option does not attempt to interpret multibyte characters in any
way. That is their content octets are merely dumped as though one octet
represents each character. This is useful for diagnostic purposes but
will result in rather odd looking output.
=item B<show_type>
Show the type of the ASN1 character string. The type precedes the
field contents. For example "BMPSTRING: Hello World".
=item B<dump_der>
When this option is set any fields that need to be hexdumped will
be dumped using the DER encoding of the field. Otherwise just the
content octets will be displayed. Both options use the RFC2253
B<#XXXX...> format.
=item B<dump_nostr>
Dump non character string types (for example OCTET STRING) if this
option is not set then non character string types will be displayed
as though each content octet represents a single character.
=item B<dump_all>
Dump all fields. This option when used with B<dump_der> allows the
DER encoding of the structure to be unambiguously determined.
=item B<dump_unknown>
Dump any field whose OID is not recognised by OpenSSL.
=item B<sep_comma_plus>, B<sep_comma_plus_space>, B<sep_semi_plus_space>,
B<sep_multiline>
These options determine the field separators. The first character is
between Relative Distinguished Names (RDNs) and the second is between
multiple Attribute Value Assertions (AVAs, multiple AVAs are
very rare and their use is discouraged). The options ending in
"space" additionally place a space after the separator to make it
more readable. The B<sep_multiline> uses a linefeed character for
the RDN separator and a spaced B<+> for the AVA separator. It also
indents the fields by four characters. If no field separator is specified
then B<sep_comma_plus_space> is used by default.
=item B<dn_rev>
Reverse the fields of the DN. This is required by RFC2253. As a side
effect this also reverses the order of multiple AVAs but this is
permissible.
=item B<nofname>, B<sname>, B<lname>, B<oid>
These options alter how the field name is displayed. B<nofname> does
not display the field at all. B<sname> uses the "short name" form
(CN for commonName for example). B<lname> uses the long form.
B<oid> represents the OID in numerical form and is useful for
diagnostic purpose.
=item B<align>
Align field values for a more readable output. Only usable with
B<sep_multiline>.
=item B<space_eq>
Places spaces round the B<=> character which follows the field
name.
=back
=head2 Text Options
As well as customising the name output format, it is also possible to
@@ -782,21 +626,6 @@ Set a certificate to be trusted for SSL client use and change set its alias to
=head1 NOTES
The PEM format uses the header and footer lines:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
it will also handle files containing:
-----BEGIN X509 CERTIFICATE-----
-----END X509 CERTIFICATE-----
Trusted certificates have the lines
-----BEGIN TRUSTED CERTIFICATE-----
-----END TRUSTED CERTIFICATE-----
The conversion to UTF8 format used with the name options assumes that
T61Strings use the ISO8859-1 character set. This is wrong but Netscape
and MSIE do this as do many certificates. So although this is incorrect
+380 -17
View File
@@ -8,8 +8,8 @@ openssl - OpenSSL command line tool
B<openssl>
I<command>
[ I<command_opts> ... ]
[ I<command_args> ... ]
[ I<options> ... ]
[ I<parameters> ... ]
B<openssl>
B<list>
@@ -21,7 +21,7 @@ B<-digest-algorithms> |
B<-mac-algorithms> |
B<-public-key-algorithms>
B<openssl> B<no->I<XXX> [ I<arbitrary options> ]
B<openssl> B<no->I<XXX> [ I<options> ]
=head1 DESCRIPTION
@@ -44,21 +44,22 @@ It can be used for
=head1 COMMAND SUMMARY
The B<openssl> program provides a rich variety of sub-commands (I<command> in
the SYNOPSIS above), each of which often has a wealth of options and arguments
(I<command_opts> and I<command_args> in the SYNOPSIS).
The B<openssl> program provides a rich variety of commands (I<command> in
the L</SYNOPSIS> above).
Each command can have many options and argument parameters, shown above as
I<options> and I<parameters>.
Detailed documentation and use cases for most standard subcommands are available
(e.g., L<x509(1)> or L<openssl-x509(1)>).
(e.g., L<openssl-x509(1)>).
Many commands use an external configuration file for some or all of their
arguments and have a B<-config> option to specify that file.
The default name of the file is F<openssl.cnf> in the default certificate
storage area, which can be determined from the L<openssl-version(1)>
command.
The environment variable B<OPENSSL_CONF> can be used to specify
the location of the file.
If the environment variable is not specified, then the file is named
F<openssl.cnf> in the default certificate storage area, whose value
depends on the configuration flags specified when the OpenSSL
was built.
a different location of the file.
See L<openssl-env(7)>.
The list options B<-standard-commands>, B<-digest-commands>,
and B<-cipher-commands> output a list (one entry per line) of the names
@@ -85,7 +86,7 @@ availability of ciphers in the B<openssl> program. (B<no->I<XXX> is
not able to detect pseudo-commands such as B<quit>,
B<list>, or B<no->I<XXX> itself.)
=head2 Standard Sub-commands
=head2 Standard Commands
=over 4
@@ -147,7 +148,7 @@ EC parameter manipulation and generation.
=item B<enc>
Encoding with Ciphers.
Encryption, decryption, and encoding.
=item B<engine>
@@ -392,14 +393,13 @@ SM3 Digest
=back
=head2 Encoding and Cipher Commands
=head2 Encryption, Decryption, and Encoding Commands
The following aliases provide convenient access to the most used encodings
and ciphers.
Depending on how OpenSSL was configured and built, not all ciphers listed
here may be present. See L<openssl-enc(1)> for more information and command
usage.
here may be present. See L<openssl-enc(1)> for more information.
=over 4
@@ -516,6 +516,109 @@ parameters start with a minus sign:
=back
=head2 Format Options
Several OpenSSL commands can take input or generate output in a variety
of formats. The list of acceptable formats, and the default, is
described in each command documentation. The list of formats is
described below. Both uppercase and lowercase are accepted.
=over 4
=item B<DER>
A binary format, encoded or parsed according to Distinguished Encoding Rules
(DER) of the ASN.1 data language.
=item B<ENGINE>
Used to specify that the cryptographic material is in an OpenSSL B<engine>.
An engine must be configured or specified using the B<-engine> option.
In addition, the B<-input> flag can be used to name a specific object in
the engine.
A password, such as the B<-passin> flag often must be specified as well.
=item B<P12>
A DER-encoded file containing a PKCS#12 object.
It might be necessary to provide a decryption password to retrieve
the private key.
=item B<PEM>
A text format defined in IETF RFC 1421 and IETF RFC 7468. Briefly, this is
a block of base-64 encoding (defined in IETF RFC 4648), with specific
lines used to mark the start and end:
Text before the BEGIN line is ignored.
----- BEGIN object-type -----
OT43gQKBgQC/2OHZoko6iRlNOAQ/tMVFNq7fL81GivoQ9F1U0Qr+DH3ZfaH8eIkX
xT0ToMPJUzWAn8pZv0snA0um6SIgvkCuxO84OkANCVbttzXImIsL7pFzfcwV/ERK
UM6j0ZuSMFOCr/lGPAoOQU0fskidGEHi1/kW+suSr28TqsyYZpwBDQ==
----- END object-type -----
Text after the END line is also ignored
The I<object-type> must match the type of object that is expected.
For example a C<BEGIN X509 CERTIFICATE> will not match if the command
is trying to read a private key. The types supported include:
ANY PRIVATE KEY
CERTIFICATE
CERTIFICATE REQUEST
CMS
DH PARAMETERS
DSA PARAMETERS
DSA PUBLIC KEY
EC PARAMETERS
EC PRIVATE KEY
ECDSA PUBLIC KEY
ENCRYPTED PRIVATE KEY
PARAMETERS
PKCS #7 SIGNED DATA
PKCS7
PRIVATE KEY
PUBLIC KEY
RSA PRIVATE KEY
SSL SESSION PARAMETERS
TRUSTED CERTIFICATE
X509 CRL
X9.42 DH PARAMETERS
The following legacy I<object-type>'s are also supported for compatibility
with earlier releases:
DSA PRIVATE KEY
NEW CERTIFICATE REQUEST
RSA PUBLIC KEY
X509 CERTIFICATE
=item B<SMIME>
An S/MIME object as described in IETF RFC 8551.
Earlier versions were known as CMS and are compatible.
Note that the parsing is simple and might fail to parse some legal data.
=back
The options to specify the format are as follows. Refer to the individual
manpage to see which options are accepted.
=over 4
=item B<-inform> I<format>, B<-outform> I<format>
The format of the input or output streams.
=item B<-keyform> I<format>
Format of a private key input source.
=item B<-CRLform> I<format>
Format of a CRL input source.
=back
=head2 Pass Phrase Options
Several commands accept password arguments, typically using B<-passin>
@@ -597,6 +700,23 @@ See L<openssl-rehash(1)> for information on creating this type of directory.
Do not use the default directory of trusted certificates.
=item B<-CAstore> I<uri>
Use I<uri> as a store of trusted CA certificates. The URI may
indicate a single certificate, as well as a collection of them.
With URIs in the C<file:> scheme, this acts as B<-CAfile> or
B<-CApath>, depending on if the URI indicates a single file or
directory.
See L<ossl_store-file(7)> for more information on the C<file:> scheme.
These certificates are also used when building the server certificate
chain (for example with L<openssl-s_server(1)>) or client certificate
chain (for example with L<openssl-s_time(1)>).
=item B<-no-CAstore>
Do not use the default store.
=back
=head2 Random State Options
@@ -629,8 +749,250 @@ This file can be used in a subsequent command invocation.
=back
=head2 Extended Verification Options
Sometimes there may be more than one certificate chain leading to an
end-entity certificate.
This usually happens when a root or intermediate CA signs a certificate
for another a CA in other organization.
Another reason is when a CA might have intermediates that use two different
signature formats, such as a SHA-1 and a SHA-256 digest.
The following options can be used to provide data that will allow the
OpenSSL command to generate an alternative chain.
=over 4
=item B<-xchain_build>
Specify whether the application should build the certificate chain to be
provided to the server for the extra certificates via the B<-xkey>,
B<-xcert>, and B<-xchain> options.
=item B<-xkey> I<infile>, B<-xcert> I<infile>, B<-xchain>
Specify an extra certificate, private key and certificate chain. These behave
in the same manner as the B<-cert>, B<-key> and B<-cert_chain> options. When
specified, the callback returning the first valid chain will be in use by the
client.
=item B<-xcertform> B<DER>|B<PEM>, B<-xkeyform> B<DER>|B<PEM>
The input format for the extra certificate and key, respectively.
See L<openssl(1)/Format Options> for details.
=back
=head2 Name Format Options
OpenSSL provides fine-grain control over how the subject and issuer DN's are
displayed.
This is specified by using the B<-nameopt> option, which takes a
comma-separated list of options from the following set.
An option may be preceeded by a minus sign, C<->, to turn it off.
The default value is C<oneline>.
The first four are the most commonly used.
=over 4
=item B<compat>
Display the name using an old format from previous OpenSSL versions.
=item B<RFC2253>
Display the name using the format defined in RFC 2253.
It is equivalent to B<esc_2253>, B<esc_ctrl>, B<esc_msb>, B<utf8>,
B<dump_nostr>, B<dump_unknown>, B<dump_der>, B<sep_comma_plus>, B<dn_rev>
and B<sname>.
=item B<oneline>
Display the name in one line, using a format that is more readable
RFC 2253.
It is equivalent to B<esc_2253>, B<esc_ctrl>, B<esc_msb>, B<utf8>,
B<dump_nostr>, B<dump_der>, B<use_quote>, B<sep_comma_plus_space>,
B<space_eq> and B<sname> options.
=item B<multiline>
Display the name using multiple lines.
It is equivalent to B<esc_ctrl>, B<esc_msb>, B<sep_multiline>, B<space_eq>,
B<lname> and B<align>.
=item B<esc_2253>
Escape the "special" characters in a field, as required by RFC 2253.
That is, any of the characters C<,+"E<lt>E<gt>;>, C<#> at the beginning of
a string and leading or trailing spaces.
=item B<esc_2254>
Escape the "special" characters in a field as required by RFC 2254 in a field.
That is, the B<NUL> character and and of C<()*>.
=item B<esc_ctrl>
Escape non-printable ASCII characters, codes less than 0x20 (space)
or greater than 0x7F (DELETE). They are displayed using RFC 2253 C<\XX>
notation where B<XX> are the two hex digits representing the character value.
=item B<esc_msb>
Escape any characters with the most significant bit set, that is with
values larger than 127, as described in B<esc_ctrl>.
=item B<use_quote>
Escapes some characters by surrounding the entire string with quotation
marks, C<">.
Without this option, individual special characters are preceeded with
a backslash character, C<\>.
=item B<utf8>
Convert all strings to UTF-8 format first as required by RFC 2253.
If the output device is UTF-8 compatible, then using this option (and
not setting B<esc_msb>) may give the correct display of multibyte
characters.
If this option is not set, then multibyte characters larger than 0xFF
will be output as C<\UXXXX> for 16 bits or C<\WXXXXXXXX> for 32 bits.
In addition, any UTF8Strings will be converted to their character form first.
=item B<ignore_type>
This option does not attempt to interpret multibyte characters in any
way. That is, the content octets are merely dumped as though one octet
represents each character. This is useful for diagnostic purposes but
will result in rather odd looking output.
=item B<show_type>
Display the type of the ASN1 character string before the value,
such as C<BMPSTRING: Hello World>.
=item B<dump_der>
Any fields that would be output in hex format are displayed using
the DER encoding of the field.
If not set, just the content octets are displayed.
Either way, the B<#XXXX...> format of RFC 2253 is used.
=item B<dump_nostr>
Dump non-character strings, such as ASN.1 B<OCTET STRING>.
If this option is not set, then non character string types will be displayed
as though each content octet represents a single character.
=item B<dump_all>
Dump all fields. When this used with B<dump_der>, this allows the
DER encoding of the structure to be unambiguously determined.
=item B<dump_unknown>
Dump any field whose OID is not recognised by OpenSSL.
=item B<sep_comma_plus>, B<sep_comma_plus_space>, B<sep_semi_plus_space>,
B<sep_multiline>
Specify the field separators. The first word is used between the
Relative Distinguished Names (RDNs) and the second is between
multiple Attribute Value Assertions (AVAs). Multiple AVAs are
very rare and their use is discouraged.
The options ending in "space" additionally place a space after the separator to make it more readable.
The B<sep_multiline> starts each field on its own line, and uses "plus space"
for the AVA separator.
It also indents the fields by four characters.
The default value is B<sep_comma_plus_space>.
=item B<dn_rev>
Reverse the fields of the DN as required by RFC 2253.
This also reverses the order of multiple AVAs in a field, but this is
permissible as there is no ordering on values.
=item B<nofname>, B<sname>, B<lname>, B<oid>
Specify how the field name is displayed.
B<nofname> does not display the field at all.
B<sname> uses the "short name" form (CN for commonName for example).
B<lname> uses the long form.
B<oid> represents the OID in numerical form and is useful for
diagnostic purpose.
=item B<align>
Align field values for a more readable output. Only usable with
B<sep_multiline>.
=item B<space_eq>
Places spaces round the equal sign, C<=>, character which follows the field
name.
=back
=head2 TLS Version Options
Several commands use SSL, TLS, or DTLS. By default, the commands use TLS and
clients will offer the lowest and highest protocol version they support,
and servers will pick the highest version that the client offers that is also
supported by the server.
The options below can be used to limit which protocol versions are used,
and whether TCP (SSL and TLS) or UDP (DTLS) is used.
Note that not all protocols and flags may be available, depending on how
OpenSSL was built.
=over 4
=item B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-tls1_3>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>, B<-no_tls1_3>
These options require or disable the use of the specified SSL or TLS protocols.
When a specific TLS version is required, only that version will be offered or
accepted.
Only one specific protocol can be given and it cannot be combined with any of
the B<no_> options.
=item B<-dtls>, B<-dtls1>, B<-dtls1_2>
These options specify to use DTLS instead of DLTS.
With B<-dtls>, clients will negotiate any supported DTLS protocol version.
Use the B<-dtls1> or B<-dtls1_2> options to support only DTLS1.0 or DTLS1.2,
respectively.
=back
=head2 Engine Options
=over 4
=item B<-engine> I<id>
Use the engine identified by I<id> and use all the methods it
implements (algorithms, key storage, etc.), unless specified otherwise in
the command-specific documentation or it is configured to do so, as described
in L<config(5)/Engine Configuration Module>.
=back
=head1 ENVIRONMENT
The OpenSSL library can be take some configuration parameters from the
environment. Some of these variables are listed below. For information
about specific commands, see L<openssl-engine(1)>, L<openssl-provider(1)>,
L<openssl-rehash(1)>, and L<tsget(1)>.
For information about the use of environment variables in configuration,
see L<config(5)/ENVIRONMENT>.
For information about querying or specifying CPU architecture flags, see
L<OPENSSL_ia32cap(3)>, and L<OPENSSL_s390xcap(3)>.
For information about all environment variables used by the OpenSSL libraries,
see L<openssl-env(7)>.
=over 4
=item B<OPENSSL_TRACE=>I<name>[,...]
@@ -749,6 +1111,7 @@ L<openssl-version(1)>,
L<openssl-x509(1)>,
L<config(5)>,
L<crypto(7)>,
L<openssl-env(7)>.
L<ssl(7)>,
L<x509v3_config(5)>
+3 -3
View File
@@ -24,7 +24,7 @@ B<-h> I<server_url>
=head1 DESCRIPTION
This command can be used for sending a timestamp request, as specified
in B<RFC 3161>, to a timestamp server over HTTP or HTTPS and storing the
in RFC 3161, to a timestamp server over HTTP or HTTPS and storing the
timestamp response in a file. It cannot be used for creating the requests
and verifying responses, you have to use L<openssl-ts(1)> to do that. This
command can send several requests to the server without closing the TCP
@@ -121,7 +121,7 @@ The name of an EGD socket to get random data from. (Optional)
=item I<request> ...
List of files containing B<RFC 3161> DER-encoded timestamp requests. If no
List of files containing RFC 3161 DER-encoded timestamp requests. If no
requests are specified only one request will be sent to the server and it will
be read from the standard input.
(Optional)
@@ -188,7 +188,7 @@ example:
L<openssl(1)>,
L<openssl-ts(1)>,
L<WWW::Curl::Easy>,
L<RFC 3161|https://www.rfc-editor.org/rfc/rfc3161.html>
L<https://www.rfc-editor.org/rfc/rfc3161.html>
=head1 COPYRIGHT
+2 -2
View File
@@ -22,10 +22,10 @@ ASN1_INTEGER_get_int64, ASN1_INTEGER_get, ASN1_INTEGER_set_int64, ASN1_INTEGER_s
ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_INTEGER *a);
int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_ENUMERATED *a);
long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
int ASN1_ENUMERATED_set_int64(ASN1_INTEGER *a, int64_t r);
int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r);
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai);
+13 -1
View File
@@ -13,7 +13,8 @@ ASN1_TIME_print, ASN1_UTCTIME_print, ASN1_GENERALIZEDTIME_print,
ASN1_TIME_diff,
ASN1_TIME_cmp_time_t, ASN1_UTCTIME_cmp_time_t,
ASN1_TIME_compare,
ASN1_TIME_to_generalizedtime - ASN.1 Time functions
ASN1_TIME_to_generalizedtime,
ASN1_TIME_dup, ASN1_UTCTIME_dup, ASN1_GENERALIZEDTIME_dup - ASN.1 Time functions
=head1 SYNOPSIS
@@ -58,6 +59,10 @@ ASN1_TIME_to_generalizedtime - ASN.1 Time functions
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
ASN1_GENERALIZEDTIME **out);
ASN1_TIME *ASN1_TIME_dup(const ASN1_TIME *t);
ASN1_UTCTIME *ASN1_UTCTIME_dup(const ASN1_UTCTIME *t);
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_dup(const ASN1_GENERALIZEDTIME *t);
=head1 DESCRIPTION
The ASN1_TIME_set(), ASN1_UTCTIME_set() and ASN1_GENERALIZEDTIME_set()
@@ -131,6 +136,10 @@ The ASN1_TIME_to_generalizedtime() function converts an B<ASN1_TIME> to an
B<ASN1_GENERALIZEDTIME>, regardless of year. If either I<out> or
I<*out> are NULL, then a new object is allocated and must be freed after use.
The ASN1_TIME_dup(), ASN1_UTCTIME_dup() and ASN1_GENERALIZEDTIME_dup() functions
duplicate the time structure I<t> and return the duplicated result
correspondingly.
=head1 NOTES
The B<ASN1_TIME> structure corresponds to the ASN.1 structure B<Time>
@@ -210,6 +219,9 @@ or 1 if I<a> is after I<b>. -2 is returned on error.
ASN1_TIME_to_generalizedtime() returns a pointer to the appropriate time
structure on success or NULL if an error occurred.
ASN1_TIME_dup(), ASN1_UTCTIME_dup() and ASN1_GENERALIZEDTIME_dup() return a
pointer to a time structure or NULL if an error occurred.
=head1 EXAMPLES
Set a time structure to one hour after the current time and print it out:
+1 -1
View File
@@ -187,7 +187,7 @@ ASYNC_WAIT_CTX_set_wait_fd, ASYNC_WAIT_CTX_get_fd, ASYNC_WAIT_CTX_get_all_fds,
ASYNC_WAIT_CTX_get_changed_fds, ASYNC_WAIT_CTX_clear_fd,
ASYNC_WAIT_CTX_set_callback, ASYNC_WAIT_CTX_get_callback and
ASYNC_WAIT_CTX_set_status all return 1 on success or 0 on error.
ASYNC_WAIT_CTX_get_status() returs the engine status.
ASYNC_WAIT_CTX_get_status() returns the engine status.
=head1 NOTES
+12
View File
@@ -9,6 +9,10 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
#include <openssl/blowfish.h>
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
B<OPENSSL_API_COMPAT> with a suitable version value, see
L<openssl_user_macros(7)>:
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
@@ -29,6 +33,10 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
=head1 DESCRIPTION
All of the functions described on this page are deprecated. Applications should
instead use L<EVP_EncryptInit_ex(3)>, L<EVP_EncryptUpdate(3)> and
L<EVP_EncryptFinal_ex(3)> or the equivalently named decrypt functions.
This library implements the Blowfish cipher, which was invented and described
by Counterpane (see http://www.counterpane.com/blowfish.html ).
@@ -107,6 +115,10 @@ functions directly.
L<EVP_EncryptInit(3)>,
L<des_modes(7)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+70
View File
@@ -0,0 +1,70 @@
=pod
=head1 NAME
BIO_f_prefix, BIO_set_prefix, BIO_set_indent, BIO_get_indent
- prefix BIO filter
=head1 SYNOPSIS
#include <openssl/bio.h>
const BIO_METHOD *BIO_f_prefix(void);
long BIO_set_prefix(BIO *b, const char *prefix);
long BIO_set_indent(BIO *b, long indent);
long BIO_get_indent(BIO *b);
=head1 DESCRIPTION
BIO_f_cipher() returns the prefix BIO method. This is a filter for
text output, where each line gets automatically prefixed and indented
according to user input.
The prefix and the indentation are combined. For each line of output
going through this filter, the prefix is output first, then the amount
of additional spaces indicated by the indentation, and then the line
itself.
By default, there is no prefix, and indentation is set to 0.
BIO_set_prefix() sets the prefix to be used for future lines of
text, using I<prefix>. I<prefix> may be NULL, signifying that there
should be no prefix. If I<prefix> isn't NULL, this function makes a
copy of it.
BIO_set_indent() sets the indentation to be used for future lines of
text, using I<indent>. Negative values are not allowed.
BIO_get_indent() gets the current indentation.
=head1 NOTES
BIO_set_prefix(), BIO_set_indent() and BIO_get_indent() are
implemented as macros.
=head1 RETURN VALUES
BIO_f_prefix() returns the prefix BIO method.
BIO_set_prefix() returns 1 if the prefix was correctly set, or 0 on
failure.
BIO_set_indent() returns 1 if the prefix was correctly set, or 0 on
failure.
BIO_get_indent() returns the current indentation.
=head1 SEE ALSO
L<bio(7)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+1 -1
View File
@@ -47,7 +47,7 @@ BIO_get_shutdown() returns the stat of the BIO's shutdown (i.e. BIO_CLOSE) flag.
=head1 SEE ALSO
L<bio>, L<BIO_meth_new>
L<bio(7)>, L<BIO_meth_new(3)>
=head1 HISTORY
+30 -6
View File
@@ -3,16 +3,27 @@
=head1 NAME
BIO_get_ex_new_index, BIO_set_ex_data, BIO_get_ex_data,
ENGINE_get_ex_new_index, ENGINE_set_ex_data, ENGINE_get_ex_data,
UI_get_ex_new_index, UI_set_ex_data, UI_get_ex_data,
X509_get_ex_new_index, X509_set_ex_data, X509_get_ex_data,
X509_STORE_get_ex_new_index, X509_STORE_set_ex_data, X509_STORE_get_ex_data,
X509_STORE_CTX_get_ex_new_index, X509_STORE_CTX_set_ex_data, X509_STORE_CTX_get_ex_data,
BIO_set_app_data, BIO_get_app_data,
DH_get_ex_new_index, DH_set_ex_data, DH_get_ex_data,
DSA_get_ex_new_index, DSA_set_ex_data, DSA_get_ex_data,
ECDH_get_ex_new_index, ECDH_set_ex_data, ECDH_get_ex_data,
EC_KEY_get_ex_new_index, EC_KEY_set_ex_data, EC_KEY_get_ex_data,
RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data
ENGINE_get_ex_new_index, ENGINE_set_ex_data, ENGINE_get_ex_data,
RAND_DRBG_set_ex_data, RAND_DRBG_get_ex_data, RAND_DRBG_get_ex_new_index,
RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data,
RSA_set_app_data, RSA_get_app_data,
SSL_get_ex_new_index, SSL_set_ex_data, SSL_get_ex_data,
SSL_set_app_data, SSL_get_app_data,
SSL_CTX_get_ex_new_index, SSL_CTX_set_ex_data, SSL_CTX_get_ex_data,
SSL_CTX_set_app_data, SSL_CTX_get_app_data,
SSL_SESSION_get_ex_new_index, SSL_SESSION_set_ex_data, SSL_SESSION_get_ex_data,
SSL_SESSION_set_app_data, SSL_SESSION_get_app_data,
UI_get_ex_new_index, UI_set_ex_data, UI_get_ex_data,
UI_set_app_data, UI_get_app_data,
X509_STORE_CTX_get_ex_new_index, X509_STORE_CTX_set_ex_data, X509_STORE_CTX_get_ex_data,
X509_STORE_CTX_set_app_data, X509_STORE_CTX_get_app_data,
X509_STORE_get_ex_new_index, X509_STORE_set_ex_data, X509_STORE_get_ex_data,
X509_get_ex_new_index, X509_set_ex_data, X509_get_ex_data
- application-specific data
=head1 SYNOPSIS
@@ -30,6 +41,9 @@ RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data
void *TYPE_get_ex_data(TYPE *d, int idx);
#define TYPE_set_app_data(TYPE *d, void *arg)
#define TYPE_get_app_data(TYPE *d)
=head1 DESCRIPTION
In the description here, I<TYPE> is used a placeholder
@@ -48,6 +62,16 @@ an offset into the opaque exdata part of the TYPE object.
TYPE_get_ex_data() is a function that calls CRYPTO_get_ex_data() with
an offset into the opaque exdata part of the TYPE object.
For compatibility with previous releases, the exdata index of zero is
reserved for "application data." There are two convenience functions for
this.
TYPE_set_app_data() is a macro that invokes TYPE_set_ex_data() with
B<idx> set to zero.
TYPE_get_app_data() is a macro that invokes TYPE_get_ex_data() with
B<idx> set to zero.
Note that these functions are not defined for the B<RAND_DRBG> type because
there are no backward compatibility concerns.
=head1 RETURN VALUES
TYPE_get_new_ex_index() returns a new index on success or -1 on error.
+4 -4
View File
@@ -60,7 +60,7 @@ BIO_meth_set_callback_ctrl - Routines to build up BIO methods
The B<BIO_METHOD> type is a structure used for the implementation of new BIO
types. It provides a set of functions used by OpenSSL for the implementation
of the various BIO capabilities. See the L<bio> page for more information.
of the various BIO capabilities. See the L<bio(7)> page for more information.
BIO_meth_new() creates a new B<BIO_METHOD> structure. It should be given a
unique integer B<type> and a string that represents its B<name>.
@@ -72,7 +72,7 @@ include B<BIO_TYPE_BUFFER> and B<BIO_TYPE_CIPHER>. Filter BIOs should have a
type which have the "filter" bit set (B<BIO_TYPE_FILTER>). Source/sink BIOs
should have the "source/sink" bit set (B<BIO_TYPE_SOURCE_SINK>). File descriptor
based BIOs (e.g. socket, fd, connect, accept etc) should additionally have the
"descriptor" bit set (B<BIO_TYPE_DESCRIPTOR>). See the L<BIO_find_type> page for
"descriptor" bit set (B<BIO_TYPE_DESCRIPTOR>). See the L<BIO_find_type(3)> page for
more information.
BIO_meth_free() destroys a B<BIO_METHOD> structure and frees up any memory
@@ -108,7 +108,7 @@ application calling BIO_gets(). The parameters for the function have the same
meaning as for BIO_gets().
BIO_meth_get_ctrl() and BIO_meth_set_ctrl() get and set the function used for
processing ctrl messages in the BIO respectively. See the L<BIO_ctrl> page for
processing ctrl messages in the BIO respectively. See the L<BIO_ctrl(3)> page for
more information. This function will be called in response to the application
calling BIO_ctrl(). The parameters for the function have the same meaning as for
BIO_ctrl().
@@ -146,7 +146,7 @@ The B<BIO_meth_get> functions return the corresponding function pointers.
=head1 SEE ALSO
L<bio>, L<BIO_find_type>, L<BIO_ctrl>, L<BIO_read_ex>, L<BIO_new>
L<bio(7)>, L<BIO_find_type(3)>, L<BIO_ctrl(3)>, L<BIO_read_ex(3)>, L<BIO_new(3)>
=head1 HISTORY
+1 -1
View File
@@ -71,7 +71,7 @@ be written to B<md1> as before.
=head1 SEE ALSO
L<bio>
L<bio(7)>
=head1 HISTORY
+1 -1
View File
@@ -128,7 +128,7 @@ BIO_get_retry_reason() returns the reason for a special condition.
=head1 SEE ALSO
L<bio>
L<bio(7)>
=head1 HISTORY
+2 -1
View File
@@ -20,7 +20,8 @@ an ASN1_OBJECT pointer. An application can then decide how to process the
CMS_ContentInfo structure based on this value.
CMS_set1_eContentType() sets the embedded content type of a CMS_ContentInfo
structure. It should be called with CMS functions (such as L<CMS_sign>, L<CMS_encrypt>)
structure. It should be called with CMS functions (such as L<CMS_sign(3)>,
L<CMS_encrypt(3)>)
with the B<CMS_PARTIAL>
flag and B<before> the structure is finalised, otherwise the results are
undefined.
+3 -2
View File
@@ -44,13 +44,12 @@ Several OpenSSL structures can have application-specific data attached to them,
known as "exdata."
The specific structures are:
APP
BIO
DH
DRBG
DSA
EC_KEY
ENGINE
RAND_DRBG
RSA
SSL
SSL_CTX
@@ -61,6 +60,8 @@ The specific structures are:
X509_STORE
X509_STORE_CTX
In addition, the B<APP> name is reserved for use by application code.
Each is identified by an B<CRYPTO_EX_INDEX_xxx> define in the B<crypto.h>
header file. In addition, B<CRYPTO_EX_INDEX_APP> is reserved for
applications to use this facility for their own structures.
+2 -2
View File
@@ -25,8 +25,8 @@ logs). The list can be loaded from one or more files and then searched by LogID
CTLOG_STORE_new() creates an empty list of CT logs. This is then populated
by CTLOG_STORE_load_default_file() or CTLOG_STORE_load_file().
CTLOG_STORE_load_default_file() loads from the default file, which is named
"ct_log_list.cnf" in OPENSSLDIR (see the output of L<version>). This can be
overridden using an environment variable named "CTLOG_FILE".
F<ct_log_list.cnf> in OPENSSLDIR (see the output of L<openssl-version(1)>).
This can be overridden using an environment variable named B<CTLOG_FILE>.
CTLOG_STORE_load_file() loads from a caller-specified file path instead.
Both of these functions append any loaded CT logs to the CTLOG_STORE.
+1 -2
View File
@@ -88,8 +88,7 @@ DSA_meth_set_keygen - Routines to build up DSA methods
The B<DSA_METHOD> type is a structure used for the provision of custom DSA
implementations. It provides a set of functions used by OpenSSL for the
implementation of the various DSA capabilities. See the L<dsa> page for more
information.
implementation of the various DSA capabilities.
DSA_meth_new() creates a new B<DSA_METHOD> structure. It should be given a
unique B<name> and a set of B<flags>. The B<name> should be a NULL terminated
+1 -1
View File
@@ -49,7 +49,7 @@ be released during the change. It is possible to have DSA keys that only
work with certain DSA_METHOD implementations (eg. from an ENGINE module
that supports embedded hardware-protected keys), and in such cases
attempting to change the DSA_METHOD for the key can have unexpected
results. See L<DSA_meth_new> for information on constructing custom DSA_METHOD
results. See L<DSA_meth_new(3)> for information on constructing custom DSA_METHOD
objects;
DSA_new_method() allocates and initializes a DSA structure so that B<engine>
+52 -38
View File
@@ -42,7 +42,7 @@ EC_GROUP_get_pentanomial_basis, EC_GROUP_get0_field
int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form);
point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *group);
unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
size_t EC_GROUP_get_seed_len(const EC_GROUP *);
@@ -65,34 +65,39 @@ EC_GROUP_get_pentanomial_basis, EC_GROUP_get0_field
=head1 DESCRIPTION
EC_GROUP_copy copies the curve B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
EC_GROUP_copy() copies the curve B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
EC_GROUP_dup creates a new EC_GROUP object and copies the content from B<src> to the newly created
EC_GROUP_dup() creates a new EC_GROUP object and copies the content from B<src> to the newly created
EC_GROUP object.
EC_GROUP_method_of obtains the EC_METHOD of B<group>.
EC_GROUP_method_of() obtains the EC_METHOD of B<group>.
EC_GROUP_set_generator sets curve parameters that must be agreed by all participants using the curve. These
EC_GROUP_set_generator() sets curve parameters that must be agreed by all participants using the curve. These
parameters include the B<generator>, the B<order> and the B<cofactor>. The B<generator> is a well defined point on the
curve chosen for cryptographic operations. Integers used for point multiplications will be between 0 and
n-1 where n is the B<order>. The B<order> multiplied by the B<cofactor> gives the number of points on the curve.
EC_GROUP_get0_generator returns the generator for the identified B<group>.
EC_GROUP_get0_generator() returns the generator for the identified B<group>.
The functions EC_GROUP_get_order and EC_GROUP_get_cofactor populate the provided B<order> and B<cofactor> parameters
with the respective order and cofactors for the B<group>.
EC_GROUP_get_order() retrieves the order of B<group> and copies its value into
B<order>. It fails in case B<group> is not fully initialized (i.e., its order
is not set or set to zero).
The functions EC_GROUP_set_curve_name and EC_GROUP_get_curve_name, set and get the NID for the curve respectively
EC_GROUP_get_cofactor() retrieves the cofactor of B<group> and copies its value
into B<cofactor>. It fails in case B<group> is not fully initialized or if the
cofactor is not set (or set to zero).
The functions EC_GROUP_set_curve_name() and EC_GROUP_get_curve_name(), set and get the NID for the curve respectively
(see L<EC_GROUP_new(3)>). If a curve does not have a NID associated with it, then EC_GROUP_get_curve_name
will return 0.
will return NID_undef.
The asn1_flag value is used to determine whether the curve encoding uses
explicit parameters or a named curve using an ASN1 OID: many applications only
support the latter form. If asn1_flag is B<OPENSSL_EC_NAMED_CURVE> then the
named curve form is used and the parameters must have a corresponding
named curve NID set. If asn1_flags is B<OPENSSL_EC_EXPLICIT_CURVE> the
parameters are explicitly encoded. The functions EC_GROUP_get_asn1_flag and
EC_GROUP_set_asn1_flag get and set the status of the asn1_flag for the curve.
parameters are explicitly encoded. The functions EC_GROUP_get_asn1_flag() and
EC_GROUP_set_asn1_flag() get and set the status of the asn1_flag for the curve.
Note: B<OPENSSL_EC_EXPLICIT_CURVE> was added in OpenSSL 1.1.0, for
previous versions of OpenSSL the value 0 must be used instead. Before OpenSSL
1.1.0 the default form was to use explicit parameters (meaning that
@@ -123,30 +128,30 @@ the two possible solutions for y has been used, followed by the octets for x.
For POINT_CONVERSION_HYBRID the point is encoded as an octet signifying the HYBRID form has been used AND which of the two
possible solutions for y has been used, followed by the octets for x, followed by the octets for y.
The functions EC_GROUP_set_point_conversion_form and EC_GROUP_get_point_conversion_form set and get the point_conversion_form
The functions EC_GROUP_set_point_conversion_form() and EC_GROUP_get_point_conversion_form(), set and get the point_conversion_form
for the curve respectively.
ANSI X9.62 (ECDSA standard) defines a method of generating the curve parameter b from a random number. This provides advantages
in that a parameter obtained in this way is highly unlikely to be susceptible to special purpose attacks, or have any trapdoors in it.
If the seed is present for a curve then the b parameter was generated in a verifiable fashion using that seed. The OpenSSL EC library
does not use this seed value but does enable you to inspect it using EC_GROUP_get0_seed. This returns a pointer to a memory block
containing the seed that was used. The length of the memory block can be obtained using EC_GROUP_get_seed_len. A number of the
does not use this seed value but does enable you to inspect it using EC_GROUP_get0_seed(). This returns a pointer to a memory block
containing the seed that was used. The length of the memory block can be obtained using EC_GROUP_get_seed_len(). A number of the
built-in curves within the library provide seed values that can be obtained. It is also possible to set a custom seed using
EC_GROUP_set_seed and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use
EC_GROUP_set_seed() and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use
this seed value, although it will be preserved in any ASN1 based communications.
EC_GROUP_get_degree gets the degree of the field. For Fp fields this will be the number of bits in p. For F2^m fields this will be
EC_GROUP_get_degree() gets the degree of the field. For Fp fields this will be the number of bits in p. For F2^m fields this will be
the value m.
The function EC_GROUP_check_discriminant calculates the discriminant for the curve and verifies that it is valid.
The function EC_GROUP_check_discriminant() calculates the discriminant for the curve and verifies that it is valid.
For a curve defined over Fp the discriminant is given by the formula 4*a^3 + 27*b^2 whilst for F2^m curves the discriminant is
simply b. In either case for the curve to be valid the discriminant must be non zero.
The function EC_GROUP_check performs a number of checks on a curve to verify that it is valid. Checks performed include
The function EC_GROUP_check() performs a number of checks on a curve to verify that it is valid. Checks performed include
verifying that the discriminant is non zero; that a generator has been defined; that the generator is on the curve and has
the correct order.
The function EC_GROUP_check_named_curve determines if the group's domain parameters match one of the built-in curves supported by the library.
The function EC_GROUP_check_named_curve() determines if the group's domain parameters match one of the built-in curves supported by the library.
The curve name is returned as a B<NID> if it matches. If the group's domain parameters have been modified then no match will be found.
If the curve name of the given group is B<NID_undef> (e.g. it has been created by using explicit parameters with no curve name),
then this method can be used to lookup the name of the curve that matches the group domain parameters. The built-in curves contain
@@ -156,9 +161,9 @@ If B<nist_only> is 1 it will only look for NIST approved curves, otherwise it se
This function may be passed a BN_CTX object in the B<ctx> parameter.
The B<ctx> parameter may be NULL.
EC_GROUP_cmp compares B<a> and B<b> to determine whether they represent the same curve or not.
EC_GROUP_cmp() compares B<a> and B<b> to determine whether they represent the same curve or not.
The functions EC_GROUP_get_basis_type, EC_GROUP_get_trinomial_basis and EC_GROUP_get_pentanomial_basis should only be called for curves
The functions EC_GROUP_get_basis_type(), EC_GROUP_get_trinomial_basis() and EC_GROUP_get_pentanomial_basis() should only be called for curves
defined over an F2^m field. Addition and multiplication operations within an F2^m field are performed using an irreducible polynomial
function f(x). This function is either a trinomial of the form:
@@ -168,25 +173,34 @@ or a pentanomial of the form:
f(x) = x^m + x^k3 + x^k2 + x^k1 + 1 with m > k3 > k2 > k1 >= 1
The function EC_GROUP_get_basis_type returns a NID identifying whether a trinomial or pentanomial is in use for the field. The
function EC_GROUP_get_trinomial_basis must only be called where f(x) is of the trinomial form, and returns the value of B<k>. Similarly
the function EC_GROUP_get_pentanomial_basis must only be called where f(x) is of the pentanomial form, and returns the values of B<k1>,
The function EC_GROUP_get_basis_type() returns a NID identifying whether a trinomial or pentanomial is in use for the field. The
function EC_GROUP_get_trinomial_basis() must only be called where f(x) is of the trinomial form, and returns the value of B<k>. Similarly
the function EC_GROUP_get_pentanomial_basis() must only be called where f(x) is of the pentanomial form, and returns the values of B<k1>,
B<k2> and B<k3> respectively.
=head1 RETURN VALUES
The following functions return 1 on success or 0 on error: EC_GROUP_copy, EC_GROUP_set_generator, EC_GROUP_check,
EC_GROUP_check_discriminant, EC_GROUP_get_trinomial_basis and EC_GROUP_get_pentanomial_basis.
The following functions return 1 on success or 0 on error: EC_GROUP_copy(), EC_GROUP_set_generator(), EC_GROUP_check(),
EC_GROUP_check_discriminant(), EC_GROUP_get_trinomial_basis() and EC_GROUP_get_pentanomial_basis().
EC_GROUP_dup returns a pointer to the duplicated curve, or NULL on error.
EC_GROUP_dup() returns a pointer to the duplicated curve, or NULL on error.
EC_GROUP_method_of returns the EC_METHOD implementation in use for the given curve or NULL on error.
EC_GROUP_method_of() returns the EC_METHOD implementation in use for the given curve or NULL on error.
EC_GROUP_get0_generator returns the generator for the given curve or NULL on error.
EC_GROUP_get0_generator() returns the generator for the given curve or NULL on error.
EC_GROUP_get_order, EC_GROUP_get_cofactor, EC_GROUP_get_curve_name, EC_GROUP_get_asn1_flag, EC_GROUP_get_point_conversion_form
and EC_GROUP_get_degree return the order, cofactor, curve name (NID), ASN1 flag, point_conversion_form and degree for the
specified curve respectively. If there is no curve name associated with a curve then EC_GROUP_get_curve_name will return 0.
EC_GROUP_get_order() returns 0 if the order is not set (or set to zero) for
B<group> or if copying into B<order> fails, 1 otherwise.
EC_GROUP_get_cofactor() returns 0 if the cofactor is not set (or is set to zero) for B<group> or if copying into B<cofactor> fails, 1 otherwise.
EC_GROUP_get_curve_name() returns the curve name (NID) for B<group> or will return NID_undef if no curve name is associated.
EC_GROUP_get_asn1_flag() returns the ASN1 flag for the specified B<group> .
EC_GROUP_get_point_conversion_form() returns the point_conversion_form for B<group>.
EC_GROUP_get_degree() returns the degree for B<group> or 0 if the operation is not supported by the underlying group implementation.
EC_GROUP_check_named_curve() returns the nid of the matching named curve, otherwise it returns 0 for no match, or -1 on error.
@@ -196,15 +210,15 @@ EC_GROUP_get0_cofactor() returns an internal pointer to the group cofactor.
EC_GROUP_get0_field() returns an internal pointer to the group field. For curves over GF(p), this is the modulus; for curves
over GF(2^m), this is the irreducible polynomial defining the field.
EC_GROUP_get0_seed returns a pointer to the seed that was used to generate the parameter b, or NULL if the seed is not
specified. EC_GROUP_get_seed_len returns the length of the seed or 0 if the seed is not specified.
EC_GROUP_get0_seed() returns a pointer to the seed that was used to generate the parameter b, or NULL if the seed is not
specified. EC_GROUP_get_seed_len() returns the length of the seed or 0 if the seed is not specified.
EC_GROUP_set_seed returns the length of the seed that has been set. If the supplied seed is NULL, or the supplied seed length is
EC_GROUP_set_seed() returns the length of the seed that has been set. If the supplied seed is NULL, or the supplied seed length is
0, the return value will be 1. On error 0 is returned.
EC_GROUP_cmp returns 0 if the curves are equal, 1 if they are not equal, or -1 on error.
EC_GROUP_cmp() returns 0 if the curves are equal, 1 if they are not equal, or -1 on error.
EC_GROUP_get_basis_type returns the values NID_X9_62_tpBasis or NID_X9_62_ppBasis (as defined in <openssl/obj_mac.h>) for a
EC_GROUP_get_basis_type() returns the values NID_X9_62_tpBasis or NID_X9_62_ppBasis (as defined in <openssl/obj_mac.h>) for a
trinomial or pentanomial respectively. Alternatively in the event of an error a 0 is returned.
=head1 SEE ALSO
+82 -42
View File
@@ -32,7 +32,6 @@ objects
EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params)
EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params)
void EC_GROUP_free(EC_GROUP *group);
void EC_GROUP_clear_free(EC_GROUP *group);
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
const BIGNUM *b, BN_CTX *ctx);
@@ -59,57 +58,78 @@ objects
size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
B<OPENSSL_API_COMPAT> with a suitable version value, see
L<openssl_user_macros(7)>:
void EC_GROUP_clear_free(EC_GROUP *group);
=head1 DESCRIPTION
Within the library there are two forms of elliptic curve that are of interest. The first form is those defined over the
prime field Fp. The elements of Fp are the integers 0 to p-1, where p is a prime number. This gives us a revised
Within the library there are two forms of elliptic curve that are of interest.
The first form is those defined over the prime field Fp. The elements of Fp are
the integers 0 to p-1, where p is a prime number. This gives us a revised
elliptic curve equation as follows:
y^2 mod p = x^3 +ax + b mod p
The second form is those defined over a binary field F2^m where the elements of the field are integers of length at
most m bits. For this form the elliptic curve equation is modified to:
The second form is those defined over a binary field F2^m where the elements of
the field are integers of length at most m bits. For this form the elliptic
curve equation is modified to:
y^2 + xy = x^3 + ax^2 + b (where b != 0)
Operations in a binary field are performed relative to an B<irreducible polynomial>. All such curves with OpenSSL
use a trinomial or a pentanomial for this parameter.
Operations in a binary field are performed relative to an
B<irreducible polynomial>. All such curves with OpenSSL use a trinomial or a
pentanomial for this parameter.
A new curve can be constructed by calling EC_GROUP_new_ex, using the implementation provided by B<meth> (see
L<EC_GFp_simple_method(3)>) and associated with the library context B<ctx>
(see L<OPENSSL_CTX(3)>).
The B<ctx> parameter may be NULL in which case the default library context is used.
A new curve can be constructed by calling EC_GROUP_new_ex(), using the
implementation provided by B<meth> (see L<EC_GFp_simple_method(3)>) and
associated with the library context B<ctx> (see L<OPENSSL_CTX(3)>).
The B<ctx> parameter may be NULL in which case the default library context is
used.
It is then necessary to call EC_GROUP_set_curve() to set the curve parameters.
EC_GROUP_new_from_ecparameters() will create a group from the
specified B<params> and
EC_GROUP_new_from_ecpkparameters() will create a group from the specific PK B<params>.
EC_GROUP_new_from_ecpkparameters() will create a group from the specific PK
B<params>.
EC_GROUP_new is the same as EC_GROUP_new_ex() except that the library context
EC_GROUP_new() is the same as EC_GROUP_new_ex() except that the library context
used is always the default library context.
EC_GROUP_set_curve() sets the curve parameters B<p>, B<a> and B<b>. For a curve over Fp B<b>
is the prime for the field. For a curve over F2^m B<p> represents the irreducible polynomial - each bit
represents a term in the polynomial. Therefore there will either be three or five bits set dependent on whether
the polynomial is a trinomial or a pentanomial.
EC_GROUP_set_curve() sets the curve parameters B<p>, B<a> and B<b>. For a curve
over Fp B<p> is the prime for the field. For a curve over F2^m B<p> represents
the irreducible polynomial - each bit represents a term in the polynomial.
Therefore there will either be three or five bits set dependent on whether the
polynomial is a trinomial or a pentanomial.
In either case, B<a> and B<b> represents the coefficients a and b from the
relevant equation introduced above.
EC_group_get_curve() obtains the previously set curve parameters.
EC_GROUP_set_curve_GFp() and EC_GROUP_set_curve_GF2m() are synonyms for EC_GROUP_set_curve(). They are defined for
backwards compatibility only and should not be used.
EC_GROUP_set_curve_GFp() and EC_GROUP_set_curve_GF2m() are synonyms for
EC_GROUP_set_curve(). They are defined for backwards compatibility only and
should not be used.
EC_GROUP_get_curve_GFp() and EC_GROUP_get_curve_GF2m() are synonyms for EC_GROUP_get_curve(). They are defined for
backwards compatibility only and should not be used.
EC_GROUP_get_curve_GFp() and EC_GROUP_get_curve_GF2m() are synonyms for
EC_GROUP_get_curve(). They are defined for backwards compatibility only and
should not be used.
The functions EC_GROUP_new_curve_GFp and EC_GROUP_new_curve_GF2m are shortcuts for calling EC_GROUP_new and then the
EC_GROUP_set_curve function. An appropriate default implementation method will be used.
The functions EC_GROUP_new_curve_GFp() and EC_GROUP_new_curve_GF2m() are
shortcuts for calling EC_GROUP_new() and then the EC_GROUP_set_curve() function.
An appropriate default implementation method will be used.
Whilst the library can be used to create any curve using the functions described above, there are also a number of
predefined curves that are available. In order to obtain a list of all of the predefined curves, call the function
EC_get_builtin_curves(). The parameter B<r> should be an array of EC_builtin_curve structures of size B<nitems>. The function
will populate the B<r> array with information about the built-in curves. If B<nitems> is less than the total number of
curves available, then the first B<nitems> curves will be returned. Otherwise the total number of curves will be
provided. The return value is the total number of curves available (whether that number has been populated in B<r> or
not). Passing a NULL B<r>, or setting B<nitems> to 0 will do nothing other than return the total number of curves available.
Whilst the library can be used to create any curve using the functions described
above, there are also a number of predefined curves that are available. In order
to obtain a list of all of the predefined curves, call the function
EC_get_builtin_curves(). The parameter B<r> should be an array of
EC_builtin_curve structures of size B<nitems>. The function will populate the
B<r> array with information about the built-in curves. If B<nitems> is less than
the total number of curves available, then the first B<nitems> curves will be
returned. Otherwise the total number of curves will be provided. The return
value is the total number of curves available (whether that number has been
populated in B<r> or not). Passing a NULL B<r>, or setting B<nitems> to 0 will
do nothing other than return the total number of curves available.
The EC_builtin_curve structure is defined as follows:
typedef struct {
@@ -117,28 +137,37 @@ The EC_builtin_curve structure is defined as follows:
const char *comment;
} EC_builtin_curve;
Each EC_builtin_curve item has a unique integer id (B<nid>), and a human readable comment string describing the curve.
Each EC_builtin_curve item has a unique integer id (B<nid>), and a human
readable comment string describing the curve.
In order to construct a built-in curve use the function EC_GROUP_new_by_curve_name_ex and provide the B<nid> of the curve to
be constructed and the associated library context to be used in B<ctx> (see L<OPENSSL_CTX(3)>).
The B<ctx> value may be NULL in which case the default library context is used.
In order to construct a built-in curve use the function
EC_GROUP_new_by_curve_name_ex() and provide the B<nid> of the curve to be
constructed and the associated library context to be used in B<ctx> (see
L<OPENSSL_CTX(3)>). The B<ctx> value may be NULL in which case the default
library context is used.
EC_GROUP_new_by_curve_name is the same as EC_GROUP_new_by_curve_name_ex except
that the default library context is always used.
EC_GROUP_new_by_curve_name() is the same as EC_GROUP_new_by_curve_name_ex()
except that the default library context is always used.
EC_GROUP_free frees the memory associated with the EC_GROUP.
EC_GROUP_free() frees the memory associated with the EC_GROUP.
If B<group> is NULL nothing is done.
EC_GROUP_clear_free destroys any sensitive data held within the EC_GROUP and then frees its memory.
EC_GROUP_clear_free() is deprecated: it was meant to destroy any sensitive data
held within the EC_GROUP and then free its memory, but since all the data stored
in the EC_GROUP is public anyway, this function is unnecessary.
Its use can be safely replaced with EC_GROUP_free().
If B<group> is NULL nothing is done.
=head1 RETURN VALUES
All EC_GROUP_new* functions return a pointer to the newly constructed group, or NULL on error.
All EC_GROUP_new* functions return a pointer to the newly constructed group, or
NULL on error.
EC_get_builtin_curves returns the number of built-in curves that are available.
EC_get_builtin_curves() returns the number of built-in curves that are
available.
EC_GROUP_set_curve_GFp, EC_GROUP_get_curve_GFp, EC_GROUP_set_curve_GF2m, EC_GROUP_get_curve_GF2m return 1 on success or 0 on error.
EC_GROUP_set_curve_GFp(), EC_GROUP_get_curve_GFp(), EC_GROUP_set_curve_GF2m(),
EC_GROUP_get_curve_GF2m() return 1 on success or 0 on error.
=head1 SEE ALSO
@@ -149,7 +178,18 @@ L<OPENSSL_CTX(3)>
=head1 HISTORY
EC_GROUP_new_ex and EC_GROUP_new_by_curve_name_ex were added in OpenSSL 3.0.
=over 2
=item *
EC_GROUP_new_ex() and EC_GROUP_new_by_curve_name_ex() were added in OpenSSL 3.0.
=item *
EC_GROUP_clear_free() was deprecated in OpenSSL 3.0; use EC_GROUP_free()
instead.
=back
=head1 COPYRIGHT
+20
View File
@@ -171,6 +171,26 @@ The functions EC_POINT_point2oct(), EC_POINT_oct2point(), EC_POINT_point2bn(),
EC_POINT_bn2point(), EC_POINT_point2hex() and EC_POINT_hex2point() convert from
and to EC_POINTs for the formats: octet, BIGNUM and hexadecimal respectively.
The function EC_POINT_point2oct() encodes the given curve point B<p> as an
octet string into the buffer B<buf> of size B<len>, using the specified
conversion form B<form>.
The encoding conforms with Sec. 2.3.3 of the SECG SEC 1 ("Elliptic Curve
Cryptography") standard.
Similarly the function EC_POINT_oct2point() decodes a curve point into B<p> from
the octet string contained in the given buffer B<buf> of size B<len>, conforming
to Sec. 2.3.4 of the SECG SEC 1 ("Elliptic Curve Cryptography") standard.
The functions EC_POINT_point2hex() and EC_POINT_point2bn() convert a point B<p>,
respectively, to the hexadecimal or BIGNUM representation of the same
encoding of the function EC_POINT_point2oct().
Vice versa, similarly to the function EC_POINT_oct2point(), the functions
EC_POINT_hex2point() and EC_POINT_point2bn() decode the hexadecimal or
BIGNUM representation into the EC_POINT B<p>.
Notice that, according to the standard, the octet string encoding of the point
at infinity for a given curve is fixed to a single octet of value zero and that,
vice versa, a single octet of size zero is decoded as the point at infinity.
The function EC_POINT_point2oct() must be supplied with a buffer long enough to
store the octet form. The return value provides the number of octets stored.
Calling the function with a NULL buffer will not perform the conversion but
+1 -1
View File
@@ -27,7 +27,7 @@ ERR_set_debug() sets the debug information related to the current
error in the thread's error queue.
The values that can be given are the filename I<file>, line in the
file I<line> and the name of the function I<func> where the error
occured.
occurred.
The names must be constant, this function will only save away the
pointers, not copy the strings.
+2 -2
View File
@@ -23,9 +23,9 @@ Deprecated since OpenSSL 3.0:
=head1 DESCRIPTION
ERR_raise() adds a new error to the thread's error queue. The
error occured in the library B<lib> for the reason given by the
error occurred in the library B<lib> for the reason given by the
B<reason> code. Furthermore, the name of the file, the line, and name
of the function where the error occured is saved with the error
of the function where the error occurred is saved with the error
record.
ERR_raise_data() does the same thing as ERR_raise(), but also lets the
+88
View File
@@ -0,0 +1,88 @@
=pod
=head1 NAME
EVP_ASYM_CIPHER_fetch, EVP_ASYM_CIPHER_free, EVP_ASYM_CIPHER_up_ref,
EVP_ASYM_CIPHER_number, EVP_ASYM_CIPHER_is_a, EVP_ASYM_CIPHER_provider,
EVP_ASYM_CIPHER_do_all_provided, EVP_ASYM_CIPHER_names_do_all
- Functions to manage EVP_ASYM_CIPHER algorithm objects
=head1 SYNOPSIS
#include <openssl/evp.h>
EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
const char *properties);
void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_number(const EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name);
OSSL_PROVIDER *EVP_ASYM_CIPHER_provider(const EVP_ASYM_CIPHER *cipher);
void EVP_ASYM_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
void (*fn)(EVP_ASYM_CIPHER *cipher,
void *arg),
void *arg);
void EVP_ASYM_CIPHER_names_do_all(const EVP_ASYM_CIPHER *cipher,
void (*fn)(const char *name, void *data),
void *data);
=head1 DESCRIPTION
EVP_ASYM_CIPHER_fetch() fetches the implementation for the given
B<algorithm> from any provider offering it, within the criteria given
by the B<properties> and in the scope of the given library context B<ctx> (see
L<OPENSSL_CTX(3)>). The algorithm will be one offering functions for performing
asymmetric cipher related tasks such as asymmetric encryption and decryption.
See L<provider(7)/Fetching algorithms> for further information.
The returned value must eventually be freed with EVP_ASYM_CIPHER_free().
EVP_ASYM_CIPHER_free() decrements the reference count for the B<EVP_ASYM_CIPHER>
structure. Typically this structure will have been obtained from an earlier call
to EVP_ASYM_CIPHER_fetch(). If the reference count drops to 0 then the
structure is freed.
EVP_ASYM_CIPHER_up_ref() increments the reference count for an
B<EVP_ASYM_CIPHER> structure.
EVP_ASYM_CIPHER_is_a() returns 1 if I<cipher> is an implementation of an
algorithm that's identifiable with I<name>, otherwise 0.
EVP_ASYM_CIPHER_provider() returns the provider that I<cipher> was fetched from.
EVP_ASYM_CIPHER_do_all_provided() traverses all EVP_ASYM_CIPHERs implemented by
all activated providers in the given library context I<libctx>, and for each of
the implementations, calls the given function I<fn> with the implementation
method and the given I<arg> as argument.
EVP_ASYM_CIPHER_number() returns the internal dynamic number assigned to
I<cipher>.
EVP_ASYM_CIPHER_names_do_all() traverses all names for I<cipher>, and calls
I<fn> with each name and I<data>.
=head1 RETURN VALUES
EVP_ASYM_CIPHER_fetch() returns a pointer to an B<EVP_ASYM_CIPHER> for success
or B<NULL> for failure.
EVP_ASYM_CIPHER_up_ref() returns 1 for success or 0 otherwise.
=head1 SEE ALSO
L<provider(7)/Fetching algorithms>, L<OSSL_PROVIDER(3)>
=head1 HISTORY
The functions described here were added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+1 -1
View File
@@ -234,7 +234,7 @@ respective B<cipher> function.
=head1 SEE ALSO
L<EVP_EncryptInit>
L<EVP_EncryptInit(3)>
=head1 HISTORY
+6 -1
View File
@@ -248,6 +248,11 @@ be initialized.
Returns 1 if I<md> is an implementation of an algorithm that's
identifiable with I<name>, otherwise 0.
If I<md> is a legacy digest (it's the return value from the likes of
EVP_sha256() rather than the result of an EVP_MD_fetch()), only cipher
names registered with the default library context (see
L<OPENSSL_CTX(3)>) will be considered.
=item EVP_MD_number()
Returns the internal dynamic number assigned to the I<md>. This is
@@ -591,7 +596,7 @@ digest name passed on the command line.
=head1 SEE ALSO
L<EVP_MD_meth_new(3)>,
L<dgst(1)>,
L<openssl-dgst(1)>,
L<evp(7)>,
L<OSSL_PROVIDER(3)>,
L<OSSL_PARAM(3)>
+38 -43
View File
@@ -11,7 +11,7 @@ EVP_DigestSignFinal, EVP_DigestSign - EVP signing functions
int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const char *mdname, const char *props,
EVP_PKEY *pkey, EVP_SIGNATURE *signature);
EVP_PKEY *pkey);
int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt);
@@ -26,41 +26,38 @@ EVP_DigestSignFinal, EVP_DigestSign - EVP signing functions
The EVP signature routines are a high level interface to digital signatures.
Input data is digested first before the signing takes place.
EVP_DigestSignInit_ex() sets up signing context B<ctx> to use a digest with the
name B<mdname> and private key B<pkey>. The signature algorithm B<signature>
will be used for the actual signing which must be compatible with the private
key. The name of the digest to be used is passed to the provider of the
signature algorithm in use. How that provider interprets the digest name is
provider specific. The provider may implement that digest directly itself or it
may (optionally) choose to fetch it (which could result in a digest from a
different provider being selected). If the provider supports fetching the digest
then it may use the B<props> argument for the properties to be used during the
fetch.
EVP_DigestSignInit_ex() sets up signing context I<ctx> to use a digest with the
name I<mdname> and private key I<pkey>. The name of the digest to be used is
passed to the provider of the signature algorithm in use. How that provider
interprets the digest name is provider specific. The provider may implement
that digest directly itself or it may (optionally) choose to fetch it (which
could result in a digest from a different provider being selected). If the
provider supports fetching the digest then it may use the I<props> argument for
the properties to be used during the fetch.
The B<signature> parameter may be NULL in which case a suitable signature
algorithm implementation will be implicitly fetched based on the type of key in
use. See L<provider(7)> for further information about providers and fetching
algorithms.
The I<pkey> algorithm is used to fetch a B<EVP_SIGNATURE> method implicitly, to
be used for the actual signing. See L<provider(7)/Implicit fetch> for
more information about implict fetches.
The OpenSSL default and legacy providers support fetching digests and can fetch
those digests from any available provider. The OpenSSL fips provider also
supports fetching digests but will only fetch digests that are themselves
implemented inside the fips provider.
B<ctx> must be created with EVP_MD_CTX_new() before calling this function. If
B<pctx> is not NULL, the EVP_PKEY_CTX of the signing operation will be written
to B<*pctx>: this can be used to set alternative signing options. Note that any
existing value in B<*pctx> is overwritten. The EVP_PKEY_CTX value returned must
not be freed directly by the application if B<ctx> is not assigned an
I<ctx> must be created with EVP_MD_CTX_new() before calling this function. If
I<pctx> is not NULL, the EVP_PKEY_CTX of the signing operation will be written
to I<*pctx>: this can be used to set alternative signing options. Note that any
existing value in I<*pctx> is overwritten. The EVP_PKEY_CTX value returned must
not be freed directly by the application if I<ctx> is not assigned an
EVP_PKEY_CTX value before being passed to EVP_DigestSignInit_ex() (which means
the EVP_PKEY_CTX is created inside EVP_DigestSignInit_ex() and it will be freed
automatically when the EVP_MD_CTX is freed).
The digest B<mdname> may be NULL if the signing algorithm supports it. The
B<props> argument can always be NULL.
The digest I<mdname> may be NULL if the signing algorithm supports it. The
I<props> argument can always be NULL.
No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit_ex() if the passed
B<ctx> has already been assigned one via L<EVP_MD_CTX_set_ctx(3)>. See also
I<ctx> has already been assigned one via L<EVP_MD_CTX_set_pkey_ctx(3)>. See also
L<SM2(7)>.
Only EVP_PKEY types that support signing can be used with these functions. This
@@ -82,7 +79,7 @@ Supports SHA1, SHA224, SHA256, SHA384, SHA512 and SM3
=item RSA with no padding
Supports no digests (the digest B<type> must be NULL)
Supports no digests (the digest I<type> must be NULL)
=item RSA with X931 padding
@@ -95,7 +92,7 @@ SHA3-224, SHA3-256, SHA3-384, SHA3-512
=item Ed25519 and Ed448
Support no digests (the digest B<type> must be NULL)
Support no digests (the digest I<type> must be NULL)
=item HMAC
@@ -110,31 +107,29 @@ Will ignore any digest provided.
If RSA-PSS is used and restrictions apply then the digest must match.
EVP_DigestSignInit() works in the same way as EVP_DigestSignInit_ex() except
that the B<mdname> parameter will be inferred from the supplied digest B<type>,
and B<props> will be NULL. Where supplied the ENGINE B<e> will be used for the
signing and digest algorithm implementations. B<e> may be NULL.
that the I<mdname> parameter will be inferred from the supplied digest I<type>,
and I<props> will be NULL. Where supplied the ENGINE I<e> will be used for the
signing and digest algorithm implementations. I<e> may be NULL.
EVP_DigestSignUpdate() hashes B<cnt> bytes of data at B<d> into the
signature context B<ctx>. This function can be called several times on the
same B<ctx> to include additional data.
EVP_DigestSignUpdate() hashes I<cnt> bytes of data at I<d> into the
signature context I<ctx>. This function can be called several times on the
same I<ctx> to include additional data.
EVP_DigestSignFinal() signs the data in B<ctx> and places the signature in B<sig>.
If B<sig> is B<NULL> then the maximum size of the output buffer is written to
the B<siglen> parameter. If B<sig> is not B<NULL> then before the call the
B<siglen> parameter should contain the length of the B<sig> buffer. If the
call is successful the signature is written to B<sig> and the amount of data
written to B<siglen>.
EVP_DigestSignFinal() signs the data in I<ctx> and places the signature in I<sig>.
If I<sig> is NULL then the maximum size of the output buffer is written to
the I<siglen> parameter. If I<sig> is not NULL then before the call the
I<siglen> parameter should contain the length of the I<sig> buffer. If the
call is successful the signature is written to I<sig> and the amount of data
written to I<siglen>.
EVP_DigestSign() signs B<tbslen> bytes of data at B<tbs> and places the
signature in B<sig> and its length in B<siglen> in a similar way to
EVP_DigestSign() signs I<tbslen> bytes of data at I<tbs> and places the
signature in I<sig> and its length in I<siglen> in a similar way to
EVP_DigestSignFinal().
=head1 RETURN VALUES
EVP_DigestSignInit(), EVP_DigestSignUpdate(), EVP_DigestSignaFinal() and
EVP_DigestSign() return 1 for success and 0 or a negative value for failure. In
particular, a return value of -2 indicates the operation is not supported by the
public key algorithm.
EVP_DigestSign() return 1 for success and 0 for failure.
The error codes can be obtained from L<ERR_get_error(3)>.
@@ -177,7 +172,7 @@ L<EVP_DigestVerifyInit(3)>,
L<EVP_DigestInit(3)>,
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
L<SHA1(3)>, L<dgst(1)>,
L<SHA1(3)>, L<openssl-dgst(1)>,
L<RAND(7)>
=head1 HISTORY
+2 -2
View File
@@ -56,7 +56,7 @@ means the EVP_PKEY_CTX is created inside EVP_DigestVerifyInit_ex() and it will
be freed automatically when the EVP_MD_CTX is freed).
No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit_ex() if the passed
B<ctx> has already been assigned one via L<EVP_MD_CTX_set_ctx(3)>. See also
B<ctx> has already been assigned one via L<EVP_MD_CTX_set_pkey_ctx(3)>. See also
L<SM2(7)>.
Not all digests can be used for all key types. The following combinations apply.
@@ -163,7 +163,7 @@ L<EVP_DigestSignInit(3)>,
L<EVP_DigestInit(3)>,
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
L<SHA1(3)>, L<dgst(1)>,
L<SHA1(3)>, L<openssl-dgst(1)>,
L<RAND(7)>
=head1 HISTORY
+27 -14
View File
@@ -299,7 +299,7 @@ B<params> from CIPHER context B<ctx>.
EVP_CIPHER_gettable_params(), EVP_CIPHER_gettable_ctx_params(), and
EVP_CIPHER_settable_ctx_params() get a constant B<OSSL_PARAM> array
that decribes the retrievable and settable parameters, i.e. parameters
that describes the retrievable and settable parameters, i.e. parameters
that can be used with EVP_CIPHER_get_params(), EVP_CIPHER_CTX_get_params()
and EVP_CIPHER_CTX_set_params(), respectively.
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
@@ -338,6 +338,10 @@ B<NID_undef>.
EVP_CIPHER_is_a() returns 1 if I<cipher> is an implementation of an
algorithm that's identifiable with I<name>, otherwise 0.
If I<cipher> is a legacy cipher (it's the return value from the likes
of EVP_aes128() rather than the result of an EVP_CIPHER_fetch()), only
cipher names registered with the default library context (see
L<OPENSSL_CTX(3)>) will be considered.
EVP_CIPHER_number() returns the internal dynamic number assigned to
the I<cipher>. This is only useful with fetched B<EVP_CIPHER>s.
@@ -456,7 +460,7 @@ EVP_CIPHER_CTX_rand_key() returns 1 for success.
All algorithms have a fixed key length unless otherwise stated.
Refer to L<SEE ALSO> for the full list of ciphers available through the EVP
Refer to L</SEE ALSO> for the full list of ciphers available through the EVP
interface.
=over 4
@@ -667,6 +671,15 @@ EVP_EncryptFinal_ex(), EVP_DecryptInit_ex(), EVP_DecryptFinal_ex(),
EVP_CipherInit_ex() and EVP_CipherFinal_ex() because they can reuse an
existing context without allocating and freeing it up on each call.
There are some differences between functions EVP_CipherInit() and
EVP_CipherInit_ex(), significant in some circumstances. EVP_CipherInit() fills
the passed context object with zeros. As a consequence, EVP_CipherInit() does
not allow step-by-step initialization of the ctx when the I<key> and I<iv> are
passed in separate calls. It also means that the flags set for the CTX are
removed, and it is especially important for the
B<EVP_CIPHER_CTX_FLAG_WRAP_ALLOW> flag treated specially in
EVP_CipherInit_ex().
EVP_get_cipherbynid(), and EVP_get_cipherbyobj() are implemented as macros.
=head1 BUGS
@@ -794,20 +807,20 @@ L<evp(7)>
Supported ciphers are listed in:
L<EVP_aes(3)>,
L<EVP_aria(3)>,
L<EVP_bf(3)>,
L<EVP_camellia(3)>,
L<EVP_cast5(3)>,
L<EVP_aes_128_gcm(3)>,
L<EVP_aria_128_gcm(3)>,
L<EVP_bf_cbc(3)>,
L<EVP_camellia_128_ecb(3)>,
L<EVP_cast5_cbc(3)>,
L<EVP_chacha20(3)>,
L<EVP_des(3)>,
L<EVP_desx(3)>,
L<EVP_idea(3)>,
L<EVP_rc2(3)>,
L<EVP_des_cbc(3)>,
L<EVP_desx_cbc(3)>,
L<EVP_idea_cbc(3)>,
L<EVP_rc2_cbc(3)>,
L<EVP_rc4(3)>,
L<EVP_rc5(3)>,
L<EVP_seed(3)>,
L<EVP_sm4(3)>
L<EVP_rc5_32_12_16_cbc(3)>,
L<EVP_seed_cbc(3)>,
L<EVP_sm4_cbc(3)>
=head1 HISTORY
+5 -3
View File
@@ -122,7 +122,7 @@ defined by the implementation.
EVP_KDF_gettable_params(), EVP_KDF_gettable_ctx_params() and
EVP_KDF_settable_ctx_params() get a constant B<OSSL_PARAM> array that
decribes the retrievable and settable parameters, i.e. parameters that
describes the retrievable and settable parameters, i.e. parameters that
can be used with EVP_KDF_get_params(), EVP_KDF_CTX_get_params()
and EVP_KDF_CTX_set_params(), respectively.
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
@@ -183,8 +183,10 @@ The default value, if any, is implementation dependent.
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
For KDF implementations that use an underlying computation MAC or
digest, these parameters set what the algorithm should be.
=item "cipher" (B<OSSL_KDF_PARAM_CIPHER>) <UTF8 string>
For KDF implementations that use an underlying computation MAC, digest or
cipher, these parameters set what the algorithm should be.
The value is always the name of the intended algorithm,
or the properties.
+8 -8
View File
@@ -151,7 +151,7 @@ defined by the implementation.
EVP_MAC_gettable_params(), EVP_MAC_gettable_ctx_params() and
EVP_MAC_settable_ctx_params() get a constant B<OSSL_PARAM> array that
decribes the retrievable and settable parameters, i.e. parameters that
describes the retrievable and settable parameters, i.e. parameters that
can be used with EVP_MAC_get_params(), EVP_MAC_CTX_get_params()
and EVP_MAC_CTX_set_params(), respectively.
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
@@ -370,13 +370,13 @@ F<./foo>)
L<property(7)>
L<OSSL_PARAM(3)>,
L<EVP_MAC_BLAKE2(7)>,
L<EVP_MAC_CMAC(7)>,
L<EVP_MAC_GMAC(7)>,
L<EVP_MAC_HMAC(7)>,
L<EVP_MAC_KMAC(7)>,
L<EVP_MAC_SIPHASH(7)>,
L<EVP_MAC_POLY1305(7)>
L<EVP_MAC-BLAKE2(7)>,
L<EVP_MAC-CMAC(7)>,
L<EVP_MAC-GMAC(7)>,
L<EVP_MAC-HMAC(7)>,
L<EVP_MAC-KMAC(7)>,
L<EVP_MAC-Siphash(7)>,
L<EVP_MAC-Poly1305(7)>
=head1 HISTORY
+96 -27
View File
@@ -20,10 +20,14 @@ EVP_PKEY_CTX_get_rsa_pss_saltlen,
EVP_PKEY_CTX_set_rsa_keygen_bits,
EVP_PKEY_CTX_set_rsa_keygen_pubexp,
EVP_PKEY_CTX_set_rsa_keygen_primes,
EVP_PKEY_CTX_set_rsa_mgf1_md_name,
EVP_PKEY_CTX_set_rsa_mgf1_md,
EVP_PKEY_CTX_get_rsa_mgf1_md,
EVP_PKEY_CTX_get_rsa_mgf1_md_name,
EVP_PKEY_CTX_set_rsa_oaep_md_name,
EVP_PKEY_CTX_set_rsa_oaep_md,
EVP_PKEY_CTX_get_rsa_oaep_md,
EVP_PKEY_CTX_get_rsa_oaep_md_name,
EVP_PKEY_CTX_set0_rsa_oaep_label,
EVP_PKEY_CTX_get0_rsa_oaep_label,
EVP_PKEY_CTX_set_dsa_paramgen_bits,
@@ -95,10 +99,18 @@ EVP_PKEY_CTX_set1_id, EVP_PKEY_CTX_get1_id, EVP_PKEY_CTX_get1_id_len
int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int mbits);
int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
int EVP_PKEY_CTX_set_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
const char *mdprops);
int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
int EVP_PKEY_CTX_get_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, char *name,
size_t namelen);
int EVP_PKEY_CTX_set_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
const char *mdprops);
int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
int EVP_PKEY_CTX_get_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, char *name,
size_t namelen)
int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char *label, int len);
int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
@@ -186,7 +198,7 @@ The internal algorithm that supports this parameter is DSA.
=back
EVP_PKEY_CTX_gettable_params() and EVP_PKEY_CTX_settable_params() gets a
constant B<OSSL_PARAM> array that decribes the gettable and
constant B<OSSL_PARAM> array that describes the gettable and
settable parameters for the current algorithm implementation, i.e. parameters
that can be used with EVP_PKEY_CTX_get_params() and EVP_PKEY_CTX_set_params()
respectively.
@@ -241,12 +253,14 @@ supported by the L<EVP_PKEY_new_raw_private_key(3)> function.
=head2 RSA parameters
The EVP_PKEY_CTX_set_rsa_padding() macro sets the RSA padding mode for B<ctx>.
The EVP_PKEY_CTX_set_rsa_padding() function sets the RSA padding mode for B<ctx>.
The B<pad> parameter can take the value B<RSA_PKCS1_PADDING> for PKCS#1
padding, B<RSA_SSLV23_PADDING> for SSLv23 padding, B<RSA_NO_PADDING> for
no padding, B<RSA_PKCS1_OAEP_PADDING> for OAEP padding (encrypt and
decrypt only), B<RSA_X931_PADDING> for X9.31 padding (signature operations
only) and B<RSA_PKCS1_PSS_PADDING> (sign and verify only).
only), B<RSA_PKCS1_PSS_PADDING> (sign and verify only) and
B<RSA_PKCS1_WITH_TLS_PADDING> for TLS RSA ClientKeyExchange message padding
(decryption only).
Two RSA padding modes behave differently if EVP_PKEY_CTX_set_signature_md()
is used. If this macro is called for PKCS#1 padding the plaintext buffer is
@@ -258,7 +272,7 @@ padding for RSA the algorithm identifier byte is added or checked and removed
if this control is called. If it is not called then the first byte of the plaintext
buffer is expected to be the algorithm identifier byte.
The EVP_PKEY_CTX_get_rsa_padding() macro gets the RSA padding mode for B<ctx>.
The EVP_PKEY_CTX_get_rsa_padding() function gets the RSA padding mode for B<ctx>.
The EVP_PKEY_CTX_set_rsa_pss_saltlen() macro sets the RSA PSS salt length to
B<len>. As its name implies it is only supported for PSS padding. Three special
@@ -283,34 +297,82 @@ modified or freed after the call. If not specified 65537 is used.
The EVP_PKEY_CTX_set_rsa_keygen_primes() macro sets the number of primes for
RSA key generation to B<primes>. If not specified 2 is used.
The EVP_PKEY_CTX_set_rsa_mgf1_md() macro sets the MGF1 digest for RSA padding
schemes to B<md>. If not explicitly set the signing digest is used. The
padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING>
The EVP_PKEY_CTX_set_rsa_mgf1_md_name() function sets the MGF1 digest for RSA
padding schemes to the digest named B<mdname>. If the RSA algorithm
implementation for the selected provider supports it then the digest will be
fetched using the properties B<mdprops>. If not explicitly set the signing
digest is used. The padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING>
or B<RSA_PKCS1_PSS_PADDING>.
The EVP_PKEY_CTX_get_rsa_mgf1_md() macro gets the MGF1 digest for B<ctx>.
If not explicitly set the signing digest is used. The padding mode must have
been set to B<RSA_PKCS1_OAEP_PADDING> or B<RSA_PKCS1_PSS_PADDING>.
The EVP_PKEY_CTX_set_rsa_mgf1_md() function does the same as
EVP_PKEY_CTX_set_rsa_mgf1_md_name() except that the name of the digest is
inferred from the supplied B<md> and it is not possible to specify any
properties.
The EVP_PKEY_CTX_set_rsa_oaep_md() macro sets the message digest type used
in RSA OAEP to B<md>. The padding mode must have been set to
The EVP_PKEY_CTX_get_rsa_mgf1_md_name() function gets the name of the MGF1
digest algorithm for B<ctx>. If not explicitly set the signing digest is used.
The padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING> or
B<RSA_PKCS1_PSS_PADDING>.
The EVP_PKEY_CTX_get_rsa_mgf1_md() function does the same as
EVP_PKEY_CTX_get_rsa_mgf1_md_name() except that it returns a pointer to an
EVP_MD object instead. Note that only known, built-in EVP_MD objects will be
returned. The EVP_MD object may be NULL if the digest is not one of these (such
as a digest only implemented in a third party provider).
The EVP_PKEY_CTX_set_rsa_oaep_md_name() function sets the message digest type
used in RSA OAEP to the digest named B<mdname>. If the RSA algorithm
implementation for the selected provider supports it then the digest will be
fetched using the properties B<mdprops>. The padding mode must have been set to
B<RSA_PKCS1_OAEP_PADDING>.
The EVP_PKEY_CTX_get_rsa_oaep_md() macro gets the message digest type used
in RSA OAEP to B<md>. The padding mode must have been set to
B<RSA_PKCS1_OAEP_PADDING>.
The EVP_PKEY_CTX_set_rsa_oaep_md() function does the same as
EVP_PKEY_CTX_set_rsa_oaep_md_name() except that the name of the digest is
inferred from the supplied B<md> and it is not possible to specify any
properties.
The EVP_PKEY_CTX_set0_rsa_oaep_label() macro sets the RSA OAEP label to
The EVP_PKEY_CTX_get_rsa_oaep_md_name() function gets the message digest
algorithm name used in RSA OAEP and stores it in the buffer B<name> which is of
size B<namelen>. The padding mode must have been set to
B<RSA_PKCS1_OAEP_PADDING>. The buffer should be sufficiently large for any
expected digest algorithm names or the function will fail.
The EVP_PKEY_CTX_get_rsa_oaep_md() function does the same as
EVP_PKEY_CTX_get_rsa_oaep_md_name() except that it returns a pointer to an
EVP_MD object instead. Note that only known, built-in EVP_MD objects will be
returned. The EVP_MD object may be NULL if the digest is not one of these (such
as a digest only implemented in a third party provider).
The EVP_PKEY_CTX_set0_rsa_oaep_label() function sets the RSA OAEP label to
B<label> and its length to B<len>. If B<label> is NULL or B<len> is 0,
the label is cleared. The library takes ownership of the label so the
caller should not free the original memory pointed to by B<label>.
The padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING>.
The EVP_PKEY_CTX_get0_rsa_oaep_label() macro gets the RSA OAEP label to
The EVP_PKEY_CTX_get0_rsa_oaep_label() function gets the RSA OAEP label to
B<label>. The return value is the label length. The padding mode
must have been set to B<RSA_PKCS1_OAEP_PADDING>. The resulting pointer is owned
by the library and should not be freed by the caller.
B<RSA_PKCS1_WITH_TLS_PADDING> is used when decrypting an RSA encrypted TLS
pre-master secret in a TLS ClientKeyExchange message. It is the same as
RSA_PKCS1_PADDING except that it additionally verifies that the result is the
correct length and the first two bytes are the protocol version initially
requested by the client. If the encrypted content is publicly invalid then the
decryption will fail. However, if the padding checks fail then decryption will
still appear to succeed but a random TLS premaster secret will be returned
instead. This padding mode accepts two parameters which can be set using the
L<EVP_PKEY_CTX_set_params(3)> function. These are
OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION and
OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, both of which are expected to be
unsigned integers. Normally only the first of these will be set and represents
the TLS protocol version that was first requested by the client (e.g. 0x0303 for
TLSv1.2, 0x0302 for TLSv1.1 etc). Historically some buggy clients would use the
negotiated protocol version instead of the protocol version first requested. If
this behaviour should be tolerated then
OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION should be set to the actual
negotiated protocol version. Otherwise it should be left unset.
=head2 DSA parameters
The EVP_PKEY_CTX_set_dsa_paramgen_bits() macro sets the number of bits used
@@ -497,10 +559,9 @@ EVP_PKEY_CTX_settable_params() returns an OSSL_PARAM array on success or NULL on
error.
It may also return NULL if there are no settable parameters available.
EVP_PKEY_CTX_set_signature_md(), EVP_PKEY_CTX_set_dh_pad(), EVP_PKEY_CTX_ctrl()
and its macros return a positive value for success and 0 or a negative value for
failure. In particular a return value of -2 indicates the operation is not
supported by the public key algorithm.
All other functions and macros described on this page return a positive value
for success and 0 or a negative value for failure. In particular a return value
of -2 indicates the operation is not supported by the public key algorithm.
=head1 SEE ALSO
@@ -515,13 +576,21 @@ L<EVP_PKEY_keygen(3)>
=head1 HISTORY
The
EVP_PKEY_CTX_set1_id(), EVP_PKEY_CTX_get1_id() and EVP_PKEY_CTX_get1_id_len()
macros were added in 1.1.1, other functions were added in OpenSSL 1.0.0.
EVP_PKEY_CTX_get_signature_md(), EVP_PKEY_CTX_set_signature_md(),
EVP_PKEY_CTX_set_dh_pad(), EVP_PKEY_CTX_set_rsa_padding(),
EVP_PKEY_CTX_get_rsa_padding(), EVP_PKEY_CTX_get_rsa_mgf1_md(),
EVP_PKEY_CTX_set_rsa_mgf1_md(), EVP_PKEY_CTX_set_rsa_oaep_md(),
EVP_PKEY_CTX_get_rsa_oaep_md(), EVP_PKEY_CTX_set0_rsa_oaep_label(),
EVP_PKEY_CTX_get0_rsa_oaep_label() were macros in OpenSSL 1.1.1 and below. From
OpenSSL 3.0 they are functions.
EVP_PKEY_CTX_get_signature_md(), EVP_PKEY_CTX_set_signature_md() and
EVP_PKEY_CTX_set_dh_pad() were macros in OpenSSL 1.1.1 and below. From OpenSSL
3.0 they are functions.
EVP_PKEY_CTX_get_rsa_oaep_md_name(), EVP_PKEY_CTX_get_rsa_mgf1_md_name(),
EVP_PKEY_CTX_set_rsa_mgf1_md_name() and EVP_PKEY_CTX_set_rsa_oaep_md_name() were
added in OpenSSL 3.0.
The EVP_PKEY_CTX_set1_id(), EVP_PKEY_CTX_get1_id() and
EVP_PKEY_CTX_get1_id_len() macros were added in 1.1.1, other functions were
added in OpenSSL 1.0.0.
=head1 COPYRIGHT
+40 -13
View File
@@ -2,8 +2,8 @@
=head1 NAME
EVP_PKEY_CTX_new, EVP_PKEY_CTX_new_id, EVP_PKEY_CTX_new_provided,
EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
EVP_PKEY_CTX_new, EVP_PKEY_CTX_new_id, EVP_PKEY_CTX_new_from_name,
EVP_PKEY_CTX_new_from_pkey, EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
- public key algorithm context functions
=head1 SYNOPSIS
@@ -12,26 +12,35 @@ EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
EVP_PKEY_CTX *EVP_PKEY_CTX_new_provided(const char *name,
const char *propquery);
EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OPENSSL_CTX *libctx,
const char *name,
const char *propquery);
EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OPENSSL_CTX *libctx,
EVP_PKEY *pkey);
EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *ctx);
void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
=head1 DESCRIPTION
The EVP_PKEY_CTX_new() function allocates public key algorithm context using
the algorithm specified in I<pkey> and ENGINE I<e>.
the I<pkey> key type and ENGINE I<e>.
The EVP_PKEY_CTX_new_id() function allocates public key algorithm context
using the algorithm specified by I<id> and ENGINE I<e>.
using the key type specified by I<id> and ENGINE I<e>.
The EVP_PKEY_CTX_new_provided() function allocates a public key
algorithm context using the algorithm specified by I<name> and the
property query I<propquery>. The strings aren't duplicated, so they
must remain unchanged for the lifetime of the returned B<EVP_PKEY_CTX>
or of any of its duplicates.
The EVP_PKEY_CTX_new_from_name() function allocates a public key algorithm
context using the library context I<libctx> (see L<OPENSSL_CTX(3)>), the
key type specified by I<name> and the property query I<propquery>. None
of the arguments are duplicated, so they must remain unchanged for the
lifetime of the returned B<EVP_PKEY_CTX> or of any of its duplicates.
EVP_PKEY_CTX_new_id() and EVP_PKEY_CTX_new_provided() are normally
The EVP_PKEY_CTX_new_from_pkey() function allocates a public key algorithm
context using the library context I<libctx> (see L<OPENSSL_CTX(3)>) and the
algorithm specified by I<pkey> . None of the arguments are duplicated, so they
must remain unchanged for the lifetime of the returned B<EVP_PKEY_CTX> or of
any of its duplicates.
EVP_PKEY_CTX_new_id() and EVP_PKEY_CTX_new_from_name() are normally
used when no B<EVP_PKEY> structure is associated with the operations,
for example during parameter generation or key generation for some
algorithms.
@@ -43,11 +52,25 @@ If I<ctx> is NULL, nothing is done.
=head1 NOTES
=over 4
=item 1.
The B<EVP_PKEY_CTX> structure is an opaque public key algorithm context used
by the OpenSSL high level public key API. Contexts B<MUST NOT> be shared between
threads: that is it is not permissible to use the same context simultaneously
in two threads.
=item 2.
We mention "key type" in this manual, which is the same
as "algorithm" in most cases, allowing either term to be used
interchangeably. There are algorithms where the I<key type> and the
I<algorithm> of the operations that use the keys are not the same,
such as EC keys being used for ECDSA and ECDH operations.
=back
=head1 RETURN VALUES
EVP_PKEY_CTX_new(), EVP_PKEY_CTX_new_id(), EVP_PKEY_CTX_dup() returns either
@@ -61,7 +84,11 @@ L<EVP_PKEY_new(3)>
=head1 HISTORY
These functions were added in OpenSSL 1.0.0.
The EVP_PKEY_CTX_new(), EVP_PKEY_CTX_new_id(), EVP_PKEY_CTX_dup() and
EVP_PKEY_CTX_free() functions were added in OpenSSL 1.0.0.
The EVP_PKEY_CTX_new_from_name() and EVP_PKEY_CTX_new_from_pkey() functions were
added in OpenSSL 3.0.
=head1 COPYRIGHT
@@ -35,10 +35,10 @@ to the B<RSA> operation except detection of the salt length (using
RSA_PSS_SALTLEN_AUTO) is not supported for verification if the key has
usage restrictions.
The EVP_PKEY_CTX_set_signature_md() and EVP_PKEY_CTX_set_rsa_mgf1_md() macros
are used to set the digest and MGF1 algorithms respectively. If the key has
usage restrictions then an error is returned if an attempt is made to set the
digest to anything other than the restricted value. Otherwise these are
The L<EVP_PKEY_CTX_set_signature_md(3)> and L<EVP_PKEY_CTX_set_rsa_mgf1_md(3)>
fuunctions are used to set the digest and MGF1 algorithms respectively. If the
key has usage restrictions then an error is returned if an attempt is made to
set the digest to anything other than the restricted value. Otherwise these are
similar to the B<RSA> versions.
=head2 Key Generation
+14 -23
View File
@@ -2,43 +2,34 @@
=head1 NAME
EVP_PKEY_derive_init, EVP_PKEY_derive_init_ex, EVP_PKEY_derive_set_peer,
EVP_PKEY_derive - derive public key algorithm shared secret
EVP_PKEY_derive_init, EVP_PKEY_derive_set_peer, EVP_PKEY_derive
- derive public key algorithm shared secret
=head1 SYNOPSIS
#include <openssl/evp.h>
int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, EVP_KEYEXCH *exchange);
int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx);
int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer);
int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
=head1 DESCRIPTION
The EVP_PKEY_derive_init_ex() function initializes a public key algorithm
context for shared secret derivation using the key exchange algorithm
B<exchange>.
The key exchange algorithm B<exchange> should be fetched using a call to
L<EVP_KEYEXCH_fetch(3)>.
The EVP_PKEY object associated with B<ctx> must be compatible with that
algorithm.
B<exchange> may be NULL in which case the EVP_KEYEXCH algorithm is fetched
implicitly based on the type of EVP_PKEY associated with B<ctx>.
See L<provider(7)/Implicit fetch> for more information about implict fetches.
EVP_PKEY_derive_init() initializes a public key algorithm context I<ctx> for
shared secret derivation using the algorithm given when the context was created
using L<EVP_PKEY_CTX_new(3)> or variants thereof. The algorithm is used to
fetch a B<EVP_KEYEXCH> method implicitly, see L<provider(7)/Implicit fetch> for
more information about implict fetches.
The EVP_PKEY_derive_init() function is the same as EVP_PKEY_derive_init_ex()
except that the EVP_KEYEXCH algorithm is always implicitly fetched.
The EVP_PKEY_derive_set_peer() function sets the peer key: this will normally
EVP_PKEY_derive_set_peer() sets the peer key: this will normally
be a public key.
The EVP_PKEY_derive() derives a shared secret using B<ctx>.
If B<key> is B<NULL> then the maximum size of the output buffer is written to
the B<keylen> parameter. If B<key> is not B<NULL> then before the call the
B<keylen> parameter should contain the length of the B<key> buffer, if the call
is successful the shared secret is written to B<key> and the amount of data
written to B<keylen>.
EVP_PKEY_derive() derives a shared secret using I<ctx>.
If I<key> is NULL then the maximum size of the output buffer is written to the
I<keylen> parameter. If I<key> is not NULL then before the call the I<keylen>
parameter should contain the length of the I<key> buffer, if the call is
successful the shared secret is written to I<key> and the amount of data
written to I<keylen>.
=head1 NOTES
+69
View File
@@ -0,0 +1,69 @@
=pod
=head1 NAME
EVP_PKEY_param_fromdata_init, EVP_PKEY_key_fromdata_init, EVP_PKEY_fromdata,
EVP_PKEY_param_fromdata_settable, EVP_PKEY_key_fromdata_settable
- functions to create domain parameters and keys from user data
=head1 SYNOPSIS
#include <openssl/evp.h>
int EVP_PKEY_param_fromdata_init(EVP_PKEY_CTX *ctx);
int EVP_PKEY_key_fromdata_init(EVP_PKEY_CTX *ctx);
int EVP_PKEY_fromdata(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey, OSSL_PARAM params[]);
const OSSL_PARAM *EVP_PKEY_param_fromdata_settable(EVP_PKEY_CTX *ctx);
const OSSL_PARAM *EVP_PKEY_key_fromdata_settable(EVP_PKEY_CTX *ctx);
=head1 DESCRIPTION
EVP_PKEY_param_fromdata_init() initializes a public key algorithm context
for creating domain parameters from user data.
EVP_PKEY_key_fromdata_init() initializes a public key algorithm context for
creating a key from user data.
EVP_PKEY_fromdata() creates domain parameters or a key, given data from
I<params> and a context that's been initialized with
EVP_PKEY_param_fromdata_init() or EVP_PKEY_key_fromdata_init(). The result is
written to I<*ppkey>.
EVP_PKEY_param_fromdata_settable() and EVP_PKEY_key_fromdata_settable()
get a constant B<OSSL_PARAM> array that describes the settable parameters
that can be used with EVP_PKEY_fromdata().
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
=head1 NOTES
These functions only work with key management methods coming from a
provider.
=for comment We may choose to make this available for legacy methods too...
=head1 RETURN VALUES
EVP_PKEY_key_fromdata_init(), EVP_PKEY_param_fromdata_init() and
EVP_PKEY_fromdata() return 1 for success and 0 or a negative value for
failure. In particular a return value of -2 indicates the operation is
not supported by the public key algorithm.
=head1 SEE ALSO
L<EVP_PKEY_CTX_new(3)>, L<provider(7)>
=head1 HISTORY
These functions were added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+30 -2
View File
@@ -8,14 +8,18 @@ EVP_PKEY_meth_set_init, EVP_PKEY_meth_set_copy, EVP_PKEY_meth_set_cleanup,
EVP_PKEY_meth_set_paramgen, EVP_PKEY_meth_set_keygen, EVP_PKEY_meth_set_sign,
EVP_PKEY_meth_set_verify, EVP_PKEY_meth_set_verify_recover, EVP_PKEY_meth_set_signctx,
EVP_PKEY_meth_set_verifyctx, EVP_PKEY_meth_set_encrypt, EVP_PKEY_meth_set_decrypt,
EVP_PKEY_meth_set_derive, EVP_PKEY_meth_set_ctrl, EVP_PKEY_meth_set_check,
EVP_PKEY_meth_set_derive, EVP_PKEY_meth_set_ctrl,
EVP_PKEY_meth_set_digestsign, EVP_PKEY_meth_set_digestverify,
EVP_PKEY_meth_set_check,
EVP_PKEY_meth_set_public_check, EVP_PKEY_meth_set_param_check,
EVP_PKEY_meth_set_digest_custom,
EVP_PKEY_meth_get_init, EVP_PKEY_meth_get_copy, EVP_PKEY_meth_get_cleanup,
EVP_PKEY_meth_get_paramgen, EVP_PKEY_meth_get_keygen, EVP_PKEY_meth_get_sign,
EVP_PKEY_meth_get_verify, EVP_PKEY_meth_get_verify_recover, EVP_PKEY_meth_get_signctx,
EVP_PKEY_meth_get_verifyctx, EVP_PKEY_meth_get_encrypt, EVP_PKEY_meth_get_decrypt,
EVP_PKEY_meth_get_derive, EVP_PKEY_meth_get_ctrl, EVP_PKEY_meth_get_check,
EVP_PKEY_meth_get_derive, EVP_PKEY_meth_get_ctrl,
EVP_PKEY_meth_get_digestsign, EVP_PKEY_meth_get_digestverify,
EVP_PKEY_meth_get_check,
EVP_PKEY_meth_get_public_check, EVP_PKEY_meth_get_param_check,
EVP_PKEY_meth_get_digest_custom,
EVP_PKEY_meth_remove
@@ -112,6 +116,18 @@ EVP_PKEY_meth_remove
int (*ctrl_str) (EVP_PKEY_CTX *ctx,
const char *type,
const char *value));
void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth,
int (*digestsign) (EVP_MD_CTX *ctx,
unsigned char *sig,
size_t *siglen,
const unsigned char *tbs,
size_t tbslen));
void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth,
int (*digestverify) (EVP_MD_CTX *ctx,
const unsigned char *sig,
size_t siglen,
const unsigned char *tbs,
size_t tbslen));
void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth,
int (*check) (EVP_PKEY *pkey));
void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth,
@@ -200,6 +216,18 @@ EVP_PKEY_meth_remove
int (**pctrl_str) (EVP_PKEY_CTX *ctx,
const char *type,
const char *value));
void EVP_PKEY_meth_get_digestsign(EVP_PKEY_METHOD *pmeth,
int (**digestsign) (EVP_MD_CTX *ctx,
unsigned char *sig,
size_t *siglen,
const unsigned char *tbs,
size_t tbslen));
void EVP_PKEY_meth_get_digestverify(EVP_PKEY_METHOD *pmeth,
int (**digestverify) (EVP_MD_CTX *ctx,
const unsigned char *sig,
size_t siglen,
const unsigned char *tbs,
size_t tbslen));
void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth,
int (**pcheck) (EVP_PKEY *pkey));
void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth,
+4 -4
View File
@@ -95,8 +95,8 @@ general private key without reference to any particular algorithm.
The structure returned by EVP_PKEY_new() is empty. To add a private or public
key to this empty structure use the appropriate functions described in
L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_DSA>, L<EVP_PKEY_set1_DH> or
L<EVP_PKEY_set1_EC_KEY>.
L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_DSA(3)>, L<EVP_PKEY_set1_DH(3)> or
L<EVP_PKEY_set1_EC_KEY(3)>.
=head1 RETURN VALUES
@@ -109,8 +109,8 @@ EVP_PKEY_get_raw_public_key() return 1 for success and 0 for failure.
=head1 SEE ALSO
L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_DSA>, L<EVP_PKEY_set1_DH> or
L<EVP_PKEY_set1_EC_KEY>
L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_DSA(3)>, L<EVP_PKEY_set1_DH(3)> or
L<EVP_PKEY_set1_EC_KEY(3)>
=head1 HISTORY
+12 -20
View File
@@ -2,14 +2,13 @@
=head1 NAME
EVP_PKEY_sign_init_ex, EVP_PKEY_sign_init, EVP_PKEY_sign
EVP_PKEY_sign_init, EVP_PKEY_sign
- sign using a public key algorithm
=head1 SYNOPSIS
#include <openssl/evp.h>
int EVP_PKEY_sign_init_ex(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature);
int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
unsigned char *sig, size_t *siglen,
@@ -17,26 +16,19 @@ EVP_PKEY_sign_init_ex, EVP_PKEY_sign_init, EVP_PKEY_sign
=head1 DESCRIPTION
The EVP_PKEY_sign_init_ex() function initializes a public key algorithm
context for performing signing using the signature algorithm B<signature>.
The signature algorithm B<signature> should be fetched using a call to
L<EVP_SIGNATURE_fetch(3)>.
The EVP_PKEY object associated with B<ctx> must be compatible with that
algorithm.
B<signature> may be NULL in which case the EVP_SIGNATURE algorithm is fetched
implicitly based on the type of EVP_PKEY associated with B<ctx>.
See L<provider(7)/Implicit fetch> for more information about implict fetches.
The EVP_PKEY_sign_init() function is the same as EVP_PKEY_sign_init_ex() except
that the EVP_SIGNATURE algorithm is always implicitly fetched.
EVP_PKEY_sign_init() initializes a public key algorithm context I<ctx> for
signing using the algorithm given when the context was created
using L<EVP_PKEY_CTX_new(3)> or variants thereof. The algorithm is used to
fetch a B<EVP_SIGNATURE> method implicitly, see L<provider(7)/Implicit fetch>
for more information about implict fetches.
The EVP_PKEY_sign() function performs a public key signing operation
using B<ctx>. The data to be signed is specified using the B<tbs> and
B<tbslen> parameters. If B<sig> is B<NULL> then the maximum size of the output
buffer is written to the B<siglen> parameter. If B<sig> is not B<NULL> then
before the call the B<siglen> parameter should contain the length of the
B<sig> buffer, if the call is successful the signature is written to
B<sig> and the amount of data written to B<siglen>.
using I<ctx>. The data to be signed is specified using the I<tbs> and
I<tbslen> parameters. If I<sig> is NULL then the maximum size of the output
buffer is written to the I<siglen> parameter. If I<sig> is not NULL then
before the call the I<siglen> parameter should contain the length of the
I<sig> buffer, if the call is successful the signature is written to
I<sig> and the amount of data written to I<siglen>.
=head1 NOTES

Some files were not shown because too many files have changed in this diff Show More