OSSL_CMP_ATAV_set0.3ossl 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "OSSL_CMP_ATAV_SET0 3ossl"
  58. .TH OSSL_CMP_ATAV_SET0 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. OSSL_CMP_ATAV,
  65. OSSL_CMP_ATAV_create,
  66. OSSL_CMP_ATAV_set0,
  67. OSSL_CMP_ATAV_get0_type,
  68. OSSL_CMP_ATAV_get0_value,
  69. OSSL_CMP_ATAV_new_algId,
  70. OSSL_CMP_ATAV_get0_algId,
  71. OSSL_CMP_ATAV_new_rsaKeyLen,
  72. OSSL_CMP_ATAV_get_rsaKeyLen,
  73. OSSL_CMP_ATAVS,
  74. OSSL_CMP_ATAV_push1,
  75. OSSL_CMP_ATAV_free
  76. \&\- OSSL_CMP_ATAV utility functions
  77. .SH SYNOPSIS
  78. .IX Header "SYNOPSIS"
  79. .Vb 1
  80. \& #include <openssl/cmp.h>
  81. \&
  82. \& typedef OSSL_CRMF_ATTRIBUTETYPEANDVALUE OSSL_CMP_ATAV;
  83. \& OSSL_CMP_ATAV *OSSL_CMP_ATAV_create(ASN1_OBJECT *type, ASN1_TYPE *value);
  84. \& void OSSL_CMP_ATAV_set0(OSSL_CMP_ATAV *atav, ASN1_OBJECT *type,
  85. \& ASN1_TYPE *value);
  86. \& ASN1_OBJECT *OSSL_CMP_ATAV_get0_type(const OSSL_CMP_ATAV *atav);
  87. \& ASN1_TYPE *OSSL_CMP_ATAV_get0_value(const OSSL_CMP_ATAV *atav);
  88. \&
  89. \& OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_algId(const X509_ALGOR *alg);
  90. \& X509_ALGOR *OSSL_CMP_ATAV_get0_algId(const OSSL_CMP_ATAV *atav);
  91. \& OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_rsaKeyLen(int len);
  92. \& int OSSL_CMP_ATAV_get_rsaKeyLen(const OSSL_CMP_ATAV *atav);
  93. \&
  94. \& typedef STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) OSSL_CMP_ATAVS;
  95. \& int OSSL_CMP_ATAV_push1(OSSL_CMP_ATAVS **sk_p, const OSSL_CMP_ATAV *atav);
  96. \& void OSSL_CMP_ATAV_free(OSSL_CMP_ATAV *atav);
  97. .Ve
  98. .SH DESCRIPTION
  99. .IX Header "DESCRIPTION"
  100. \&\fBOSSL_CMP_ATAV\fR is a short hand of \fBOSSL_CRMF_ATTRIBUTETYPEANDVALUE\fR,
  101. defined in RFC 4211 Appendix B.
  102. It is typically used in CertRequest structures,
  103. but also in CertReqTemplateContent structures for key specifications.
  104. .PP
  105. \&\fBOSSL_CMP_ATAV_create()\fR creates a new \fBOSSL_CMP_ATAV\fR structure and fills it in.
  106. It combines \fBOSSL_CMP_ATAV_new()\fR and \fBOSSL_CMP_ATAV_set0()\fR.
  107. .PP
  108. \&\fBOSSL_CMP_ATAV_set0()\fR sets the \fIatav\fR with an infoType of \fItype\fR and an
  109. infoValue of \fIvalue\fR.
  110. The pointers \fItype\fR and \fIvalue\fR may be NULL, otherwise
  111. they must \fBnot\fR be freed up after the call because their ownership
  112. is transferred to \fIatav\fR. The \fIitav\fR pointer must not be NULL.
  113. .PP
  114. \&\fBOSSL_CMP_ATAV_get0_type()\fR returns a direct pointer to the infoType
  115. in the \fIatav\fR unless it is NULL.
  116. .PP
  117. \&\fBOSSL_CMP_ATAV_get0_value()\fR returns a direct pointer to the infoValue
  118. in the \fIatav\fR as generic \fBASN1_TYPE\fR pointer unless \fIatav\fR is NULL.
  119. .PP
  120. \&\fBOSSL_CMP_ATAV_new_algId()\fR creates a new \fBOSSL_CMP_ATAV\fR structure of type
  121. \&\fBalgId\fR and fills it in with a copy of the given \fIalg\fR.
  122. .PP
  123. \&\fBOSSL_CMP_ATAV_get0_algId()\fR returns
  124. a direct pointer to the algId infoValue in the \fIatav\fR of type \fBX509_ALGOR\fR
  125. or NULL if \fIatav\fR is NULL or does not contain an algId.
  126. .PP
  127. \&\fBOSSL_CMP_ATAV_new_rsaKeyLen()\fR creates a new \fBOSSL_CMP_ATAV\fR structure of type
  128. \&\fBrsaKeyLen\fR and fills it in with the given \fIlen\fR, which must be positive.
  129. .PP
  130. \&\fBOSSL_CMP_ATAV_get_rsaKeyLen()\fR returns
  131. the RSA key length in rsaKeyLen infoValue in the \fIatav\fR,
  132. \&\-1 if \fIatav\fR is NULL or does not contain an rsaKeyLen or cannot be parsed,
  133. or \-2 if the value is less than 1 or is greater than INT_MAX.
  134. .PP
  135. \&\fBOSSL_CMP_ATAV_push1()\fR pushes a copy of \fIatav\fR to the stack of \fBOSSL_CMP_ATAV\fR
  136. pointed to by \fI*sk_p\fR. It creates a new stack if \fI*sk_p\fR points to NULL.
  137. .PP
  138. \&\fBOSSL_CMP_ATAV_free()\fR deallocates \fIatav\fR. It is defined as a macro.
  139. .SH NOTES
  140. .IX Header "NOTES"
  141. CMP is defined in RFC 4210. CRMF is defined in RFC 4211.
  142. .SH "RETURN VALUES"
  143. .IX Header "RETURN VALUES"
  144. \&\fBOSSL_CMP_ATAV_create()\fR,
  145. \&\fBOSSL_CMP_ATAV_new_algId()\fR, and \fBOSSL_CMP_ATAV_new_rsaKeyLen()\fR
  146. return a pointer to the ATAV structure on success, or NULL on error.
  147. .PP
  148. \&\fBOSSL_CMP_ATAV_set0()\fR and \fBOSSL_CMP_ATAV_free()\fR do not return a value.
  149. .PP
  150. \&\fBOSSL_CMP_ATAV_get0_type()\fR, \fBOSSL_CMP_ATAV_get0_value()\fR, and
  151. \&\fBOSSL_CMP_ATAV_get0_algId()\fR
  152. return the respective pointer or NULL if their input is NULL.
  153. .PP
  154. \&\fBOSSL_CMP_ATAV_get_rsaKeyLen()\fR return a key length in bits or < 0 on error.
  155. .PP
  156. \&\fBOSSL_CMP_ATAV_push1()\fR returns 1 on success, 0 on error.
  157. .SH "SEE ALSO"
  158. .IX Header "SEE ALSO"
  159. \&\fBOSSL_CMP_ITAV_new0_certReqTemplate\fR\|(3), \fBASN1_TYPE_set\fR\|(3)
  160. .SH HISTORY
  161. .IX Header "HISTORY"
  162. The \fBOSSL_CMP_ATAV\fR type and related functions were added in OpenSSL 3.4.
  163. .SH COPYRIGHT
  164. .IX Header "COPYRIGHT"
  165. Copyright 2022\-2024 The OpenSSL Project Authors. All Rights Reserved.
  166. .PP
  167. Licensed under the Apache License 2.0 (the "License"). You may not use
  168. this file except in compliance with the License. You can obtain a copy
  169. in the file LICENSE in the source distribution or at
  170. <https://www.openssl.org/source/license.html>.