OSSL_CRMF_MSG_set0_validity.pod 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. =pod
  2. =head1 NAME
  3. OSSL_CRMF_MSG_set0_validity,
  4. OSSL_CRMF_MSG_set_certReqId,
  5. OSSL_CRMF_CERTTEMPLATE_fill,
  6. OSSL_CRMF_MSG_set0_extensions,
  7. OSSL_CRMF_MSG_push0_extension,
  8. OSSL_CRMF_MSG_create_popo,
  9. OSSL_CRMF_MSGS_verify_popo
  10. - functions populating and verifying CRMF CertReqMsg structures
  11. =head1 SYNOPSIS
  12. #include <openssl/crmf.h>
  13. int OSSL_CRMF_MSG_set0_validity(OSSL_CRMF_MSG *crm,
  14. ASN1_TIME *notBefore, ASN1_TIME *notAfter);
  15. int OSSL_CRMF_MSG_set_certReqId(OSSL_CRMF_MSG *crm, int rid);
  16. int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl,
  17. EVP_PKEY *pubkey,
  18. const X509_NAME *subject,
  19. const X509_NAME *issuer,
  20. const ASN1_INTEGER *serial);
  21. int OSSL_CRMF_MSG_set0_extensions(OSSL_CRMF_MSG *crm, X509_EXTENSIONS *exts);
  22. int OSSL_CRMF_MSG_push0_extension(OSSL_CRMF_MSG *crm, X509_EXTENSION *ext);
  23. int OSSL_CRMF_MSG_create_popo(int meth, OSSL_CRMF_MSG *crm,
  24. EVP_PKEY *pkey, const EVP_MD *digest,
  25. OSSL_LIB_CTX *libctx, const char *propq);
  26. int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
  27. int rid, int acceptRAVerified,
  28. OSSL_LIB_CTX *libctx, const char *propq);
  29. =head1 DESCRIPTION
  30. OSSL_CRMF_MSG_set0_validity() sets the I<notBefore> and I<notAfter> fields
  31. as validity constraints in the certTemplate of I<crm>.
  32. Any of the I<notBefore> and I<notAfter> parameters may be NULL,
  33. which means no constraint for the respective field.
  34. On success ownership of I<notBefore> and I<notAfter> is transferred to I<crm>.
  35. OSSL_CRMF_MSG_set_certReqId() sets I<rid> as the certReqId of I<crm>.
  36. OSSL_CRMF_CERTTEMPLATE_fill() sets those fields of the certTemplate I<tmpl>
  37. for which non-NULL values are provided: I<pubkey>, I<subject>, I<issuer>,
  38. and/or I<serial>.
  39. X.509 extensions may be set using OSSL_CRMF_MSG_set0_extensions().
  40. On success the reference counter of the I<pubkey> (if given) is incremented,
  41. while the I<subject>, I<issuer>, and I<serial> structures (if given) are copied.
  42. OSSL_CRMF_MSG_set0_extensions() sets I<exts> as the extensions in the
  43. certTemplate of I<crm>. Frees any pre-existing ones and consumes I<exts>.
  44. OSSL_CRMF_MSG_push0_extension() pushes the X509 extension I<ext> to the
  45. extensions in the certTemplate of I<crm>. Consumes I<ext>.
  46. OSSL_CRMF_MSG_create_popo() creates and sets the Proof-of-Possession (POPO)
  47. according to the method I<meth> in I<crm>.
  48. The library context I<libctx> and property query string I<propq>,
  49. may be NULL to select the defaults.
  50. In case the method is OSSL_CRMF_POPO_SIGNATURE the POPO is calculated
  51. using the private key I<pkey> and the digest method I<digest>,
  52. where the I<digest> argument is ignored if I<pkey> is of a type (such as
  53. Ed25519 and Ed448) that is implicitly associated with a digest alorithm.
  54. I<meth> can be one of the following:
  55. =over 8
  56. =item * OSSL_CRMF_POPO_NONE - RFC 4211, section 4, POP field omitted.
  57. CA/RA uses out-of-band method to verify POP. Note that servers may fail in this
  58. case, resulting for instance in HTTP error code 500 (Internal error).
  59. =item * OSSL_CRMF_POPO_RAVERIFIED - RFC 4211, section 4, explicit indication
  60. that the RA has already verified the POP.
  61. =item * OSSL_CRMF_POPO_SIGNATURE - RFC 4211, section 4.1, only case 3 supported
  62. so far.
  63. =item * OSSL_CRMF_POPO_KEYENC - RFC 4211, section 4.2, only indirect method
  64. (subsequentMessage/enccert) supported,
  65. challenge-response exchange (challengeResp) not yet supported.
  66. =item * OSSL_CRMF_POPO_KEYAGREE - RFC 4211, section 4.3, not yet supported.
  67. =back
  68. OSSL_CRMF_MSGS_verify_popo verifies the Proof-of-Possession of the request with
  69. the given I<rid> in the list of I<reqs>. Optionally accepts RAVerified. It can
  70. make use of the library context I<libctx> and property query string I<propq>.
  71. =head1 RETURN VALUES
  72. All functions return 1 on success, 0 on error.
  73. =head1 SEE ALSO
  74. RFC 4211
  75. =head1 HISTORY
  76. The OpenSSL CRMF support was added in OpenSSL 3.0.
  77. =head1 COPYRIGHT
  78. Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
  79. Licensed under the Apache License 2.0 (the "License"). You may not use
  80. this file except in compliance with the License. You can obtain a copy
  81. in the file LICENSE in the source distribution or at
  82. L<https://www.openssl.org/source/license.html>.
  83. =cut