OSSL_ENCODER.3ossl 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .\"
  45. .\" Escape single quotes in literal strings from groff's Unicode transform.
  46. .ie \n(.g .ds Aq \(aq
  47. .el .ds Aq '
  48. .\"
  49. .\" If the F register is >0, we'll generate index entries on stderr for
  50. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  51. .\" entries marked with X<> in POD. Of course, you'll have to process the
  52. .\" output yourself in some meaningful fashion.
  53. .\"
  54. .\" Avoid warning from groff about undefined register 'F'.
  55. .de IX
  56. ..
  57. .nr rF 0
  58. .if \n(.g .if rF .nr rF 1
  59. .if (\n(rF:(\n(.g==0)) \{\
  60. . if \nF \{\
  61. . de IX
  62. . tm Index:\\$1\t\\n%\t"\\$2"
  63. ..
  64. . if !\nF==2 \{\
  65. . nr % 0
  66. . nr F 2
  67. . \}
  68. . \}
  69. .\}
  70. .rr rF
  71. .\"
  72. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  73. .\" Fear. Run. Save yourself. No user-serviceable parts.
  74. . \" fudge factors for nroff and troff
  75. .if n \{\
  76. . ds #H 0
  77. . ds #V .8m
  78. . ds #F .3m
  79. . ds #[ \f1
  80. . ds #] \fP
  81. .\}
  82. .if t \{\
  83. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  84. . ds #V .6m
  85. . ds #F 0
  86. . ds #[ \&
  87. . ds #] \&
  88. .\}
  89. . \" simple accents for nroff and troff
  90. .if n \{\
  91. . ds ' \&
  92. . ds ` \&
  93. . ds ^ \&
  94. . ds , \&
  95. . ds ~ ~
  96. . ds /
  97. .\}
  98. .if t \{\
  99. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  100. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  101. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  102. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  103. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  104. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  105. .\}
  106. . \" troff and (daisy-wheel) nroff accents
  107. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  108. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  109. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  110. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  111. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  112. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  113. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  114. .ds ae a\h'-(\w'a'u*4/10)'e
  115. .ds Ae A\h'-(\w'A'u*4/10)'E
  116. . \" corrections for vroff
  117. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  118. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  119. . \" for low resolution devices (crt and lpr)
  120. .if \n(.H>23 .if \n(.V>19 \
  121. \{\
  122. . ds : e
  123. . ds 8 ss
  124. . ds o a
  125. . ds d- d\h'-1'\(ga
  126. . ds D- D\h'-1'\(hy
  127. . ds th \o'bp'
  128. . ds Th \o'LP'
  129. . ds ae ae
  130. . ds Ae AE
  131. .\}
  132. .rm #[ #] #H #V #F C
  133. .\" ========================================================================
  134. .\"
  135. .IX Title "OSSL_ENCODER 3ossl"
  136. .TH OSSL_ENCODER 3ossl "2024-09-03" "3.3.2" "OpenSSL"
  137. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  138. .\" way too many mistakes in technical documents.
  139. .if n .ad l
  140. .nh
  141. .SH "NAME"
  142. OSSL_ENCODER,
  143. OSSL_ENCODER_fetch,
  144. OSSL_ENCODER_up_ref,
  145. OSSL_ENCODER_free,
  146. OSSL_ENCODER_get0_provider,
  147. OSSL_ENCODER_get0_properties,
  148. OSSL_ENCODER_is_a,
  149. OSSL_ENCODER_get0_name,
  150. OSSL_ENCODER_get0_description,
  151. OSSL_ENCODER_do_all_provided,
  152. OSSL_ENCODER_names_do_all,
  153. OSSL_ENCODER_gettable_params,
  154. OSSL_ENCODER_get_params
  155. \&\- Encoder method routines
  156. .SH "SYNOPSIS"
  157. .IX Header "SYNOPSIS"
  158. .Vb 1
  159. \& #include <openssl/encoder.h>
  160. \&
  161. \& typedef struct ossl_encoder_st OSSL_ENCODER;
  162. \&
  163. \& OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *ctx, const char *name,
  164. \& const char *properties);
  165. \& int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder);
  166. \& void OSSL_ENCODER_free(OSSL_ENCODER *encoder);
  167. \& const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder);
  168. \& const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder);
  169. \& int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name);
  170. \& const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *encoder);
  171. \& const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *encoder);
  172. \& void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
  173. \& void (*fn)(OSSL_ENCODER *encoder, void *arg),
  174. \& void *arg);
  175. \& int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
  176. \& void (*fn)(const char *name, void *data),
  177. \& void *data);
  178. \& const OSSL_PARAM *OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder);
  179. \& int OSSL_ENCODER_get_params(OSSL_ENCODER_CTX *ctx, const OSSL_PARAM params[]);
  180. .Ve
  181. .SH "DESCRIPTION"
  182. .IX Header "DESCRIPTION"
  183. \&\fB\s-1OSSL_ENCODER\s0\fR is a method for encoders, which know how to
  184. encode an object of some kind to a encoded form, such as \s-1PEM,
  185. DER,\s0 or even human readable text.
  186. .PP
  187. \&\fBOSSL_ENCODER_fetch()\fR looks for an algorithm within the provider that
  188. has been loaded into the \fB\s-1OSSL_LIB_CTX\s0\fR given by \fIctx\fR, having the
  189. name given by \fIname\fR and the properties given by \fIproperties\fR.
  190. The \fIname\fR determines what type of object the fetched encoder
  191. method is expected to be able to encode, and the properties are
  192. used to determine the expected output type.
  193. For known properties and the values they may have, please have a look
  194. in \*(L"Names and properties\*(R" in \fBprovider\-encoder\fR\|(7).
  195. .PP
  196. \&\fBOSSL_ENCODER_up_ref()\fR increments the reference count for the given
  197. \&\fIencoder\fR.
  198. .PP
  199. \&\fBOSSL_ENCODER_free()\fR decrements the reference count for the given
  200. \&\fIencoder\fR, and when the count reaches zero, frees it.
  201. If the argument is \s-1NULL,\s0 nothing is done.
  202. .PP
  203. \&\fBOSSL_ENCODER_get0_provider()\fR returns the provider of the given
  204. \&\fIencoder\fR.
  205. .PP
  206. \&\fBOSSL_ENCODER_get0_properties()\fR returns the property definition associated
  207. with the given \fIencoder\fR.
  208. .PP
  209. \&\fBOSSL_ENCODER_is_a()\fR checks if \fIencoder\fR is an implementation of an
  210. algorithm that's identifiable with \fIname\fR.
  211. .PP
  212. \&\fBOSSL_ENCODER_get0_name()\fR returns the name used to fetch the given \fIencoder\fR.
  213. .PP
  214. \&\fBOSSL_ENCODER_get0_description()\fR returns a description of the \fIloader\fR, meant
  215. for display and human consumption. The description is at the discretion of the
  216. \&\fIloader\fR implementation.
  217. .PP
  218. \&\fBOSSL_ENCODER_names_do_all()\fR traverses all names for the given
  219. \&\fIencoder\fR, and calls \fIfn\fR with each name and \fIdata\fR as arguments.
  220. .PP
  221. \&\fBOSSL_ENCODER_do_all_provided()\fR traverses all encoder
  222. implementations by all activated providers in the library context
  223. \&\fIlibctx\fR, and for each of the implementations, calls \fIfn\fR with the
  224. implementation method and \fIarg\fR as arguments.
  225. .PP
  226. \&\fBOSSL_ENCODER_gettable_params()\fR returns an \s-1\fBOSSL_PARAM\s0\fR\|(3)
  227. array of parameter descriptors.
  228. .PP
  229. \&\fBOSSL_ENCODER_get_params()\fR attempts to get parameters specified
  230. with an \s-1\fBOSSL_PARAM\s0\fR\|(3) array \fIparams\fR. Parameters that the
  231. implementation doesn't recognise should be ignored.
  232. .SH "RETURN VALUES"
  233. .IX Header "RETURN VALUES"
  234. \&\fBOSSL_ENCODER_fetch()\fR returns a pointer to the key management
  235. implementation represented by an \s-1OSSL_ENCODER\s0 object, or \s-1NULL\s0 on
  236. error.
  237. .PP
  238. \&\fBOSSL_ENCODER_up_ref()\fR returns 1 on success, or 0 on error.
  239. .PP
  240. \&\fBOSSL_ENCODER_free()\fR doesn't return any value.
  241. .PP
  242. \&\fBOSSL_ENCODER_get0_provider()\fR returns a pointer to a provider object, or
  243. \&\s-1NULL\s0 on error.
  244. .PP
  245. \&\fBOSSL_ENCODER_get0_properties()\fR returns a pointer to a property
  246. definition string, or \s-1NULL\s0 on error.
  247. .PP
  248. \&\fBOSSL_ENCODER_is_a()\fR returns 1 of \fIencoder\fR was identifiable,
  249. otherwise 0.
  250. .PP
  251. \&\fBOSSL_ENCODER_get0_name()\fR returns the algorithm name from the provided
  252. implementation for the given \fIencoder\fR. Note that the \fIencoder\fR may have
  253. multiple synonyms associated with it. In this case the first name from the
  254. algorithm definition is returned. Ownership of the returned string is retained
  255. by the \fIencoder\fR object and should not be freed by the caller.
  256. .PP
  257. \&\fBOSSL_ENCODER_get0_description()\fR returns a pointer to a description, or \s-1NULL\s0 if
  258. there isn't one.
  259. .PP
  260. \&\fBOSSL_ENCODER_names_do_all()\fR returns 1 if the callback was called for all
  261. names. A return value of 0 means that the callback was not called for any names.
  262. .SH "SEE ALSO"
  263. .IX Header "SEE ALSO"
  264. \&\fBprovider\fR\|(7), \s-1\fBOSSL_ENCODER_CTX\s0\fR\|(3), \fBOSSL_ENCODER_to_bio\fR\|(3),
  265. \&\fBOSSL_ENCODER_CTX_new_for_pkey\fR\|(3), \s-1\fBOSSL_LIB_CTX\s0\fR\|(3)
  266. .SH "HISTORY"
  267. .IX Header "HISTORY"
  268. The functions described here were added in OpenSSL 3.0.
  269. .SH "COPYRIGHT"
  270. .IX Header "COPYRIGHT"
  271. Copyright 2019\-2024 The OpenSSL Project Authors. All Rights Reserved.
  272. .PP
  273. Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
  274. this file except in compliance with the License. You can obtain a copy
  275. in the file \s-1LICENSE\s0 in the source distribution or at
  276. <https://www.openssl.org/source/license.html>.