<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gnupg-verify">
 <refnamediv>
  <refname>gnupg_verify</refname>
  <refpurpose>Verifies a signed text</refpurpose>
 </refnamediv>
 
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type class="union"><type>array</type><type>false</type></type><methodname>gnupg_verify</methodname>
   <methodparam><type>resource</type><parameter>identifier</parameter></methodparam>
   <methodparam><type>string</type><parameter>signed_text</parameter></methodparam>
   <methodparam><type>string</type><parameter>signature</parameter></methodparam>
   <methodparam choice="opt"><type>string</type><parameter role="reference">plaintext</parameter></methodparam>
  </methodsynopsis>
  <para>
   Verifies the given <parameter>signed_text</parameter> and returns information about the
   signature.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>identifier</parameter></term>
     <listitem>
      &gnupg.identifier;
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>signed_text</parameter></term>
     <listitem>
      <para>
       The signed text.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>signature</parameter></term>
     <listitem>
      <para>
       The signature.
       To verify a clearsigned text, set signature to &false;.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>plaintext</parameter></term>
     <listitem>
      <para>
       The plain text.
       If this optional parameter is passed, it is
       filled with the plain text.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   On success, this function returns information about the signature.
   On failure, this function returns &false;.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>Procedural <function>gnupg_verify</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php
$plaintext = "";
$res = gnupg_init();
// clearsigned
$info = gnupg_verify($res,$signed_text,false,$plaintext);
print_r($info);
// detached signature
$info = gnupg_verify($res,$signed_text,$signature);
print_r($info);
?>
]]>
    </programlisting>
   </example>
   <example>
    <title>OO <function>gnupg_verify</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php
$plaintext = "";
$gpg = new gnupg();
// clearsigned
$info = $gpg->verify($signed_text,false,$plaintext);
print_r($info);
// detached signature
$info = $gpg->verify($signed_text,$signature);
print_r($info);
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
