X509_EXTENSION_set_object.3ossl 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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 "X509_EXTENSION_SET_OBJECT 3ossl"
  58. .TH X509_EXTENSION_SET_OBJECT 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. X509_EXTENSION_set_object, X509_EXTENSION_set_critical,
  65. X509_EXTENSION_set_data, X509_EXTENSION_create_by_NID,
  66. X509_EXTENSION_create_by_OBJ, X509_EXTENSION_get_object,
  67. X509_EXTENSION_get_critical, X509_EXTENSION_get_data \- extension utility
  68. functions
  69. .SH SYNOPSIS
  70. .IX Header "SYNOPSIS"
  71. .Vb 3
  72. \& int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj);
  73. \& int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
  74. \& int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
  75. \&
  76. \& X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
  77. \& int nid, int crit,
  78. \& ASN1_OCTET_STRING *data);
  79. \& X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
  80. \& const ASN1_OBJECT *obj, int crit,
  81. \& ASN1_OCTET_STRING *data);
  82. \&
  83. \& ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
  84. \& int X509_EXTENSION_get_critical(const X509_EXTENSION *ex);
  85. \& ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
  86. .Ve
  87. .SH DESCRIPTION
  88. .IX Header "DESCRIPTION"
  89. \&\fBX509_EXTENSION_set_object()\fR sets the extension type of \fBex\fR to \fBobj\fR. The
  90. \&\fBobj\fR pointer is duplicated internally so \fBobj\fR should be freed up after use.
  91. .PP
  92. \&\fBX509_EXTENSION_set_critical()\fR sets the criticality of \fBex\fR to \fBcrit\fR. If
  93. \&\fBcrit\fR is zero the extension in non-critical otherwise it is critical.
  94. .PP
  95. \&\fBX509_EXTENSION_set_data()\fR sets the data in extension \fBex\fR to \fBdata\fR. The
  96. \&\fBdata\fR pointer is duplicated internally.
  97. .PP
  98. \&\fBX509_EXTENSION_create_by_NID()\fR creates an extension of type \fBnid\fR,
  99. criticality \fBcrit\fR using data \fBdata\fR. The created extension is returned and
  100. written to \fB*ex\fR reusing or allocating a new extension if necessary so \fB*ex\fR
  101. should either be \fBNULL\fR or a valid \fBX509_EXTENSION\fR structure it must
  102. \&\fBnot\fR be an uninitialised pointer.
  103. .PP
  104. \&\fBX509_EXTENSION_create_by_OBJ()\fR is identical to \fBX509_EXTENSION_create_by_NID()\fR
  105. except it creates and extension using \fBobj\fR instead of a NID.
  106. .PP
  107. \&\fBX509_EXTENSION_get_object()\fR returns the extension type of \fBex\fR as an
  108. \&\fBASN1_OBJECT\fR pointer. The returned pointer is an internal value which must
  109. not be freed up.
  110. .PP
  111. \&\fBX509_EXTENSION_get_critical()\fR returns the criticality of extension \fBex\fR it
  112. returns \fB1\fR for critical and \fB0\fR for non-critical.
  113. .PP
  114. \&\fBX509_EXTENSION_get_data()\fR returns the data of extension \fBex\fR. The returned
  115. pointer is an internal value which must not be freed up.
  116. .SH NOTES
  117. .IX Header "NOTES"
  118. These functions manipulate the contents of an extension directly. Most
  119. applications will want to parse or encode and add an extension: they should
  120. use the extension encode and decode functions instead such as
  121. \&\fBX509_add1_ext_i2d()\fR and \fBX509_get_ext_d2i()\fR.
  122. .PP
  123. The \fBdata\fR associated with an extension is the extension encoding in an
  124. \&\fBASN1_OCTET_STRING\fR structure.
  125. .SH "RETURN VALUES"
  126. .IX Header "RETURN VALUES"
  127. \&\fBX509_EXTENSION_set_object()\fR \fBX509_EXTENSION_set_critical()\fR and
  128. \&\fBX509_EXTENSION_set_data()\fR return \fB1\fR for success and \fB0\fR for failure.
  129. .PP
  130. \&\fBX509_EXTENSION_create_by_NID()\fR and \fBX509_EXTENSION_create_by_OBJ()\fR return
  131. an \fBX509_EXTENSION\fR pointer or \fBNULL\fR if an error occurs.
  132. .PP
  133. \&\fBX509_EXTENSION_get_object()\fR returns an \fBASN1_OBJECT\fR pointer.
  134. .PP
  135. \&\fBX509_EXTENSION_get_critical()\fR returns \fB0\fR for non-critical and \fB1\fR for
  136. critical.
  137. .PP
  138. \&\fBX509_EXTENSION_get_data()\fR returns an \fBASN1_OCTET_STRING\fR pointer.
  139. .SH "SEE ALSO"
  140. .IX Header "SEE ALSO"
  141. \&\fBX509V3_get_d2i\fR\|(3)
  142. .SH COPYRIGHT
  143. .IX Header "COPYRIGHT"
  144. Copyright 2015\-2016 The OpenSSL Project Authors. All Rights Reserved.
  145. .PP
  146. Licensed under the Apache License 2.0 (the "License"). You may not use
  147. this file except in compliance with the License. You can obtain a copy
  148. in the file LICENSE in the source distribution or at
  149. <https://www.openssl.org/source/license.html>.