]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3
Import tzdata 2018f
[FreeBSD/FreeBSD.git] / secure / lib / libcrypto / man / OSSL_STORE_SEARCH.3
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
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 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "OSSL_STORE_SEARCH 3"
132 .TH OSSL_STORE_SEARCH 3 "2018-09-11" "1.1.1" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 OSSL_STORE_SEARCH, OSSL_STORE_SEARCH_by_name, OSSL_STORE_SEARCH_by_issuer_serial, OSSL_STORE_SEARCH_by_key_fingerprint, OSSL_STORE_SEARCH_by_alias, OSSL_STORE_SEARCH_free, OSSL_STORE_SEARCH_get_type, OSSL_STORE_SEARCH_get0_name, OSSL_STORE_SEARCH_get0_serial, OSSL_STORE_SEARCH_get0_bytes, OSSL_STORE_SEARCH_get0_string, OSSL_STORE_SEARCH_get0_digest \&\- Type and functions to create OSSL_STORE search criteria
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 .Vb 1
142 \& #include <openssl/store.h>
143 \&
144 \& typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
145 \&
146 \& OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name);
147 \& OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(X509_NAME *name,
148 \&                                                       const ASN1_INTEGER
149 \&                                                       *serial);
150 \& OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest,
151 \&                                                         const unsigned char
152 \&                                                         *bytes, int len);
153 \& OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_alias(const char *alias);
154 \&
155 \& void OSSL_STORE_SEARCH_free(OSSL_STORE_SEARCH *search);
156 \&
157 \& int OSSL_STORE_SEARCH_get_type(const OSSL_STORE_SEARCH *criterion);
158 \& X509_NAME *OSSL_STORE_SEARCH_get0_name(OSSL_STORE_SEARCH *criterion);
159 \& const ASN1_INTEGER *OSSL_STORE_SEARCH_get0_serial(const OSSL_STORE_SEARCH
160 \&                                                   *criterion);
161 \& const unsigned char *OSSL_STORE_SEARCH_get0_bytes(const OSSL_STORE_SEARCH
162 \&                                                   *criterion, size_t *length);
163 \& const char *OSSL_STORE_SEARCH_get0_string(const OSSL_STORE_SEARCH *criterion);
164 \& const EVP_MD *OSSL_STORE_SEARCH_get0_digest(const OSSL_STORE_SEARCH
165 \&                                             *criterion);
166 .Ve
167 .SH "DESCRIPTION"
168 .IX Header "DESCRIPTION"
169 These functions are used to specify search criteria to help search for specific
170 objects through other names than just the \s-1URI\s0 that's given to \fIOSSL_STORE_open()\fR.
171 For example, this can be useful for an application that has received a \s-1URI\s0
172 and then wants to add on search criteria in a uniform and supported manner.
173 .SS "Types"
174 .IX Subsection "Types"
175 \&\fB\s-1OSSL_STORE_SEARCH\s0\fR is an opaque type that holds the constructed search
176 criterion, and that can be given to an \s-1OSSL_STORE\s0 context with
177 \&\fIOSSL_STORE_find()\fR.
178 .PP
179 The calling application owns the allocation of an \fB\s-1OSSL_STORE_SEARCH\s0\fR at all
180 times, and should therefore be careful not to deallocate it before
181 \&\fIOSSL_STORE_close()\fR has been called for the \s-1OSSL_STORE\s0 context it was given
182 to.
183 .SS "Application Functions"
184 .IX Subsection "Application Functions"
185 \&\fIOSSL_STORE_SEARCH_by_name()\fR,
186 \&\fIOSSL_STORE_SEARCH_by_issuer_serial()\fR,
187 \&\fIOSSL_STORE_SEARCH_by_key_fingerprint()\fR,
188 and \fIOSSL_STORE_SEARCH_by_alias()\fR
189 are used to create an \fB\s-1OSSL_STORE_SEARCH\s0\fR from a subject name, an issuer name
190 and serial number pair, a key fingerprint, and an alias (for example a friendly
191 name).
192 The parameters that are provided are not copied, only referred to in a
193 criterion, so they must have at least the same life time as the created
194 \&\fB\s-1OSSL_STORE_SEARCH\s0\fR.
195 .PP
196 \&\fIOSSL_STORE_SEARCH_free()\fR is used to free the \fB\s-1OSSL_STORE_SEARCH\s0\fR.
197 .SS "Loader Functions"
198 .IX Subsection "Loader Functions"
199 \&\fIOSSL_STORE_SEARCH_get_type()\fR returns the criterion type for the given
200 \&\fB\s-1OSSL_STORE_SEARCH\s0\fR.
201 .PP
202 \&\fIOSSL_STORE_SEARCH_get0_name()\fR, \fIOSSL_STORE_SEARCH_get0_serial()\fR,
203 \&\fIOSSL_STORE_SEARCH_get0_bytes()\fR, \fIOSSL_STORE_SEARCH_get0_string()\fR,
204 and \fIOSSL_STORE_SEARCH_get0_digest()\fR
205 are used to retrieve different data from a \fB\s-1OSSL_STORE_SEARCH\s0\fR, as
206 available for each type.
207 For more information, see \*(L"\s-1SUPPORTED CRITERION TYPES\*(R"\s0 below.
208 .SH "SUPPORTED CRITERION TYPES"
209 .IX Header "SUPPORTED CRITERION TYPES"
210 Currently supported criterion types are:
211 .IP "\s-1OSSL_STORE_SEARCH_BY_NAME\s0" 4
212 .IX Item "OSSL_STORE_SEARCH_BY_NAME"
213 This criterion supports a search by exact match of subject name.
214 The subject name itself is a \fBX509_NAME\fR pointer.
215 A criterion of this type is created with \fIOSSL_STORE_SEARCH_by_name()\fR,
216 and the actual subject name is retrieved with \fIOSSL_STORE_SEARCH_get0_name()\fR.
217 .IP "\s-1OSSL_STORE_SEARCH_BY_ISSUER_SERIAL\s0" 4
218 .IX Item "OSSL_STORE_SEARCH_BY_ISSUER_SERIAL"
219 This criterion supports a search by exact match of both issuer name and serial
220 number.
221 The issuer name itself is a \fBX509_NAME\fR pointer, and the serial number is
222 a \fB\s-1ASN1_INTEGER\s0\fR pointer.
223 A criterion of this type is created with \fIOSSL_STORE_SEARCH_by_issuer_serial()\fR
224 and the actual issuer name and serial number are retrieved with
225 \&\fIOSSL_STORE_SEARCH_get0_name()\fR and \fIOSSL_STORE_SEARCH_get0_serial()\fR.
226 .IP "\s-1OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT\s0" 4
227 .IX Item "OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT"
228 This criterion supports a search by exact match of key fingerprint.
229 The key fingerprint in itself is a string of bytes and its length, as
230 well as the algorithm that was used to compute the fingerprint.
231 The digest may be left unspecified (\s-1NULL\s0), and in that case, the
232 loader has to decide on a default digest and compare fingerprints
233 accordingly.
234 A criterion of this type is created with \fIOSSL_STORE_SEARCH_by_key_fingerprint()\fR
235 and the actual fingerprint and its length can be retrieved with
236 \&\fIOSSL_STORE_SEARCH_get0_bytes()\fR.
237 The digest can be retrieved with \fIOSSL_STORE_SEARCH_get0_digest()\fR.
238 .IP "\s-1OSSL_STORE_SEARCH_BY_ALIAS\s0" 4
239 .IX Item "OSSL_STORE_SEARCH_BY_ALIAS"
240 This criterion supports a search by match of an alias of some kind.
241 The alias in itself is a simple C string.
242 A criterion of this type is created with \fIOSSL_STORE_SEARCH_by_alias()\fR
243 and the actual alias is retrieved with \fIOSSL_STORE_SEARCH_get0_string()\fR.
244 .SH "RETURN VALUES"
245 .IX Header "RETURN VALUES"
246 \&\fIOSSL_STORE_SEARCH_by_name()\fR,
247 \&\fIOSSL_STORE_SEARCH_by_issuer_serial()\fR,
248 \&\fIOSSL_STORE_SEARCH_by_key_fingerprint()\fR,
249 and \fIOSSL_STORE_SEARCH_by_alias()\fR
250 return a \fB\s-1OSSL_STORE_SEARCH\s0\fR pointer on success, or \fB\s-1NULL\s0\fR on failure.
251 .PP
252 \&\fIOSSL_STORE_SEARCH_get_type()\fR returns the criterion type of the given
253 \&\fB\s-1OSSL_STORE_SEARCH\s0\fR.
254 There is no error value.
255 .PP
256 \&\fIOSSL_STORE_SEARCH_get0_name()\fR returns a \fBX509_NAME\fR pointer on success,
257 or \fB\s-1NULL\s0\fR when the given \fB\s-1OSSL_STORE_SEARCH\s0\fR was of a different type.
258 .PP
259 \&\fIOSSL_STORE_SEARCH_get0_serial()\fR returns a \fB\s-1ASN1_INTEGER\s0\fR pointer on success,
260 or \fB\s-1NULL\s0\fR when the given \fB\s-1OSSL_STORE_SEARCH\s0\fR was of a different type.
261 .PP
262 \&\fIOSSL_STORE_SEARCH_get0_bytes()\fR returns a \fBconst unsigned char\fR pointer and
263 sets \fB*length\fR to the strings length on success, or \fB\s-1NULL\s0\fR when the given
264 \&\fB\s-1OSSL_STORE_SEARCH\s0\fR was of a different type.
265 .PP
266 \&\fIOSSL_STORE_SEARCH_get0_string()\fR returns a \fBconst char\fR pointer on success,
267 or \fB\s-1NULL\s0\fR when the given \fB\s-1OSSL_STORE_SEARCH\s0\fR was of a different type.
268 .PP
269 \&\fIOSSL_STORE_SEARCH_get0_digest()\fR returns a \fBconst \s-1EVP_MD\s0\fR pointer.
270 \&\fB\s-1NULL\s0\fR is a valid value and means that the store loader default will
271 be used when applicable.
272 .SH "SEE ALSO"
273 .IX Header "SEE ALSO"
274 \&\fIossl_store\fR\|(7), \fIOSSL_STORE_supports_search\fR\|(3), \fIOSSL_STORE_find\fR\|(3)
275 .SH "HISTORY"
276 .IX Header "HISTORY"
277 \&\fB\s-1OSSL_STORE_SEARCH\s0\fR,
278 \&\fIOSSL_STORE_SEARCH_by_name()\fR,
279 \&\fIOSSL_STORE_SEARCH_by_issuer_serial()\fR,
280 \&\fIOSSL_STORE_SEARCH_by_key_fingerprint()\fR,
281 \&\fIOSSL_STORE_SEARCH_by_alias()\fR,
282 \&\fIOSSL_STORE_SEARCH_free()\fR,
283 \&\fIOSSL_STORE_SEARCH_get_type()\fR,
284 \&\fIOSSL_STORE_SEARCH_get0_name()\fR,
285 \&\fIOSSL_STORE_SEARCH_get0_serial()\fR,
286 \&\fIOSSL_STORE_SEARCH_get0_bytes()\fR,
287 and \fIOSSL_STORE_SEARCH_get0_string()\fR
288 were added to OpenSSL 1.1.1.
289 .SH "COPYRIGHT"
290 .IX Header "COPYRIGHT"
291 Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
292 .PP
293 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
294 this file except in compliance with the License.  You can obtain a copy
295 in the file \s-1LICENSE\s0 in the source distribution or at
296 <https://www.openssl.org/source/license.html>.