<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.gnupg.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.gnupg-import.php',
    1 => 'gnupg_import',
    2 => 'Imports a key',
  ),
  'up' => 
  array (
    0 => 'ref.gnupg.php',
    1 => 'GnuPG Functions',
  ),
  'prev' => 
  array (
    0 => 'function.gnupg-gettrustlist.php',
    1 => 'gnupg_gettrustlist',
  ),
  'next' => 
  array (
    0 => 'function.gnupg-init.php',
    1 => 'gnupg_init',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gnupg/functions/gnupg-import.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.gnupg-import" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gnupg_import</h1>
  <p class="verinfo">(PECL gnupg &gt;= 0.3)</p><p class="refpurpose"><span class="refname">gnupg_import</span> &mdash; <span class="dc-title">Imports a key</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.gnupg-import-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gnupg_import</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$identifier</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$keydata</code></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   Imports the key <code class="parameter">keydata</code> and returns an array with
   information about the importprocess.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gnupg-import-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">identifier</code></dt>
    <dd>
     <p class="para">The gnupg identifier, from a call to
<span class="function"><a href="function.gnupg-init.php" class="function">gnupg_init()</a></span> or <span class="classname"><strong class="classname">gnupg</strong></span>.</p>
    </dd>
   
   
    <dt><code class="parameter">keydata</code></dt>
    <dd>
     <span class="simpara">
      The data key that is being imported.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.gnupg-import-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   On success, this function returns and info-array about the importprocess.
   On failure, this function returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gnupg-import-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Procedural <span class="function"><strong>gnupg_import()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$res </span><span style="color: #007700">= </span><span style="color: #0000BB">gnupg_init</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$info </span><span style="color: #007700">= </span><span style="color: #0000BB">gnupg_import</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">,</span><span style="color: #0000BB">$keydata</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
   <div class="example" id="example-2">
    <p><strong>Example #2 OO <span class="function"><strong>gnupg_import()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$gpg </span><span style="color: #007700">= new </span><span style="color: #0000BB">gnupg</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$info </span><span style="color: #007700">= </span><span style="color: #0000BB">$gpg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">import</span><span style="color: #007700">(</span><span style="color: #0000BB">$keydata</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>

</div><?php manual_footer($setup); ?>