
#use wml::openssl-macros area=docs page=X509_verify_cert

<title>Documents, X509_verify_cert(3)</title>

<h1>X509_verify_cert(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#BUGS">BUGS</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
X509_verify_cert - discover and verify X509 certificte chain

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/x509.h&gt;
</PRE>
<PRE> int X509_verify_cert(X509_STORE_CTX *ctx);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
The <CODE>X509_verify_cert()</CODE> function attempts to discover and
validate a certificate chain based on parameters in <STRONG>ctx</STRONG>. A complete description of the process is contained in the <A HREF="../apps/verify.html#">verify(1)</A> manual page.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
If a complete chain can be built and validated this function returns 1,
otherwise it return zero, in exceptional circumstances it can also return a
negative code.

</P>
<P>
If the function fails additional error information can be obtained by
examining <STRONG>ctx</STRONG> using, for example <CODE>X509_STORE_CTX_get_error().</CODE>

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
Applications rarely call this function directly but it is used by OpenSSL
internally for certificate validation, in both the S/MIME and SSL/TLS code.

</P>
<P>
The negative return value from <CODE>X509_verify_cert()</CODE> can only
occur if no certificate is set in <STRONG>ctx</STRONG> (due to a programming error) or if a retry operation is requested during
internal lookups (which never happens with standard lookup methods). It is
however recommended that application check for &lt;= 0 return value on
error.

</P>
<P>
<HR>
<H1><A NAME="BUGS">BUGS</A></H1>
<P>
This function uses the header <STRONG>x509.h</STRONG> as opposed to most chain verification functiosn which use <STRONG>x509_vfy.h</STRONG>.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/X509_STORE_CTX_get_error.html#">X509_STORE_CTX_get_error(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>X509_verify_cert()</CODE> is available in all versions of SSLeay and
OpenSSL.

</P>
:}


