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