5 X509_verify_cert - discover and verify X509 certificte chain
9 #include <openssl/x509.h>
11 int X509_verify_cert(X509_STORE_CTX *ctx);
15 The X509_verify_cert() function attempts to discover and validate a
16 certificate chain based on parameters in B<ctx>. A complete description of
17 the process is contained in the L<verify(1)|verify(1)> manual page.
21 If a complete chain can be built and validated this function returns 1,
22 otherwise it return zero, in exceptional circumstances it can also
23 return a negative code.
25 If the function fails additional error information can be obtained by
26 examining B<ctx> using, for example X509_STORE_CTX_get_error().
30 Applications rarely call this function directly but it is used by
31 OpenSSL internally for certificate validation, in both the S/MIME and
34 The negative return value from X509_verify_cert() can only occur if no
35 certificate is set in B<ctx> (due to a programming error) or if a retry
36 operation is requested during internal lookups (which never happens with
37 standard lookup methods). It is however recommended that application check
38 for <= 0 return value on error.
42 This function uses the header B<x509.h> as opposed to most chain verification
43 functiosn which use B<x509_vfy.h>.
47 L<X509_STORE_CTX_get_error(3)|X509_STORE_CTX_get_error(3)>
51 X509_verify_cert() is available in all versions of SSLeay and OpenSSL.