summaryrefslogtreecommitdiffstats
path: root/upstream/debian-bookworm/man3/OSSL_STORE_INFO.3ssl
blob: a7180761f3db6a94642231c7ee0ce97f070aa8ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "OSSL_STORE_INFO 3SSL"
.TH OSSL_STORE_INFO 3SSL "2023-10-23" "3.0.11" "OpenSSL"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
OSSL_STORE_INFO, OSSL_STORE_INFO_get_type, OSSL_STORE_INFO_get0_NAME,
OSSL_STORE_INFO_get0_NAME_description,
OSSL_STORE_INFO_get0_PARAMS, OSSL_STORE_INFO_get0_PUBKEY,
OSSL_STORE_INFO_get0_PKEY, OSSL_STORE_INFO_get0_CERT, OSSL_STORE_INFO_get0_CRL,
OSSL_STORE_INFO_get1_NAME, OSSL_STORE_INFO_get1_NAME_description,
OSSL_STORE_INFO_get1_PARAMS, OSSL_STORE_INFO_get1_PUBKEY,
OSSL_STORE_INFO_get1_PKEY, OSSL_STORE_INFO_get1_CERT, OSSL_STORE_INFO_get1_CRL,
OSSL_STORE_INFO_type_string, OSSL_STORE_INFO_free,
OSSL_STORE_INFO_new_NAME, OSSL_STORE_INFO_set0_NAME_description,
OSSL_STORE_INFO_new_PARAMS, OSSL_STORE_INFO_new_PUBKEY,
OSSL_STORE_INFO_new_PKEY, OSSL_STORE_INFO_new_CERT, OSSL_STORE_INFO_new_CRL,
OSSL_STORE_INFO_new, OSSL_STORE_INFO_get0_data
\&\- Functions to manipulate OSSL_STORE_INFO objects
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& #include <openssl/store.h>
\&
\& typedef struct ossl_store_info_st OSSL_STORE_INFO;
\&
\& int OSSL_STORE_INFO_get_type(const OSSL_STORE_INFO *store_info);
\& const char *OSSL_STORE_INFO_get0_NAME(const OSSL_STORE_INFO *store_info);
\& char *OSSL_STORE_INFO_get1_NAME(const OSSL_STORE_INFO *store_info);
\& const char *OSSL_STORE_INFO_get0_NAME_description(const OSSL_STORE_INFO
\&                                                   *store_info);
\& char *OSSL_STORE_INFO_get1_NAME_description(const OSSL_STORE_INFO *store_info);
\& EVP_PKEY *OSSL_STORE_INFO_get0_PARAMS(const OSSL_STORE_INFO *store_info);
\& EVP_PKEY *OSSL_STORE_INFO_get1_PARAMS(const OSSL_STORE_INFO *store_info);
\& EVP_PKEY *OSSL_STORE_INFO_get0_PUBKEY(const OSSL_STORE_INFO *info);
\& EVP_PKEY *OSSL_STORE_INFO_get1_PUBKEY(const OSSL_STORE_INFO *info);
\& EVP_PKEY *OSSL_STORE_INFO_get0_PKEY(const OSSL_STORE_INFO *store_info);
\& EVP_PKEY *OSSL_STORE_INFO_get1_PKEY(const OSSL_STORE_INFO *store_info);
\& X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *store_info);
\& X509 *OSSL_STORE_INFO_get1_CERT(const OSSL_STORE_INFO *store_info);
\& X509_CRL *OSSL_STORE_INFO_get0_CRL(const OSSL_STORE_INFO *store_info);
\& X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *store_info);
\&
\& const char *OSSL_STORE_INFO_type_string(int type);
\&
\& void OSSL_STORE_INFO_free(OSSL_STORE_INFO *store_info);
\&
\& OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name);
\& int OSSL_STORE_INFO_set0_NAME_description(OSSL_STORE_INFO *info, char *desc);
\& OSSL_STORE_INFO *OSSL_STORE_INFO_new_PARAMS(DSA *dsa_params);
\& OSSL_STORE_INFO *OSSL_STORE_INFO_new_PUBKEY(EVP_PKEY *pubkey);
\& OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey);
\& OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509);
\& OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl);
\&
\& OSSL_STORE_INFO *OSSL_STORE_INFO_new(int type, void *data);
\& void *OSSL_STORE_INFO_get0_data(int type, const OSSL_STORE_INFO *info);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
These functions are primarily useful for applications to retrieve
supported objects from \fB\s-1OSSL_STORE_INFO\s0\fR objects and for scheme specific
loaders to create \fB\s-1OSSL_STORE_INFO\s0\fR holders.
.SS "Types"
.IX Subsection "Types"
\&\fB\s-1OSSL_STORE_INFO\s0\fR is an opaque type that's just an intermediary holder for
the objects that have been retrieved by \fBOSSL_STORE_load()\fR and similar functions.
Supported OpenSSL type object can be extracted using one of
STORE_INFO_get0_<\s-1TYPE\s0>() where <\s-1TYPE\s0> can be \s-1NAME, PARAMS, PKEY, CERT,\s0 or \s-1CRL.\s0
The life time of this extracted object is as long as the life time of
the \fB\s-1OSSL_STORE_INFO\s0\fR it was extracted from, so care should be taken not
to free the latter too early.
As an alternative, STORE_INFO_get1_<\s-1TYPE\s0>() extracts a duplicate (or the
same object with its reference count increased), which can be used
after the containing \fB\s-1OSSL_STORE_INFO\s0\fR has been freed.
The object returned by STORE_INFO_get1_<\s-1TYPE\s0>() must be freed separately
by the caller.
See \*(L"\s-1SUPPORTED OBJECTS\*(R"\s0 for more information on the types that are supported.
.SS "Functions"
.IX Subsection "Functions"
\&\fBOSSL_STORE_INFO_get_type()\fR takes a \fB\s-1OSSL_STORE_INFO\s0\fR and returns the \s-1STORE\s0
type number for the object inside.
.PP
\&\fBSTORE_INFO_get_type_string()\fR takes a \s-1STORE\s0 type number and returns a
short string describing it.
.PP
\&\fBOSSL_STORE_INFO_get0_NAME()\fR, \fBOSSL_STORE_INFO_get0_NAME_description()\fR,
\&\fBOSSL_STORE_INFO_get0_PARAMS()\fR, \fBOSSL_STORE_INFO_get0_PUBKEY()\fR,
\&\fBOSSL_STORE_INFO_get0_PKEY()\fR, \fBOSSL_STORE_INFO_get0_CERT()\fR,
\&\fBOSSL_STORE_INFO_get0_CRL()\fR
all take a \fB\s-1OSSL_STORE_INFO\s0\fR and return the object it holds if the
\&\fB\s-1OSSL_STORE_INFO\s0\fR type (as returned by \fBOSSL_STORE_INFO_get_type()\fR)
matches the function, otherwise \s-1NULL.\s0
.PP
\&\fBOSSL_STORE_INFO_get1_NAME()\fR, \fBOSSL_STORE_INFO_get1_NAME_description()\fR,
\&\fBOSSL_STORE_INFO_get1_PARAMS()\fR, \fBOSSL_STORE_INFO_get1_PUBKEY()\fR,
\&\fBOSSL_STORE_INFO_get1_PKEY()\fR, \fBOSSL_STORE_INFO_get1_CERT()\fR and
\&\fBOSSL_STORE_INFO_get1_CRL()\fR
all take a \fB\s-1OSSL_STORE_INFO\s0\fR and return a duplicate the object it
holds if the \fB\s-1OSSL_STORE_INFO\s0\fR type (as returned by
\&\fBOSSL_STORE_INFO_get_type()\fR) matches the function, otherwise \s-1NULL.\s0
.PP
\&\fBOSSL_STORE_INFO_free()\fR frees a \fB\s-1OSSL_STORE_INFO\s0\fR and its contained type.
.PP
\&\fBOSSL_STORE_INFO_new_NAME()\fR , \fBOSSL_STORE_INFO_new_PARAMS()\fR,
, \fBOSSL_STORE_INFO_new_PUBKEY()\fR, \fBOSSL_STORE_INFO_new_PKEY()\fR,
\&\fBOSSL_STORE_INFO_new_CERT()\fR and \fBOSSL_STORE_INFO_new_CRL()\fR
create a \fB\s-1OSSL_STORE_INFO\s0\fR object to hold the given input object.
On success the input object is consumed.
.PP
Additionally, for \fB\s-1OSSL_STORE_INFO_NAME\s0\fR objects,
\&\fBOSSL_STORE_INFO_set0_NAME_description()\fR can be used to add an extra
description.
This description is meant to be human readable and should be used for
information printout.
.PP
\&\fBOSSL_STORE_INFO_new()\fR creates a \fB\s-1OSSL_STORE_INFO\s0\fR with an arbitrary \fItype\fR
number and \fIdata\fR structure.  It's the responsibility of the caller to
define type numbers other than the ones defined by \fI<openssl/store.h>\fR,
and to handle freeing the associated data structure on their own.
\&\fIUsing type numbers that are defined by \fI<openssl/store.h>\fI may cause
undefined behaviours, including crashes\fR.
.PP
\&\fBOSSL_STORE_INFO_get0_data()\fR returns the data pointer that was passed to
\&\fBOSSL_STORE_INFO_new()\fR if \fItype\fR matches the type number in \fIinfo\fR.
.PP
\&\fBOSSL_STORE_INFO_new()\fR and \fBOSSL_STORE_INFO_get0_data()\fR may be useful for
applications that define their own \s-1STORE\s0 data, but must be used with care.
.SH "SUPPORTED OBJECTS"
.IX Header "SUPPORTED OBJECTS"
Currently supported object types are:
.IP "\s-1OSSL_STORE_INFO_NAME\s0" 4
.IX Item "OSSL_STORE_INFO_NAME"
A name is exactly that, a name.
It's like a name in a directory, but formatted as a complete \s-1URI.\s0
For example, the path in \s-1URI\s0 \f(CW\*(C`file:/foo/bar/\*(C'\fR could include a file
named \f(CW\*(C`cookie.pem\*(C'\fR, and in that case, the returned \fB\s-1OSSL_STORE_INFO_NAME\s0\fR
object would have the \s-1URI\s0 \f(CW\*(C`file:/foo/bar/cookie.pem\*(C'\fR, which can be
used by the application to get the objects in that file.
This can be applied to all schemes that can somehow support a listing
of object URIs.
.Sp
For \f(CW\*(C`file:\*(C'\fR URIs that are used without the explicit scheme, the
returned name will be the path of each object, so if \f(CW\*(C`/foo/bar\*(C'\fR was
given and that path has the file \f(CW\*(C`cookie.pem\*(C'\fR, the name
\&\f(CW\*(C`/foo/bar/cookie.pem\*(C'\fR will be returned.
.Sp
The returned \s-1URI\s0 is considered canonical and must be unique and permanent
for the storage where the object (or collection of objects) resides.
Each loader is responsible for ensuring that it only returns canonical
URIs.
However, it's possible that certain schemes allow an object (or collection
thereof) to be reached with alternative URIs; just because one \s-1URI\s0 is
canonical doesn't mean that other variants can't be used.
.Sp
At the discretion of the loader that was used to get these names, an
extra description may be attached as well.
.IP "\s-1OSSL_STORE_INFO_PARAMS\s0" 4
.IX Item "OSSL_STORE_INFO_PARAMS"
Key parameters.
.IP "\s-1OSSL_STORE_INFO_PKEY\s0" 4
.IX Item "OSSL_STORE_INFO_PKEY"
A keypair or just a private key (possibly with key parameters).
.IP "\s-1OSSL_STORE_INFO_PUBKEY\s0" 4
.IX Item "OSSL_STORE_INFO_PUBKEY"
A public key (possibly with key parameters).
.IP "\s-1OSSL_STORE_INFO_CERT\s0" 4
.IX Item "OSSL_STORE_INFO_CERT"
An X.509 certificate.
.IP "\s-1OSSL_STORE_INFO_CRL\s0" 4
.IX Item "OSSL_STORE_INFO_CRL"
A X.509 certificate revocation list.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
\&\fBOSSL_STORE_INFO_get_type()\fR returns the \s-1STORE\s0 type number of the given
\&\fB\s-1OSSL_STORE_INFO\s0\fR.
There is no error value.
.PP
\&\fBOSSL_STORE_INFO_get0_NAME()\fR, \fBOSSL_STORE_INFO_get0_NAME_description()\fR,
\&\fBOSSL_STORE_INFO_get0_PARAMS()\fR, \fBOSSL_STORE_INFO_get0_PKEY()\fR,
\&\fBOSSL_STORE_INFO_get0_CERT()\fR and \fBOSSL_STORE_INFO_get0_CRL()\fR all return
a pointer to the OpenSSL object on success, \s-1NULL\s0 otherwise.
.PP
\&\fBOSSL_STORE_INFO_get1_NAME()\fR, \fBOSSL_STORE_INFO_get1_NAME_description()\fR,
\&\fBOSSL_STORE_INFO_get1_PARAMS()\fR, \fBOSSL_STORE_INFO_get1_PKEY()\fR,
\&\fBOSSL_STORE_INFO_get1_CERT()\fR and \fBOSSL_STORE_INFO_get1_CRL()\fR all return
a pointer to a duplicate of the OpenSSL object on success, \s-1NULL\s0 otherwise.
.PP
\&\fBOSSL_STORE_INFO_type_string()\fR returns a string on success, or \s-1NULL\s0 on
failure.
.PP
\&\fBOSSL_STORE_INFO_new_NAME()\fR, \fBOSSL_STORE_INFO_new_PARAMS()\fR,
\&\fBOSSL_STORE_INFO_new_PKEY()\fR, \fBOSSL_STORE_INFO_new_CERT()\fR and
\&\fBOSSL_STORE_INFO_new_CRL()\fR return a \fB\s-1OSSL_STORE_INFO\s0\fR
pointer on success, or \s-1NULL\s0 on failure.
.PP
\&\fBOSSL_STORE_INFO_set0_NAME_description()\fR returns 1 on success, or 0 on
failure.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBossl_store\fR\|(7), \fBOSSL_STORE_open\fR\|(3), \fBOSSL_STORE_register_loader\fR\|(3)
.SH "HISTORY"
.IX Header "HISTORY"
The \s-1OSSL_STORE API\s0 was added in OpenSSL 1.1.1.
.PP
The \s-1OSSL_STORE_INFO_PUBKEY\s0 object type was added in OpenSSL 3.0.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright 2016\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the Apache License 2.0 (the \*(L"License\*(R").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file \s-1LICENSE\s0 in the source distribution or at
<https://www.openssl.org/source/license.html>.