ess_int.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. /* internal ESS related stuff */
  10. ESS_SIGNING_CERT *ESS_SIGNING_CERT_get(PKCS7_SIGNER_INFO *si);
  11. int ESS_SIGNING_CERT_add(PKCS7_SIGNER_INFO *si, ESS_SIGNING_CERT *sc);
  12. ESS_SIGNING_CERT_V2 *ESS_SIGNING_CERT_V2_get(PKCS7_SIGNER_INFO *si);
  13. int ESS_SIGNING_CERT_V2_add(PKCS7_SIGNER_INFO *si, ESS_SIGNING_CERT_V2 *sc);
  14. /*-
  15. * IssuerSerial ::= SEQUENCE {
  16. * issuer GeneralNames,
  17. * serialNumber CertificateSerialNumber
  18. * }
  19. */
  20. struct ESS_issuer_serial {
  21. STACK_OF(GENERAL_NAME) *issuer;
  22. ASN1_INTEGER *serial;
  23. };
  24. /*-
  25. * ESSCertID ::= SEQUENCE {
  26. * certHash Hash,
  27. * issuerSerial IssuerSerial OPTIONAL
  28. * }
  29. */
  30. struct ESS_cert_id {
  31. ASN1_OCTET_STRING *hash; /* Always SHA-1 digest. */
  32. ESS_ISSUER_SERIAL *issuer_serial;
  33. };
  34. /*-
  35. * SigningCertificate ::= SEQUENCE {
  36. * certs SEQUENCE OF ESSCertID,
  37. * policies SEQUENCE OF PolicyInformation OPTIONAL
  38. * }
  39. */
  40. struct ESS_signing_cert {
  41. STACK_OF(ESS_CERT_ID) *cert_ids;
  42. STACK_OF(POLICYINFO) *policy_info;
  43. };
  44. /*-
  45. * ESSCertIDv2 ::= SEQUENCE {
  46. * hashAlgorithm AlgorithmIdentifier DEFAULT id-sha256,
  47. * certHash Hash,
  48. * issuerSerial IssuerSerial OPTIONAL
  49. * }
  50. */
  51. struct ESS_cert_id_v2_st {
  52. X509_ALGOR *hash_alg; /* Default: SHA-256 */
  53. ASN1_OCTET_STRING *hash;
  54. ESS_ISSUER_SERIAL *issuer_serial;
  55. };
  56. /*-
  57. * SigningCertificateV2 ::= SEQUENCE {
  58. * certs SEQUENCE OF ESSCertIDv2,
  59. * policies SEQUENCE OF PolicyInformation OPTIONAL
  60. * }
  61. */
  62. struct ESS_signing_cert_v2_st {
  63. STACK_OF(ESS_CERT_ID_V2) *cert_ids;
  64. STACK_OF(POLICYINFO) *policy_info;
  65. };