OSSL_ESS_check_signing_certs.pod 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. =pod
  2. =head1 NAME
  3. OSSL_ESS_signing_cert_new_init,
  4. OSSL_ESS_signing_cert_v2_new_init,
  5. OSSL_ESS_check_signing_certs
  6. - Enhanced Security Services (ESS) functions
  7. =head1 SYNOPSIS
  8. #include <openssl/ess.h>
  9. ESS_SIGNING_CERT *OSSL_ESS_signing_cert_new_init(const X509 *signcert,
  10. const STACK_OF(X509) *certs,
  11. int set_issuer_serial);
  12. ESS_SIGNING_CERT_V2 *OSSL_ESS_signing_cert_v2_new_init(const EVP_MD *hash_alg,
  13. const X509 *signcert,
  14. const
  15. STACK_OF(X509) *certs,
  16. int set_issuer_serial);
  17. int OSSL_ESS_check_signing_certs(const ESS_SIGNING_CERT *ss,
  18. const ESS_SIGNING_CERT_V2 *ssv2,
  19. const STACK_OF(X509) *chain,
  20. int require_signing_cert);
  21. =head1 DESCRIPTION
  22. OSSL_ESS_signing_cert_new_init() generates a new B<ESS_SIGNING_CERT> structure
  23. referencing the given I<signcert> and any given further I<certs>
  24. using their SHA-1 fingerprints.
  25. If I<set_issuer_serial> is nonzero then also the issuer and serial number
  26. of I<signcert> are included in the B<ESS_CERT_ID> as the B<issuerSerial> field.
  27. For all members of I<certs> the B<issuerSerial> field is always included.
  28. OSSL_ESS_signing_cert_v2_new_init() is the same as
  29. OSSL_ESS_signing_cert_new_init() except that it uses the given I<hash_alg> and
  30. generates a B<ESS_SIGNING_CERT_V2> structure with B<ESS_CERT_ID_V2> elements.
  31. OSSL_ESS_check_signing_certs() checks if the validation chain I<chain> contains
  32. the certificates required by the identifiers given in I<ss> and/or I<ssv2>.
  33. If I<require_signing_cert> is nonzero, I<ss> or I<ssv2> must not be NULL.
  34. If both I<ss> and I<ssv2> are not NULL, they are evaluated independently.
  35. The list of certificate identifiers in I<ss> is of type B<ESS_CERT_ID>,
  36. while the list contained in I<ssv2> is of type B<ESS_CERT_ID_V2>.
  37. As far as these lists are present, they must be nonempty.
  38. The certificate identified by their first entry must be the first element of
  39. I<chain>, i.e. the signer certificate.
  40. Any further certficates referenced in the list must also be found in I<chain>.
  41. The matching is done using the given certificate hash algorithm and value.
  42. In addition to the checks required by RFCs 2624 and 5035,
  43. if the B<issuerSerial> field is included in an B<ESSCertID> or B<ESSCertIDv2>
  44. it must match the certificate issuer and serial number attributes.
  45. =head1 NOTES
  46. ESS has been defined in RFC 2634, which has been updated in RFC 5035
  47. (ESS version 2) to support hash algorithms other than SHA-1.
  48. This is used for TSP (RFC 3161) and CAdES-BES (informational RFC 5126).
  49. =head1 RETURN VALUES
  50. OSSL_ESS_signing_cert_new_init() and OSSL_ESS_signing_cert_v2_new_init()
  51. return a pointer to the new structure or NULL on malloc failure.
  52. OSSL_ESS_check_signing_certs() returns 1 on success,
  53. 0 if a required certificate cannot be found, -1 on other error.
  54. =head1 SEE ALSO
  55. L<TS_VERIFY_CTX_set_certs(3)>,
  56. L<CMS_verify(3)>
  57. =head1 HISTORY
  58. OSSL_ESS_signing_cert_new_init(), OSSL_ESS_signing_cert_v2_new_init(), and
  59. OSSL_ESS_check_signing_certs() were added in OpenSSL 3.0.
  60. =head1 COPYRIGHT
  61. Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
  62. Licensed under the Apache License 2.0 (the "License"). You may not use
  63. this file except in compliance with the License. You can obtain a copy
  64. in the file LICENSE in the source distribution or at
  65. L<https://www.openssl.org/source/license.html>.
  66. =cut