Add X509V3_set_issuer_pkey, needed for AKID of self-issued not self-signed cert
[openssl.git] / doc / man3 / X509V3_set_ctx.pod
1 =pod
2
3 =head1 NAME
4
5 X509V3_set_ctx,
6 X509V3_set_issuer_pkey - X.509v3 extension generation utility functions
7
8 =head1 SYNOPSIS
9
10  #include <openssl/x509v3.h>
11
12  void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
13                      X509_REQ *req, X509_CRL *crl, int flags);
14  int X509V3_set_issuer_pkey(X509V3_CTX *ctx, EVP_PKEY *pkey);
15
16 =head1 DESCRIPTION
17
18 X509V3_set_ctx() fills in the basic fields of I<ctx> of type B<X509V3_CTX>,
19 providing details potentially needed by functions producing X509 v3 certificate
20 extensions, e.g., to look up values for filling in authority key identifiers.
21 Any of I<subj>, I<req>, or I<crl> may be provided, pointing to a certificate,
22 certification request, or certificate revocation list, respectively.
23 If I<subj> or I<crl> is provided, I<issuer> should point to its issuer,
24 for instance to help generating an authority key identifier extension.
25 Note that if I<subj> is provided, I<issuer> may be the same as I<subj>,
26 which means that I<subj> is self-issued (or even self-signed).
27 I<flags> may be 0 or contain B<CTX_TEST>, which means that just the syntax of
28 extension definitions is to be checked without actually producing an extension,
29 or B<X509V3_CTX_REPLACE>, which means that each X.509v3 extension added as
30 defined in some configuration section shall replace any already existing
31 extension with the same OID.
32
33 X509V3_set_issuer_pkey() explicitly sets the issuer private key of
34 the certificate that has been provided in I<ctx>.
35 This should be done for self-issued certificates (which may be self-signed
36 or not) to provide fallback data for the authority key identifier extension.
37
38 =head1 RETURN VALUES
39
40 X509V3_set_ctx() and X509V3_set_issuer_pkey()
41 return 1 on success and 0 on error.
42
43 =head1 SEE ALSO
44
45 L<X509_add_ext(3)>
46
47 =head1 HISTORY
48
49 X509V3_set_issuer_pkey() was added in OpenSSL 3.0.
50
51 =head1 COPYRIGHT
52
53 Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
54
55 Licensed under the Apache License 2.0 (the "License").  You may not use
56 this file except in compliance with the License.  You can obtain a copy
57 in the file LICENSE in the source distribution or at
58 L<https://www.openssl.org/source/license.html>.
59
60 =cut