1X509V3_SET_CTX(3ossl) OpenSSL X509V3_SET_CTX(3ossl)
2
3
4
6 X509V3_set_ctx, X509V3_set_issuer_pkey - X.509 v3 extension generation
7 utilities
8
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
17 X509V3_set_ctx() fills in the basic fields of ctx of type X509V3_CTX,
18 providing details potentially needed by functions producing X509 v3
19 extensions, e.g., to look up values for filling in authority key
20 identifiers. Any of subject, req, or crl may be provided, pointing to
21 a certificate, certification request, or certificate revocation list,
22 respectively. When constructing the subject key identifier of a
23 certificate by computing a hash value of its public key, the public key
24 is taken from subject or req. Similarly, when constructing subject
25 alternative names from any email addresses contained in a subject DN,
26 the subject DN is taken from subject or req. If subject or crl is
27 provided, issuer should point to its issuer, for instance to help
28 generating an authority key identifier extension. Note that if subject
29 is provided, issuer may be the same as subject, which means that
30 subject is self-issued (or even self-signed). flags may be 0 or
31 contain X509V3_CTX_TEST, which means that just the syntax of extension
32 definitions is to be checked without actually producing an extension,
33 or X509V3_CTX_REPLACE, which means that each X.509v3 extension added as
34 defined in some configuration section shall replace any already
35 existing extension with the same OID.
36
37 X509V3_set_issuer_pkey() explicitly sets the issuer private key of the
38 certificate that has been provided in ctx. This should be done for
39 self-issued certificates (which may be self-signed or not) to provide
40 fallback data for the authority key identifier extension.
41
43 X509V3_set_ctx() and X509V3_set_issuer_pkey() return 1 on success and 0
44 on error.
45
47 X509_add_ext(3)
48
50 X509V3_set_issuer_pkey() was added in OpenSSL 3.0.
51
52 CTX_TEST was deprecated in OpenSSL 3.0; use X509V3_CTX_TEST instead.
53
55 Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
56
57 Licensed under the Apache License 2.0 (the "License"). You may not use
58 this file except in compliance with the License. You can obtain a copy
59 in the file LICENSE in the source distribution or at
60 <https://www.openssl.org/source/license.html>.
61
62
63
643.0.5 2022-07-05 X509V3_SET_CTX(3ossl)