1X509_STORE_CTX_new(3)               OpenSSL              X509_STORE_CTX_new(3)
2
3
4

NAME

6       X509_STORE_CTX_new, X509_STORE_CTX_cleanup, X509_STORE_CTX_free,
7       X509_STORE_CTX_init, X509_STORE_CTX_trusted_stack,
8       X509_STORE_CTX_set_cert, X509_STORE_CTX_set_chain,
9       X509_STORE_CTX_set0_crls, X509_STORE_CTX_get0_param,
10       X509_STORE_CTX_set0_param, X509_STORE_CTX_set_default - X509_STORE_CTX
11       initialisation
12

SYNOPSIS

14        #include <openssl/x509_vfy.h>
15
16        X509_STORE_CTX *X509_STORE_CTX_new(void);
17        void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
18        void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
19
20        int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
21                                X509 *x509, STACK_OF(X509) *chain);
22
23        void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
24
25        void   X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx,X509 *x);
26        void   X509_STORE_CTX_set_chain(X509_STORE_CTX *ctx,STACK_OF(X509) *sk);
27        void   X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk);
28
29        X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx);
30        void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
31        int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
32

DESCRIPTION

34       These functions initialise an X509_STORE_CTX structure for subsequent
35       use by X509_verify_cert().
36
37       X509_STORE_CTX_new() returns a newly initialised X509_STORE_CTX
38       structure.
39
40       X509_STORE_CTX_cleanup() internally cleans up an X509_STORE_CTX
41       structure.  The context can then be reused with an new call to
42       X509_STORE_CTX_init().
43
44       X509_STORE_CTX_free() completely frees up ctx. After this call ctx is
45       no longer valid.
46
47       X509_STORE_CTX_init() sets up ctx for a subsequent verification
48       operation.  The trusted certificate store is set to store, the end
49       entity certificate to be verified is set to x509 and a set of
50       additional certificates (which will be untrusted but may be used to
51       build the chain) in chain. Any or all of the store, x509 and chain
52       parameters can be NULL.
53
54       X509_STORE_CTX_trusted_stack() sets the set of trusted certificates of
55       ctx to sk. This is an alternative way of specifying trusted
56       certificates instead of using an X509_STORE.
57
58       X509_STORE_CTX_set_cert() sets the certificate to be vertified in ctx
59       to x.
60
61       X509_STORE_CTX_set_chain() sets the additional certificate chain used
62       by ctx to sk.
63
64       X509_STORE_CTX_set0_crls() sets a set of CRLs to use to aid certificate
65       verification to sk. These CRLs will only be used if CRL verification is
66       enabled in the associated X509_VERIFY_PARAM structure. This might be
67       used where additional "useful" CRLs are supplied as part of a protocol,
68       for example in a PKCS#7 structure.
69
70       X509_VERIFY_PARAM *X509_STORE_CTX_get0_param() retrieves an intenal
71       pointer to the verification parameters associated with ctx.
72
73       X509_STORE_CTX_set0_param() sets the intenal verification parameter
74       pointer to param. After this call param should not be used.
75
76       X509_STORE_CTX_set_default() looks up and sets the default verification
77       method to name. This uses the function X509_VERIFY_PARAM_lookup() to
78       find an appropriate set of parameters from name.
79

NOTES

81       The certificates and CRLs in a store are used internally and should not
82       be freed up until after the associated X509_STORE_CTX is freed. Legacy
83       applications might implicitly use an X509_STORE_CTX like this:
84
85         X509_STORE_CTX ctx;
86         X509_STORE_CTX_init(&ctx, store, cert, chain);
87
88       this is not recommended in new applications they should instead do:
89
90         X509_STORE_CTX *ctx;
91         ctx = X509_STORE_CTX_new();
92         if (ctx == NULL)
93               /* Bad error */
94         X509_STORE_CTX_init(ctx, store, cert, chain);
95

BUGS

97       The certificates and CRLs in a context are used internally and should
98       not be freed up until after the associated X509_STORE_CTX is freed.
99       Copies should be made or reference counts increased instead.
100

RETURN VALUES

102       X509_STORE_CTX_new() returns an newly allocates context or NULL is an
103       error occurred.
104
105       X509_STORE_CTX_init() returns 1 for success or 0 if an error occurred.
106
107       X509_STORE_CTX_get0_param() returns a pointer to an X509_VERIFY_PARAM
108       structure or NULL if an error occurred.
109
110       X509_STORE_CTX_cleanup(), X509_STORE_CTX_free(),
111       X509_STORE_CTX_trusted_stack(), X509_STORE_CTX_set_cert(),
112       X509_STORE_CTX_set_chain(), X509_STORE_CTX_set0_crls() and
113       X509_STORE_CTX_set0_param() do not return values.
114
115       X509_STORE_CTX_set_default() returns 1 for success or 0 if an error
116       occurred.
117

SEE ALSO

119       X509_verify_cert(3) X509_VERIFY_PARAM_set_flags(3)
120

HISTORY

122       X509_STORE_CTX_set0_crls() was first added to OpenSSL 1.0.0
123
124
125
1261.0.1e                            2013-02-11             X509_STORE_CTX_new(3)
Impressum