1 .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
9 .de Vb \" Begin verbatim text
14 .de Ve \" End verbatim text
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<>.
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
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
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
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.
54 .\" Avoid warning from groff about undefined register 'F'.
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{\
62 . tm Index:\\$1\t\\n%\t"\\$2"
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
83 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
89 . \" simple accents for nroff and troff
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'
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 \
133 .\" ========================================================================
135 .IX Title "X509_LOOKUP 3"
136 .TH X509_LOOKUP 3 "2020-09-22" "1.1.1h" "OpenSSL"
137 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
142 X509_LOOKUP, X509_LOOKUP_TYPE, X509_LOOKUP_new, X509_LOOKUP_free, X509_LOOKUP_init, X509_LOOKUP_shutdown, X509_LOOKUP_set_method_data, X509_LOOKUP_get_method_data, X509_LOOKUP_ctrl, X509_LOOKUP_load_file, X509_LOOKUP_add_dir, X509_LOOKUP_get_store, X509_LOOKUP_by_subject, X509_LOOKUP_by_issuer_serial, X509_LOOKUP_by_fingerprint, X509_LOOKUP_by_alias \&\- OpenSSL certificate lookup mechanisms
144 .IX Header "SYNOPSIS"
146 \& #include <openssl/x509_vfy.h>
148 \& typedef x509_lookup_st X509_LOOKUP;
150 \& typedef enum X509_LOOKUP_TYPE;
152 \& X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
153 \& int X509_LOOKUP_init(X509_LOOKUP *ctx);
154 \& int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
155 \& void X509_LOOKUP_free(X509_LOOKUP *ctx);
157 \& int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data);
158 \& void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
160 \& int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
161 \& long argl, char **ret);
162 \& int X509_LOOKUP_load_file(X509_LOOKUP *ctx, char *name, long type);
163 \& int X509_LOOKUP_add_dir(X509_LOOKUP *ctx, char *name, long type);
165 \& X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx);
167 \& int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
168 \& X509_NAME *name, X509_OBJECT *ret);
169 \& int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
170 \& X509_NAME *name, ASN1_INTEGER *serial,
171 \& X509_OBJECT *ret);
172 \& int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
173 \& const unsigned char *bytes, int len,
174 \& X509_OBJECT *ret);
175 \& int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
176 \& const char *str, int len, X509_OBJECT *ret);
179 .IX Header "DESCRIPTION"
180 The \fBX509_LOOKUP\fR structure holds the information needed to look up
181 certificates and CRLs according to an associated \fBX509_LOOKUP_METHOD\fR\|(3).
182 Multiple \fBX509_LOOKUP\fR instances can be added to an \fBX509_STORE\fR\|(3)
183 to enable lookup in that store.
185 \&\fBX509_LOOKUP_new()\fR creates a new \fBX509_LOOKUP\fR using the given lookup
187 It can also be created by calling \fBX509_STORE_add_lookup\fR\|(3), which
188 will associate an \fBX509_STORE\fR with the lookup mechanism.
190 \&\fBX509_LOOKUP_init()\fR initializes the internal state and resources as
191 needed by the given \fBX509_LOOKUP\fR to do its work.
193 \&\fBX509_LOOKUP_shutdown()\fR tears down the internal state and resources of
194 the given \fBX509_LOOKUP\fR.
196 \&\fBX509_LOOKUP_free()\fR destructs the given \fBX509_LOOKUP\fR.
198 \&\fBX509_LOOKUP_set_method_data()\fR associates a pointer to application data
199 to the given \fBX509_LOOKUP\fR.
201 \&\fBX509_LOOKUP_get_method_data()\fR retrieves a pointer to application data
202 from the given \fBX509_LOOKUP\fR.
204 \&\fBX509_LOOKUP_ctrl()\fR is used to set or get additional data to or from an
205 \&\fBX509_LOOKUP\fR structure or its associated \fBX509_LOOKUP_METHOD\fR\|(3).
206 The arguments of the control command are passed via \fIargc\fR and \fIargl\fR,
207 its return value via \fI*ret\fR.
208 The meaning of the arguments depends on the \fIcmd\fR number of the
209 control command. In general, this function is not called directly, but
210 wrapped by a macro call, see below.
211 The control \fIcmd\fRs known to OpenSSL are discussed in more depth
212 in \*(L"Control Commands\*(R".
214 \&\fBX509_LOOKUP_load_file()\fR passes a filename to be loaded immediately
215 into the associated \fBX509_STORE\fR.
216 \&\fItype\fR indicates what type of object is expected.
217 This can only be used with a lookup using the implementation
218 \&\fBX509_LOOKUP_file\fR\|(3).
220 \&\fBX509_LOOKUP_add_dir()\fR passes a directory specification from which
221 certificates and CRLs are loaded on demand into the associated
223 \&\fItype\fR indicates what type of object is expected.
224 This can only be used with a lookup using the implementation
225 \&\fBX509_LOOKUP_hash_dir\fR\|(3).
227 \&\fBX509_LOOKUP_load_file()\fR, \fBX509_LOOKUP_add_dir()\fR,
228 \&\fBX509_LOOKUP_add_store()\fR, and \fBX509_LOOKUP_load_store()\fR are implemented
229 as macros that use \fBX509_LOOKUP_ctrl()\fR.
231 \&\fBX509_LOOKUP_by_subject()\fR, \fBX509_LOOKUP_by_issuer_serial()\fR,
232 \&\fBX509_LOOKUP_by_fingerprint()\fR, and \fBX509_LOOKUP_by_alias()\fR look up
233 certificates and CRLs in the \fBX509_STORE\fR\|(3) associated with the
234 \&\fBX509_LOOKUP\fR using different criteria, where the looked up object is
236 Some of the underlying \fBX509_LOOKUP_METHOD\fRs will also cache objects
237 matching the criteria in the associated \fBX509_STORE\fR, which makes it
238 possible to handle cases where the criteria have more than one hit.
240 .IX Subsection "File Types"
241 \&\fBX509_LOOKUP_load_file()\fR and \fBX509_LOOKUP_add_dir()\fR take a \fItype\fR,
242 which can be one of the following:
243 .IP "\fBX509_FILETYPE_PEM\fR" 4
244 .IX Item "X509_FILETYPE_PEM"
245 The file or files that are loaded are expected to be in \s-1PEM\s0 format.
246 .IP "\fBX509_FILETYPE_ASN1\fR" 4
247 .IX Item "X509_FILETYPE_ASN1"
248 The file or files that are loaded are expected to be in raw \s-1DER\s0 format.
249 .IP "\fBX509_FILETYPE_DEFAULT\fR" 4
250 .IX Item "X509_FILETYPE_DEFAULT"
251 The default certificate file or directory is used. In this case,
252 \&\fIname\fR is ignored.
253 .SS "Control Commands"
254 .IX Subsection "Control Commands"
255 The \fBX509_LOOKUP_METHOD\fRs built into OpenSSL recognise the following
256 \&\fBX509_LOOKUP_ctrl()\fR \fIcmd\fRs:
257 .IP "\fBX509_L_FILE_LOAD\fR" 4
258 .IX Item "X509_L_FILE_LOAD"
259 This is the command that \fBX509_LOOKUP_load_file()\fR uses.
260 The filename is passed in \fIargc\fR, and the type in \fIargl\fR.
261 .IP "\fBX509_L_ADD_DIR\fR" 4
262 .IX Item "X509_L_ADD_DIR"
263 This is the command that \fBX509_LOOKUP_add_dir()\fR uses.
264 The directory specification is passed in \fIargc\fR, and the type in
266 .IP "\fBX509_L_ADD_STORE\fR" 4
267 .IX Item "X509_L_ADD_STORE"
268 This is the command that \fBX509_LOOKUP_add_store()\fR uses.
269 The \s-1URI\s0 is passed in \fIargc\fR.
270 .IP "\fBX509_L_LOAD_STORE\fR" 4
271 .IX Item "X509_L_LOAD_STORE"
272 This is the command that \fBX509_LOOKUP_load_store()\fR uses.
273 The \s-1URI\s0 is passed in \fIargc\fR.
275 .IX Header "RETURN VALUES"
276 \&\fBX509_LOOKUP_new()\fR returns an \fBX509_LOOKUP\fR pointer when successful,
277 or \s-1NULL\s0 on error.
279 \&\fBX509_LOOKUP_init()\fR and \fBX509_LOOKUP_shutdown()\fR return 1 on success, or
282 \&\fBX509_LOOKUP_ctrl()\fR returns \-1 if the \fBX509_LOOKUP\fR doesn't have an
283 associated \fBX509_LOOKUP_METHOD\fR, or 1 if the
284 doesn't have a control function.
285 Otherwise, it returns what the control function in the
286 \&\fBX509_LOOKUP_METHOD\fR returns, which is usually 1 on success and 0 in
288 .IX Xref "509_LOOKUP_METHOD"
290 \&\fBX509_LOOKUP_get_store()\fR returns an \fBX509_STORE\fR pointer if there is
291 one, otherwise \s-1NULL.\s0
293 \&\fBX509_LOOKUP_by_subject()\fR, \fBX509_LOOKUP_by_issuer_serial()\fR,
294 \&\fBX509_LOOKUP_by_fingerprint()\fR, and \fBX509_LOOKUP_by_alias()\fR all return 0
295 if there is no \fBX509_LOOKUP_METHOD\fR or that method doesn't implement
296 the corresponding function.
297 Otherwise, it returns what the corresponding function in the
298 \&\fBX509_LOOKUP_METHOD\fR returns, which is usually 1 on success and 0 in
301 .IX Header "SEE ALSO"
302 \&\fBX509_LOOKUP_METHOD\fR\|(3), \fBX509_STORE\fR\|(3)
304 .IX Header "COPYRIGHT"
305 Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
307 Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
308 this file except in compliance with the License. You can obtain a copy
309 in the file \s-1LICENSE\s0 in the source distribution or at
310 <https://www.openssl.org/source/license.html>.