OSSL_CMP_MSG_get0_header.pod 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. =pod
  2. =head1 NAME
  3. OSSL_CMP_MSG_get0_header,
  4. OSSL_CMP_MSG_update_transactionID,
  5. OSSL_CMP_CTX_setup_CRM,
  6. OSSL_CMP_MSG_read,
  7. OSSL_CMP_MSG_write,
  8. d2i_OSSL_CMP_MSG_bio,
  9. i2d_OSSL_CMP_MSG_bio
  10. - function(s) manipulating CMP messages
  11. =head1 SYNOPSIS
  12. #include <openssl/cmp.h>
  13. OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg);
  14. int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
  15. OSSL_CRMF_MSG *OSSL_CMP_CTX_setup_CRM(OSSL_CMP_CTX *ctx, int for_KUR, int rid);
  16. OSSL_CMP_MSG *OSSL_CMP_MSG_read(const char *file);
  17. int OSSL_CMP_MSG_write(const char *file, const OSSL_CMP_MSG *msg);
  18. OSSL_CMP_MSG *d2i_OSSL_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg);
  19. int i2d_OSSL_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg);
  20. =head1 DESCRIPTION
  21. OSSL_CMP_MSG_get0_header() returns the header of the given CMP message.
  22. OSSL_CMP_MSG_update_transactionID() updates the transactionID field
  23. in the header of the given message according to the CMP_CTX.
  24. This requires re-protecting the message (if it was protected).
  25. OSSL_CMP_CTX_setup_CRM() creates a CRMF certificate request message
  26. for inclusion in a CMP request message based on details contained in I<ctx>.
  27. If the CMP context does not include a subject name set via
  28. L<OSSL_CMP_CTX_set1_subjectName(3)> but includes a reference certificate
  29. then it copies the subject DN from there
  30. if I<for_KUR> is set or the I<ctx> does not include a subjectAltName.
  31. The I<rid> defines the request identifier to use, which typically is 0.
  32. OSSL_CMP_MSG_read() loads a DER-encoded OSSL_CMP_MSG from I<file>.
  33. OSSL_CMP_MSG_write() stores the given OSSL_CMP_MSG to I<file> in DER encoding.
  34. d2i_OSSL_CMP_MSG_bio() parses an ASN.1-encoded OSSL_CMP_MSG from the BIO I<bio>.
  35. It assigns a pointer to the new structure to I<*msg> if I<msg> is not NULL.
  36. i2d_OSSL_CMP_MSG_bio() writes the OSSL_CMP_MSG I<msg> in ASN.1 encoding
  37. to BIO I<bio>.
  38. =head1 NOTES
  39. CMP is defined in RFC 4210.
  40. =head1 RETURN VALUES
  41. OSSL_CMP_MSG_get0_header() returns the intended pointer value as described above
  42. or NULL if the respective entry does not exist and on error.
  43. OSSL_CMP_CTX_setup_CRM() returns a pointer to a OSSL_CRMF_MSG on success,
  44. NULL on error.
  45. d2i_OSSL_CMP_MSG_bio() returns the parsed message or NULL on error.
  46. OSSL_CMP_MSG_read() and d2i_OSSL_CMP_MSG_bio()
  47. return the parsed CMP message or NULL on error.
  48. OSSL_CMP_MSG_write() and i2d_OSSL_CMP_MSG_bio() return
  49. the number of bytes successfully encoded or a negative value if an error occurs.
  50. OSSL_CMP_MSG_update_transactionID() returns 1 on success, 0 on error.
  51. =head1 HISTORY
  52. The OpenSSL CMP support was added in OpenSSL 3.0.
  53. =head1 COPYRIGHT
  54. Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
  55. Licensed under the Apache License 2.0 (the "License"). You may not use
  56. this file except in compliance with the License. You can obtain a copy
  57. in the file LICENSE in the source distribution or at
  58. L<https://www.openssl.org/source/license.html>.
  59. =cut