2
0

X509V3_set_ctx.pod 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. X509V3_set_ctx,
  4. X509V3_set_issuer_pkey - X.509 v3 extension generation utilities
  5. =head1 SYNOPSIS
  6. #include <openssl/x509v3.h>
  7. void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
  8. X509_REQ *req, X509_CRL *crl, int flags);
  9. int X509V3_set_issuer_pkey(X509V3_CTX *ctx, EVP_PKEY *pkey);
  10. =head1 DESCRIPTION
  11. X509V3_set_ctx() fills in the basic fields of I<ctx> of type B<X509V3_CTX>,
  12. providing details potentially needed by functions producing X509 v3 extensions.
  13. These may make use of fields of the certificate I<subject>, the certification
  14. request I<req>, or the certificate revocation list I<crl>.
  15. At most one of these three parameters can be non-NULL.
  16. When constructing the subject key identifier of a certificate by computing a
  17. hash value of its public key, the public key is taken from I<subject> or I<req>.
  18. Similarly, when constructing subject alternative names from any email addresses
  19. contained in a subject DN, the subject DN is taken from I<subject> or I<req>.
  20. If I<subject> or I<crl> is provided, I<issuer> should point to its issuer, for
  21. instance as a reference for generating the authority key identifier extension.
  22. I<issuer> may be the same pointer value as I<subject> (which usually is an
  23. indication that the I<subject> certificate is self-issued or even self-signed).
  24. In this case the fallback source for generating the authority key identifier
  25. extension will be taken from any value provided using X509V3_set_issuer_pkey().
  26. I<flags> may be 0
  27. or contain B<X509V3_CTX_TEST>, which means that just the syntax of
  28. extension definitions is to be checked without actually producing any 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. X509V3_set_issuer_pkey() explicitly sets the issuer private key of
  33. the subject certificate that has been provided in I<ctx>.
  34. This should be done in case the I<issuer> and I<subject> arguments to
  35. X509V3_set_ctx() have the same pointer value
  36. to provide fallback data for the authority key identifier extension.
  37. =head1 RETURN VALUES
  38. X509V3_set_ctx() and X509V3_set_issuer_pkey()
  39. return 1 on success and 0 on error.
  40. =head1 SEE ALSO
  41. L<X509_add_ext(3)>
  42. =head1 HISTORY
  43. X509V3_set_issuer_pkey() was added in OpenSSL 3.0.
  44. CTX_TEST was deprecated in OpenSSL 3.0; use X509V3_CTX_TEST instead.
  45. =head1 COPYRIGHT
  46. Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
  47. Licensed under the Apache License 2.0 (the "License"). You may not use
  48. this file except in compliance with the License. You can obtain a copy
  49. in the file LICENSE in the source distribution or at
  50. L<https://www.openssl.org/source/license.html>.
  51. =cut