1 .\" $NetBSD: X509_STORE_CTX_new.3,v 1.13 2015/06/12 17:01:14 christos Exp $
3 .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
6 .\" ========================================================================
7 .de Sp \" Vertical space (when we can't use .PP)
11 .de Vb \" Begin verbatim text
16 .de Ve \" End verbatim text
20 .\" Set up some character translations and predefined strings. \*(-- will
21 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
22 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
23 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
24 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
25 .\" nothing in troff, for use with C<>.
27 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
31 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
32 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
47 .\" Escape single quotes in literal strings from groff's Unicode transform.
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
56 .\" Avoid warning from groff about undefined register 'F'.
60 .if \n(.g .if rF .nr rF 1
61 .if (\n(rF:(\n(.g==0)) \{
64 . tm Index:\\$1\t\\n%\t"\\$2"
74 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
75 .\" Fear. Run. Save yourself. No user-serviceable parts.
76 . \" fudge factors for nroff and troff
85 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
91 . \" simple accents for nroff and troff
101 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
102 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
103 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
104 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
105 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
106 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
108 . \" troff and (daisy-wheel) nroff accents
109 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
110 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
111 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
112 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
113 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
114 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
115 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
116 .ds ae a\h'-(\w'a'u*4/10)'e
117 .ds Ae A\h'-(\w'A'u*4/10)'E
118 . \" corrections for vroff
119 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
120 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
121 . \" for low resolution devices (crt and lpr)
122 .if \n(.H>23 .if \n(.V>19 \
135 .\" ========================================================================
137 .IX Title "X509_STORE_CTX_new 3"
138 .TH X509_STORE_CTX_new 3 "2009-12-26" "1.0.1n" "OpenSSL"
139 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
140 .\" way too many mistakes in technical documents.
144 X509_STORE_CTX_new, X509_STORE_CTX_cleanup, X509_STORE_CTX_free, X509_STORE_CTX_init, X509_STORE_CTX_trusted_stack, X509_STORE_CTX_set_cert, X509_STORE_CTX_set_chain, X509_STORE_CTX_set0_crls, X509_STORE_CTX_get0_param, X509_STORE_CTX_set0_param, X509_STORE_CTX_set_default \- X509_STORE_CTX initialisation
148 .IX Header "SYNOPSIS"
150 \& #include <openssl/x509_vfy.h>
152 \& X509_STORE_CTX *X509_STORE_CTX_new(void);
153 \& void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
154 \& void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
156 \& int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
157 \& X509 *x509, STACK_OF(X509) *chain);
159 \& void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
161 \& void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx,X509 *x);
162 \& void X509_STORE_CTX_set_chain(X509_STORE_CTX *ctx,STACK_OF(X509) *sk);
163 \& void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk);
165 \& X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx);
166 \& void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
167 \& int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
170 .IX Header "DESCRIPTION"
171 These functions initialise an \fBX509_STORE_CTX\fR structure for subsequent use
172 by \fIX509_verify_cert()\fR.
174 \&\fIX509_STORE_CTX_new()\fR returns a newly initialised \fBX509_STORE_CTX\fR structure.
176 \&\fIX509_STORE_CTX_cleanup()\fR internally cleans up an \fBX509_STORE_CTX\fR structure.
177 The context can then be reused with an new call to \fIX509_STORE_CTX_init()\fR.
179 \&\fIX509_STORE_CTX_free()\fR completely frees up \fBctx\fR. After this call \fBctx\fR
182 \&\fIX509_STORE_CTX_init()\fR sets up \fBctx\fR for a subsequent verification operation.
183 The trusted certificate store is set to \fBstore\fR, the end entity certificate
184 to be verified is set to \fBx509\fR and a set of additional certificates (which
185 will be untrusted but may be used to build the chain) in \fBchain\fR. Any or
186 all of the \fBstore\fR, \fBx509\fR and \fBchain\fR parameters can be \fB\s-1NULL\s0\fR.
188 \&\fIX509_STORE_CTX_trusted_stack()\fR sets the set of trusted certificates of \fBctx\fR
189 to \fBsk\fR. This is an alternative way of specifying trusted certificates
190 instead of using an \fBX509_STORE\fR.
192 \&\fIX509_STORE_CTX_set_cert()\fR sets the certificate to be vertified in \fBctx\fR to
195 \&\fIX509_STORE_CTX_set_chain()\fR sets the additional certificate chain used by \fBctx\fR
198 \&\fIX509_STORE_CTX_set0_crls()\fR sets a set of CRLs to use to aid certificate
199 verification to \fBsk\fR. These CRLs will only be used if \s-1CRL\s0 verification is
200 enabled in the associated \fBX509_VERIFY_PARAM\fR structure. This might be
201 used where additional \*(L"useful\*(R" CRLs are supplied as part of a protocol,
202 for example in a PKCS#7 structure.
204 X509_VERIFY_PARAM *\fIX509_STORE_CTX_get0_param()\fR retrieves an intenal pointer
205 to the verification parameters associated with \fBctx\fR.
207 \&\fIX509_STORE_CTX_set0_param()\fR sets the intenal verification parameter pointer
208 to \fBparam\fR. After this call \fBparam\fR should not be used.
210 \&\fIX509_STORE_CTX_set_default()\fR looks up and sets the default verification
211 method to \fBname\fR. This uses the function \fIX509_VERIFY_PARAM_lookup()\fR to
212 find an appropriate set of parameters from \fBname\fR.
215 The certificates and CRLs in a store are used internally and should \fBnot\fR
216 be freed up until after the associated \fBX509_STORE_CTX\fR is freed. Legacy
217 applications might implicitly use an \fBX509_STORE_CTX\fR like this:
220 \& X509_STORE_CTX ctx;
221 \& X509_STORE_CTX_init(&ctx, store, cert, chain);
224 this is \fBnot\fR recommended in new applications they should instead do:
227 \& X509_STORE_CTX *ctx;
228 \& ctx = X509_STORE_CTX_new();
231 \& X509_STORE_CTX_init(ctx, store, cert, chain);
235 The certificates and CRLs in a context are used internally and should \fBnot\fR
236 be freed up until after the associated \fBX509_STORE_CTX\fR is freed. Copies
237 should be made or reference counts increased instead.
239 .IX Header "RETURN VALUES"
240 \&\fIX509_STORE_CTX_new()\fR returns an newly allocates context or \fB\s-1NULL\s0\fR is an
243 \&\fIX509_STORE_CTX_init()\fR returns 1 for success or 0 if an error occurred.
245 \&\fIX509_STORE_CTX_get0_param()\fR returns a pointer to an \fBX509_VERIFY_PARAM\fR
246 structure or \fB\s-1NULL\s0\fR if an error occurred.
248 \&\fIX509_STORE_CTX_cleanup()\fR, \fIX509_STORE_CTX_free()\fR, \fIX509_STORE_CTX_trusted_stack()\fR,
249 \&\fIX509_STORE_CTX_set_cert()\fR, \fIX509_STORE_CTX_set_chain()\fR,
250 \&\fIX509_STORE_CTX_set0_crls()\fR and \fIX509_STORE_CTX_set0_param()\fR do not return
253 \&\fIX509_STORE_CTX_set_default()\fR returns 1 for success or 0 if an error occurred.
255 .IX Header "SEE ALSO"
256 \&\fIX509_verify_cert\fR\|(3)
257 \&\fIX509_VERIFY_PARAM_set_flags\fR\|(3)
260 \&\fIX509_STORE_CTX_set0_crls()\fR was first added to OpenSSL 1.0.0