OSSL_STORE_INFO.3ossl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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_STORE_INFO 3ossl"
  136. .TH OSSL_STORE_INFO 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_STORE_INFO, OSSL_STORE_INFO_get_type, OSSL_STORE_INFO_get0_NAME,
  143. OSSL_STORE_INFO_get0_NAME_description,
  144. OSSL_STORE_INFO_get0_PARAMS, OSSL_STORE_INFO_get0_PUBKEY,
  145. OSSL_STORE_INFO_get0_PKEY, OSSL_STORE_INFO_get0_CERT, OSSL_STORE_INFO_get0_CRL,
  146. OSSL_STORE_INFO_get1_NAME, OSSL_STORE_INFO_get1_NAME_description,
  147. OSSL_STORE_INFO_get1_PARAMS, OSSL_STORE_INFO_get1_PUBKEY,
  148. OSSL_STORE_INFO_get1_PKEY, OSSL_STORE_INFO_get1_CERT, OSSL_STORE_INFO_get1_CRL,
  149. OSSL_STORE_INFO_type_string, OSSL_STORE_INFO_free,
  150. OSSL_STORE_INFO_new_NAME, OSSL_STORE_INFO_set0_NAME_description,
  151. OSSL_STORE_INFO_new_PARAMS, OSSL_STORE_INFO_new_PUBKEY,
  152. OSSL_STORE_INFO_new_PKEY, OSSL_STORE_INFO_new_CERT, OSSL_STORE_INFO_new_CRL,
  153. OSSL_STORE_INFO_new, OSSL_STORE_INFO_get0_data
  154. \&\- Functions to manipulate OSSL_STORE_INFO objects
  155. .SH "SYNOPSIS"
  156. .IX Header "SYNOPSIS"
  157. .Vb 1
  158. \& #include <openssl/store.h>
  159. \&
  160. \& typedef struct ossl_store_info_st OSSL_STORE_INFO;
  161. \&
  162. \& int OSSL_STORE_INFO_get_type(const OSSL_STORE_INFO *store_info);
  163. \& const char *OSSL_STORE_INFO_get0_NAME(const OSSL_STORE_INFO *store_info);
  164. \& char *OSSL_STORE_INFO_get1_NAME(const OSSL_STORE_INFO *store_info);
  165. \& const char *OSSL_STORE_INFO_get0_NAME_description(const OSSL_STORE_INFO
  166. \& *store_info);
  167. \& char *OSSL_STORE_INFO_get1_NAME_description(const OSSL_STORE_INFO *store_info);
  168. \& EVP_PKEY *OSSL_STORE_INFO_get0_PARAMS(const OSSL_STORE_INFO *store_info);
  169. \& EVP_PKEY *OSSL_STORE_INFO_get1_PARAMS(const OSSL_STORE_INFO *store_info);
  170. \& EVP_PKEY *OSSL_STORE_INFO_get0_PUBKEY(const OSSL_STORE_INFO *info);
  171. \& EVP_PKEY *OSSL_STORE_INFO_get1_PUBKEY(const OSSL_STORE_INFO *info);
  172. \& EVP_PKEY *OSSL_STORE_INFO_get0_PKEY(const OSSL_STORE_INFO *store_info);
  173. \& EVP_PKEY *OSSL_STORE_INFO_get1_PKEY(const OSSL_STORE_INFO *store_info);
  174. \& X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *store_info);
  175. \& X509 *OSSL_STORE_INFO_get1_CERT(const OSSL_STORE_INFO *store_info);
  176. \& X509_CRL *OSSL_STORE_INFO_get0_CRL(const OSSL_STORE_INFO *store_info);
  177. \& X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *store_info);
  178. \&
  179. \& const char *OSSL_STORE_INFO_type_string(int type);
  180. \&
  181. \& void OSSL_STORE_INFO_free(OSSL_STORE_INFO *store_info);
  182. \&
  183. \& OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name);
  184. \& int OSSL_STORE_INFO_set0_NAME_description(OSSL_STORE_INFO *info, char *desc);
  185. \& OSSL_STORE_INFO *OSSL_STORE_INFO_new_PARAMS(DSA *dsa_params);
  186. \& OSSL_STORE_INFO *OSSL_STORE_INFO_new_PUBKEY(EVP_PKEY *pubkey);
  187. \& OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey);
  188. \& OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509);
  189. \& OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl);
  190. \&
  191. \& OSSL_STORE_INFO *OSSL_STORE_INFO_new(int type, void *data);
  192. \& void *OSSL_STORE_INFO_get0_data(int type, const OSSL_STORE_INFO *info);
  193. .Ve
  194. .SH "DESCRIPTION"
  195. .IX Header "DESCRIPTION"
  196. These functions are primarily useful for applications to retrieve
  197. supported objects from \fB\s-1OSSL_STORE_INFO\s0\fR objects and for scheme specific
  198. loaders to create \fB\s-1OSSL_STORE_INFO\s0\fR holders.
  199. .SS "Types"
  200. .IX Subsection "Types"
  201. \&\fB\s-1OSSL_STORE_INFO\s0\fR is an opaque type that's just an intermediary holder for
  202. the objects that have been retrieved by \fBOSSL_STORE_load()\fR and similar functions.
  203. Supported OpenSSL type object can be extracted using one of
  204. STORE_INFO_get0_<\s-1TYPE\s0>() where <\s-1TYPE\s0> can be \s-1NAME, PARAMS, PKEY, CERT,\s0 or \s-1CRL.\s0
  205. The life time of this extracted object is as long as the life time of
  206. the \fB\s-1OSSL_STORE_INFO\s0\fR it was extracted from, so care should be taken not
  207. to free the latter too early.
  208. As an alternative, STORE_INFO_get1_<\s-1TYPE\s0>() extracts a duplicate (or the
  209. same object with its reference count increased), which can be used
  210. after the containing \fB\s-1OSSL_STORE_INFO\s0\fR has been freed.
  211. The object returned by STORE_INFO_get1_<\s-1TYPE\s0>() must be freed separately
  212. by the caller.
  213. See \*(L"\s-1SUPPORTED OBJECTS\*(R"\s0 for more information on the types that are supported.
  214. .SS "Functions"
  215. .IX Subsection "Functions"
  216. \&\fBOSSL_STORE_INFO_get_type()\fR takes a \fB\s-1OSSL_STORE_INFO\s0\fR and returns the \s-1STORE\s0
  217. type number for the object inside.
  218. .PP
  219. \&\fBSTORE_INFO_get_type_string()\fR takes a \s-1STORE\s0 type number and returns a
  220. short string describing it.
  221. .PP
  222. \&\fBOSSL_STORE_INFO_get0_NAME()\fR, \fBOSSL_STORE_INFO_get0_NAME_description()\fR,
  223. \&\fBOSSL_STORE_INFO_get0_PARAMS()\fR, \fBOSSL_STORE_INFO_get0_PUBKEY()\fR,
  224. \&\fBOSSL_STORE_INFO_get0_PKEY()\fR, \fBOSSL_STORE_INFO_get0_CERT()\fR,
  225. \&\fBOSSL_STORE_INFO_get0_CRL()\fR
  226. all take a \fB\s-1OSSL_STORE_INFO\s0\fR and return the object it holds if the
  227. \&\fB\s-1OSSL_STORE_INFO\s0\fR type (as returned by \fBOSSL_STORE_INFO_get_type()\fR)
  228. matches the function, otherwise \s-1NULL.\s0
  229. .PP
  230. \&\fBOSSL_STORE_INFO_get1_NAME()\fR, \fBOSSL_STORE_INFO_get1_NAME_description()\fR,
  231. \&\fBOSSL_STORE_INFO_get1_PARAMS()\fR, \fBOSSL_STORE_INFO_get1_PUBKEY()\fR,
  232. \&\fBOSSL_STORE_INFO_get1_PKEY()\fR, \fBOSSL_STORE_INFO_get1_CERT()\fR and
  233. \&\fBOSSL_STORE_INFO_get1_CRL()\fR
  234. all take a \fB\s-1OSSL_STORE_INFO\s0\fR and return a duplicate the object it
  235. holds if the \fB\s-1OSSL_STORE_INFO\s0\fR type (as returned by
  236. \&\fBOSSL_STORE_INFO_get_type()\fR) matches the function, otherwise \s-1NULL.\s0
  237. .PP
  238. \&\fBOSSL_STORE_INFO_free()\fR frees a \fB\s-1OSSL_STORE_INFO\s0\fR and its contained type.
  239. If the argument is \s-1NULL,\s0 nothing is done.
  240. .PP
  241. \&\fBOSSL_STORE_INFO_new_NAME()\fR , \fBOSSL_STORE_INFO_new_PARAMS()\fR,
  242. , \fBOSSL_STORE_INFO_new_PUBKEY()\fR, \fBOSSL_STORE_INFO_new_PKEY()\fR,
  243. \&\fBOSSL_STORE_INFO_new_CERT()\fR and \fBOSSL_STORE_INFO_new_CRL()\fR
  244. create a \fB\s-1OSSL_STORE_INFO\s0\fR object to hold the given input object.
  245. On success the input object is consumed.
  246. .PP
  247. Additionally, for \fB\s-1OSSL_STORE_INFO_NAME\s0\fR objects,
  248. \&\fBOSSL_STORE_INFO_set0_NAME_description()\fR can be used to add an extra
  249. description.
  250. This description is meant to be human readable and should be used for
  251. information printout.
  252. .PP
  253. \&\fBOSSL_STORE_INFO_new()\fR creates a \fB\s-1OSSL_STORE_INFO\s0\fR with an arbitrary \fItype\fR
  254. number and \fIdata\fR structure. It's the responsibility of the caller to
  255. define type numbers other than the ones defined by \fI<openssl/store.h>\fR,
  256. and to handle freeing the associated data structure on their own.
  257. \&\fIUsing type numbers that are defined by \fI<openssl/store.h>\fI may cause
  258. undefined behaviours, including crashes\fR.
  259. .PP
  260. \&\fBOSSL_STORE_INFO_get0_data()\fR returns the data pointer that was passed to
  261. \&\fBOSSL_STORE_INFO_new()\fR if \fItype\fR matches the type number in \fIinfo\fR.
  262. .PP
  263. \&\fBOSSL_STORE_INFO_new()\fR and \fBOSSL_STORE_INFO_get0_data()\fR may be useful for
  264. applications that define their own \s-1STORE\s0 data, but must be used with care.
  265. .SH "SUPPORTED OBJECTS"
  266. .IX Header "SUPPORTED OBJECTS"
  267. Currently supported object types are:
  268. .IP "\s-1OSSL_STORE_INFO_NAME\s0" 4
  269. .IX Item "OSSL_STORE_INFO_NAME"
  270. A name is exactly that, a name.
  271. It's like a name in a directory, but formatted as a complete \s-1URI.\s0
  272. For example, the path in \s-1URI\s0 \f(CW\*(C`file:/foo/bar/\*(C'\fR could include a file
  273. named \f(CW\*(C`cookie.pem\*(C'\fR, and in that case, the returned \fB\s-1OSSL_STORE_INFO_NAME\s0\fR
  274. object would have the \s-1URI\s0 \f(CW\*(C`file:/foo/bar/cookie.pem\*(C'\fR, which can be
  275. used by the application to get the objects in that file.
  276. This can be applied to all schemes that can somehow support a listing
  277. of object URIs.
  278. .Sp
  279. For \f(CW\*(C`file:\*(C'\fR URIs that are used without the explicit scheme, the
  280. returned name will be the path of each object, so if \f(CW\*(C`/foo/bar\*(C'\fR was
  281. given and that path has the file \f(CW\*(C`cookie.pem\*(C'\fR, the name
  282. \&\f(CW\*(C`/foo/bar/cookie.pem\*(C'\fR will be returned.
  283. .Sp
  284. The returned \s-1URI\s0 is considered canonical and must be unique and permanent
  285. for the storage where the object (or collection of objects) resides.
  286. Each loader is responsible for ensuring that it only returns canonical
  287. URIs.
  288. However, it's possible that certain schemes allow an object (or collection
  289. thereof) to be reached with alternative URIs; just because one \s-1URI\s0 is
  290. canonical doesn't mean that other variants can't be used.
  291. .Sp
  292. At the discretion of the loader that was used to get these names, an
  293. extra description may be attached as well.
  294. .IP "\s-1OSSL_STORE_INFO_PARAMS\s0" 4
  295. .IX Item "OSSL_STORE_INFO_PARAMS"
  296. Key parameters.
  297. .IP "\s-1OSSL_STORE_INFO_PKEY\s0" 4
  298. .IX Item "OSSL_STORE_INFO_PKEY"
  299. A keypair or just a private key (possibly with key parameters).
  300. .IP "\s-1OSSL_STORE_INFO_PUBKEY\s0" 4
  301. .IX Item "OSSL_STORE_INFO_PUBKEY"
  302. A public key (possibly with key parameters).
  303. .IP "\s-1OSSL_STORE_INFO_CERT\s0" 4
  304. .IX Item "OSSL_STORE_INFO_CERT"
  305. An X.509 certificate.
  306. .IP "\s-1OSSL_STORE_INFO_CRL\s0" 4
  307. .IX Item "OSSL_STORE_INFO_CRL"
  308. A X.509 certificate revocation list.
  309. .SH "RETURN VALUES"
  310. .IX Header "RETURN VALUES"
  311. \&\fBOSSL_STORE_INFO_get_type()\fR returns the \s-1STORE\s0 type number of the given
  312. \&\fB\s-1OSSL_STORE_INFO\s0\fR.
  313. There is no error value.
  314. .PP
  315. \&\fBOSSL_STORE_INFO_get0_NAME()\fR, \fBOSSL_STORE_INFO_get0_NAME_description()\fR,
  316. \&\fBOSSL_STORE_INFO_get0_PARAMS()\fR, \fBOSSL_STORE_INFO_get0_PKEY()\fR,
  317. \&\fBOSSL_STORE_INFO_get0_CERT()\fR and \fBOSSL_STORE_INFO_get0_CRL()\fR all return
  318. a pointer to the OpenSSL object on success, \s-1NULL\s0 otherwise.
  319. .PP
  320. \&\fBOSSL_STORE_INFO_get1_NAME()\fR, \fBOSSL_STORE_INFO_get1_NAME_description()\fR,
  321. \&\fBOSSL_STORE_INFO_get1_PARAMS()\fR, \fBOSSL_STORE_INFO_get1_PKEY()\fR,
  322. \&\fBOSSL_STORE_INFO_get1_CERT()\fR and \fBOSSL_STORE_INFO_get1_CRL()\fR all return
  323. a pointer to a duplicate of the OpenSSL object on success, \s-1NULL\s0 otherwise.
  324. .PP
  325. \&\fBOSSL_STORE_INFO_type_string()\fR returns a string on success, or \s-1NULL\s0 on
  326. failure.
  327. .PP
  328. \&\fBOSSL_STORE_INFO_new_NAME()\fR, \fBOSSL_STORE_INFO_new_PARAMS()\fR,
  329. \&\fBOSSL_STORE_INFO_new_PKEY()\fR, \fBOSSL_STORE_INFO_new_CERT()\fR and
  330. \&\fBOSSL_STORE_INFO_new_CRL()\fR return a \fB\s-1OSSL_STORE_INFO\s0\fR
  331. pointer on success, or \s-1NULL\s0 on failure.
  332. .PP
  333. \&\fBOSSL_STORE_INFO_set0_NAME_description()\fR returns 1 on success, or 0 on
  334. failure.
  335. .SH "SEE ALSO"
  336. .IX Header "SEE ALSO"
  337. \&\fBossl_store\fR\|(7), \fBOSSL_STORE_open\fR\|(3), \fBOSSL_STORE_register_loader\fR\|(3)
  338. .SH "HISTORY"
  339. .IX Header "HISTORY"
  340. The \s-1OSSL_STORE API\s0 was added in OpenSSL 1.1.1.
  341. .PP
  342. The \s-1OSSL_STORE_INFO_PUBKEY\s0 object type was added in OpenSSL 3.0.
  343. .SH "COPYRIGHT"
  344. .IX Header "COPYRIGHT"
  345. Copyright 2016\-2024 The OpenSSL Project Authors. All Rights Reserved.
  346. .PP
  347. Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
  348. this file except in compliance with the License. You can obtain a copy
  349. in the file \s-1LICENSE\s0 in the source distribution or at
  350. <https://www.openssl.org/source/license.html>.