<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >openssl_pkcs7_verify</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="OpenSSL Functions" HREF="ref.openssl.html"><LINK REL="PREVIOUS" TITLE="openssl_pkcs7_sign" HREF="function.openssl-pkcs7-sign.html"><LINK REL="NEXT" TITLE="openssl_pkey_export_to_file" HREF="function.openssl-pkey-export-to-file.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.openssl-pkcs7-sign.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.openssl-pkey-export-to-file.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.openssl-pkcs7-verify" ></A >openssl_pkcs7_verify</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN164049" ></A ><P > (PHP 4 >= 4.0.6, PHP 5)</P >openssl_pkcs7_verify -- Verifies the signature of an S/MIME signed message</DIV ><DIV CLASS="refsect1" ><A NAME="AEN164052" ></A ><H2 >Description</H2 >mixed <B CLASS="methodname" >openssl_pkcs7_verify</B > ( string filename, int flags [, string outfilename [, array cainfo [, string extracerts [, string content]]]] )<BR ></BR ><P > <B CLASS="function" >openssl_pkcs7_verify()</B > reads the S/MIME message contained in the filename specified by <CODE CLASS="parameter" >filename</CODE > and examines the digital signature. It returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the signature is verified, <TT CLASS="constant" ><B >FALSE</B ></TT > if it is not correct (the message has been tampered with, or the signing certificate is invalid), or -1 on error. </P ><P > <CODE CLASS="parameter" >flags</CODE > can be used to affect how the signature is verified - see <A HREF="ref.openssl.html#openssl.pkcs7.flags" >PKCS7 constants</A > for more information. </P ><P > If the <CODE CLASS="parameter" >outfilename</CODE > is specified, it should be a string holding the name of a file into which the certificates of the persons that signed the messages will be stored in PEM format. </P ><P > If the <CODE CLASS="parameter" >cainfo</CODE > is specified, it should hold information about the trusted CA certificates to use in the verification process - see <A HREF="ref.openssl.html#openssl.cert.verification" >certificate verification</A > for more information about this parameter. </P ><P > If the <CODE CLASS="parameter" >extracerts</CODE > is specified, it is the filename of a file containing a bunch of certificates to use as untrusted CAs. </P ><P > You can specify a filename with <CODE CLASS="parameter" >content</CODE > that will be filled with the verified data, but with the signature information stripped. This was added as of PHP 5.1.0. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.openssl-pkcs7-sign.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.openssl-pkey-export-to-file.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >openssl_pkcs7_sign</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.openssl.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >openssl_pkey_export_to_file</TD ></TR ></TABLE ></DIV ></BODY ></HTML >