ossl_cmp_msg_create.pod 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. =pod
  2. =head1 NAME
  3. OSSL_CMP_PKIBODY_IR,
  4. OSSL_CMP_PKIBODY_IP,
  5. OSSL_CMP_PKIBODY_CR,
  6. OSSL_CMP_PKIBODY_CP,
  7. OSSL_CMP_PKIBODY_P10CR,
  8. OSSL_CMP_PKIBODY_POPDECC,
  9. OSSL_CMP_PKIBODY_POPDECR,
  10. OSSL_CMP_PKIBODY_KUR,
  11. OSSL_CMP_PKIBODY_KUP,
  12. OSSL_CMP_PKIBODY_KRR,
  13. OSSL_CMP_PKIBODY_KRP,
  14. OSSL_CMP_PKIBODY_RR,
  15. OSSL_CMP_PKIBODY_RP,
  16. OSSL_CMP_PKIBODY_CCR,
  17. OSSL_CMP_PKIBODY_CCP,
  18. OSSL_CMP_PKIBODY_CKUANN,
  19. OSSL_CMP_PKIBODY_CANN,
  20. OSSL_CMP_PKIBODY_RANN,
  21. OSSL_CMP_PKIBODY_CRLANN,
  22. OSSL_CMP_PKIBODY_PKICONF,
  23. OSSL_CMP_PKIBODY_NESTED,
  24. OSSL_CMP_PKIBODY_GENM,
  25. OSSL_CMP_PKIBODY_GENP,
  26. OSSL_CMP_PKIBODY_ERROR,
  27. OSSL_CMP_PKIBODY_CERTCONF,
  28. OSSL_CMP_PKIBODY_POLLREQ,
  29. OSSL_CMP_PKIBODY_POLLREP,
  30. ossl_cmp_bodytype_to_string,
  31. ossl_cmp_msg_get_bodytype,
  32. ossl_cmp_msg_set_bodytype,
  33. ossl_cmp_msg_create,
  34. ossl_cmp_msg_gen_ITAV_push0,
  35. ossl_cmp_msg_gen_ITAVs_push1
  36. - functions handling CMP messages
  37. =head1 SYNOPSIS
  38. #include "cmp_local.h"
  39. #define OSSL_CMP_PKIBODY_IR 0
  40. #define OSSL_CMP_PKIBODY_IP 1
  41. #define OSSL_CMP_PKIBODY_CR 2
  42. #define OSSL_CMP_PKIBODY_CP 3
  43. #define OSSL_CMP_PKIBODY_P10CR 4
  44. #define OSSL_CMP_PKIBODY_POPDECC 5
  45. #define OSSL_CMP_PKIBODY_POPDECR 6
  46. #define OSSL_CMP_PKIBODY_KUR 7
  47. #define OSSL_CMP_PKIBODY_KUP 8
  48. #define OSSL_CMP_PKIBODY_KRR 9
  49. #define OSSL_CMP_PKIBODY_KRP 10
  50. #define OSSL_CMP_PKIBODY_RR 11
  51. #define OSSL_CMP_PKIBODY_RP 12
  52. #define OSSL_CMP_PKIBODY_CCR 13
  53. #define OSSL_CMP_PKIBODY_CCP 14
  54. #define OSSL_CMP_PKIBODY_CKUANN 15
  55. #define OSSL_CMP_PKIBODY_CANN 16
  56. #define OSSL_CMP_PKIBODY_RANN 17
  57. #define OSSL_CMP_PKIBODY_CRLANN 18
  58. #define OSSL_CMP_PKIBODY_PKICONF 19
  59. #define OSSL_CMP_PKIBODY_NESTED 20
  60. #define OSSL_CMP_PKIBODY_GENM 21
  61. #define OSSL_CMP_PKIBODY_GENP 22
  62. #define OSSL_CMP_PKIBODY_ERROR 23
  63. #define OSSL_CMP_PKIBODY_CERTCONF 24
  64. #define OSSL_CMP_PKIBODY_POLLREQ 25
  65. #define OSSL_CMP_PKIBODY_POLLREP 26
  66. const char *ossl_cmp_bodytype_to_string(int type);
  67. int ossl_cmp_msg_get_bodytype(const OSSL_CMP_MSG *msg);
  68. int ossl_cmp_msg_set_bodytype( OSSL_CMP_MSG *msg, int type);
  69. OSSL_CMP_MSG *ossl_cmp_msg_create(OSSL_CMP_CTX *ctx, int bodytype);
  70. int ossl_cmp_msg_gen_ITAV_push0(OSSL_CMP_MSG *msg, OSSL_CMP_ITAV *itav);
  71. int ossl_cmp_msg_gen_ITAVs_push1(OSSL_CMP_MSG *msg,
  72. STACK_OF(OSSL_CMP_ITAV) *itavs);
  73. =head1 DESCRIPTION
  74. ossl_cmp_bodytype_to_string() returns the name of the given body type as string,
  75. or "illegal body type" on error.
  76. ossl_cmp_msg_get_bodytype() returns the body type of the given PKIMessage,
  77. or -1 on error.
  78. ossl_cmp_msg_set_bodytype() sets the type of the message contained in
  79. the PKIMessage body field.
  80. Returns 1 on success, 0 on error.
  81. ossl_cmp_msg_create() creates and initializes an B<OSSL_CMP_MSG> structure,
  82. using fields of B<ctx> for the header and B<bodytype> for the body.
  83. If the current B<transactionID> field in I<ctx> indicates that there is no
  84. current transaction, it creates and stores a random one with 128 bits length.
  85. Thus, the I<ctx> may be modified by this and related ossl_cmp_*_new() functions.
  86. Returns pointer to created B<OSSL_CMP_MSG> on success, NULL on error.
  87. ossl_cmp_msg_gen_ITAV_push0() pushes the B<itav> to the body of the
  88. PKIMessage B<msg> of GenMsg or GenRep type. Consumes the B<itavs> pointer.
  89. Returns 1 on success, 0 on error.
  90. ossl_cmp_msg_gen_ITAVs_push1() adds a copy of the B<itavs> stack to the body
  91. of the PKIMessage B<msg> of GenMsg or GenRep type.
  92. Does not consume the B<itavs> pointer nor its elements.
  93. Returns 1 on success, 0 on error.
  94. =head1 NOTES
  95. CMP is defined in RFC 4210 (and CRMF in RFC 4211).
  96. =head1 RETURN VALUES
  97. See the individual functions above.
  98. =head1 SEE ALSO
  99. L<ossl_cmp_hdr_init(3)>,
  100. L<OSSL_CMP_CTX_new(3)>, L<OSSL_CMP_exec_certreq(3)>
  101. =head1 HISTORY
  102. The OpenSSL CMP support was added in OpenSSL 3.0.
  103. =head1 COPYRIGHT
  104. Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
  105. Licensed under the Apache License 2.0 (the "License"). You may not use
  106. this file except in compliance with the License. You can obtain a copy
  107. in the file LICENSE in the source distribution or at
  108. L<https://www.openssl.org/source/license.html>.
  109. =cut