ess.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2019-2021 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. #ifndef OSSL_CRYPTO_ESS_H
  10. # define OSSL_CRYPTO_ESS_H
  11. # pragma once
  12. /*-
  13. * IssuerSerial ::= SEQUENCE {
  14. * issuer GeneralNames,
  15. * serialNumber CertificateSerialNumber
  16. * }
  17. */
  18. struct ESS_issuer_serial {
  19. STACK_OF(GENERAL_NAME) *issuer;
  20. ASN1_INTEGER *serial;
  21. };
  22. /*-
  23. * ESSCertID ::= SEQUENCE {
  24. * certHash Hash,
  25. * issuerSerial IssuerSerial OPTIONAL
  26. * }
  27. */
  28. struct ESS_cert_id {
  29. ASN1_OCTET_STRING *hash; /* Always SHA-1 digest. */
  30. ESS_ISSUER_SERIAL *issuer_serial;
  31. };
  32. /*-
  33. * SigningCertificate ::= SEQUENCE {
  34. * certs SEQUENCE OF ESSCertID,
  35. * policies SEQUENCE OF PolicyInformation OPTIONAL
  36. * }
  37. */
  38. struct ESS_signing_cert {
  39. STACK_OF(ESS_CERT_ID) *cert_ids;
  40. STACK_OF(POLICYINFO) *policy_info;
  41. };
  42. /*-
  43. * ESSCertIDv2 ::= SEQUENCE {
  44. * hashAlgorithm AlgorithmIdentifier DEFAULT id-sha256,
  45. * certHash Hash,
  46. * issuerSerial IssuerSerial OPTIONAL
  47. * }
  48. */
  49. struct ESS_cert_id_v2_st {
  50. X509_ALGOR *hash_alg; /* Default: SHA-256 */
  51. ASN1_OCTET_STRING *hash;
  52. ESS_ISSUER_SERIAL *issuer_serial;
  53. };
  54. /*-
  55. * SigningCertificateV2 ::= SEQUENCE {
  56. * certs SEQUENCE OF ESSCertIDv2,
  57. * policies SEQUENCE OF PolicyInformation OPTIONAL
  58. * }
  59. */
  60. struct ESS_signing_cert_v2_st {
  61. STACK_OF(ESS_CERT_ID_V2) *cert_ids;
  62. STACK_OF(POLICYINFO) *policy_info;
  63. };
  64. #endif /* OSSL_CRYPTO_ESS_H */