OSSL_CRMF_MSG_set_validity.pod 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. =pod
  2. =head1 NAME
  3. OSSL_CRMF_MSG_set_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_set_validity(OSSL_CRMF_MSG *crm, time_t from, time_t to);
  14. int OSSL_CRMF_MSG_set_certReqId(OSSL_CRMF_MSG *crm, int rid);
  15. int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl,
  16. EVP_PKEY *pubkey,
  17. const X509_NAME *subject,
  18. const X509_NAME *issuer,
  19. const ASN1_INTEGER *serial);
  20. int OSSL_CRMF_MSG_set0_extensions(OSSL_CRMF_MSG *crm, X509_EXTENSIONS *exts);
  21. int OSSL_CRMF_MSG_push0_extension(OSSL_CRMF_MSG *crm, X509_EXTENSION *ext);
  22. int OSSL_CRMF_MSG_create_popo(OSSL_CRMF_MSG *crm, EVP_PKEY *pkey,
  23. int dgst, int ppmtd);
  24. int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
  25. int rid, int acceptRAVerified);
  26. =head1 DESCRIPTION
  27. OSSL_CRMF_MSG_set_validity() sets B<from> as notBefore and B<to> as notAfter
  28. as the validity in the certTemplate of B<crm>.
  29. OSSL_CRMF_MSG_set_certReqId() sets B<rid> as the certReqId of B<crm>.
  30. OSSL_CRMF_CERTTEMPLATE_fill() sets those fields of the certTemplate B<tmpl>
  31. for which non-NULL values are provided: B<pubkey>, B<subject>, B<issuer>,
  32. and/or B<serial>.
  33. On success the reference counter of the B<pubkey> (if given) is incremented,
  34. while the B<subject>, B<issuer>, and B<serial> structures (if given) are copied.
  35. OSSL_CRMF_MSG_set0_extensions() sets B<exts> as the extensions in the
  36. certTemplate of B<crm>. Frees any pre-existing ones and consumes B<exts>.
  37. OSSL_CRMF_MSG_push0_extension() pushes the X509 extension B<ext> to the
  38. extensions in the certTemplate of B<crm>. Consumes B<ext>.
  39. OSSL_CRMF_MSG_create_popo() creates and sets the Proof-of-Possession (POPO)
  40. according to the method B<ppmtd> in B<crm>.
  41. In case the method is OSSL_CRMF_POPO_SIGNATURE the POPO is calculated
  42. using the private B<pkey> and the digest algorithm NID B<dgst>.
  43. B<ppmtd> can be one of the following:
  44. =over 8
  45. =item * OSSL_CRMF_POPO_NONE - RFC 4211, section 4, POP field omitted.
  46. CA/RA uses out-of-band method to verify POP. Note that servers may fail in this
  47. case, resulting for instance in HTTP error code 500 (Internal error).
  48. =item * OSSL_CRMF_POPO_RAVERIFIED - RFC 4211, section 4, explicit indication
  49. that the RA has already verified the POP.
  50. =item * OSSL_CRMF_POPO_SIGNATURE - RFC 4211, section 4.1, only case 3 supported
  51. so far.
  52. =item * OSSL_CRMF_POPO_KEYENC - RFC 4211, section 4.2, only indirect method
  53. (subsequentMessage/enccert) supported,
  54. challenge-response exchange (challengeResp) not yet supported.
  55. =item * OSSL_CRMF_POPO_KEYAGREE - RFC 4211, section 4.3, not yet supported.
  56. =back
  57. OSSL_CRMF_MSGS_verify_popo verifies the Proof-of-Possession of the request with
  58. the given B<rid> in the list of B<reqs>. Optionally accepts RAVerified.
  59. =head1 RETURN VALUES
  60. All functions return 1 on success, 0 on error.
  61. =head1 SEE ALSO
  62. RFC 4211
  63. =head1 HISTORY
  64. The OpenSSL CRMF support was added in OpenSSL 3.0.
  65. =head1 COPYRIGHT
  66. Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
  67. Licensed under the Apache License 2.0 (the "License"). You may not use
  68. this file except in compliance with the License. You can obtain a copy
  69. in the file LICENSE in the source distribution or at
  70. L<https://www.openssl.org/source/license.html>.
  71. =cut