<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/phar.fileformat.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'phar.fileformat.signature.php',
    1 => 'Phar Signature format',
    2 => 'Phar Signature format',
  ),
  'up' => 
  array (
    0 => 'phar.fileformat.php',
    1 => 'What makes a phar a phar and not a tar or a zip?',
  ),
  'prev' => 
  array (
    0 => 'phar.fileformat.manifestfile.php',
    1 => 'Phar manifest file entry definition',
  ),
  'next' => 
  array (
    0 => 'class.phar.php',
    1 => 'Phar',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/phar/fileformat.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="phar.fileformat.signature" class="section">
 <h2 class="title">Phar Signature format</h2>
 <p class="para">
  Phars containing a signature always have the signature appended to the
  end of the Phar archive after the loader, manifest, and file contents.
  The signature formats supported at this time are MD5, SHA1, SHA256, SHA512,
  and OPENSSL.
 </p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>Signature format</strong></caption>
   
    <thead>
     <tr>
      <th>Length in bytes</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>varying</td>
      <td>
       The actual signature, 20 bytes for an SHA1 signature,
       16 bytes for an MD5 signature, 32 bytes for an SHA256 signature,
       and 64 bytes for an SHA512 signature. The length of an OPENSSL
       signature depends on the size of the private key.
      </td>
     </tr>

     <tr>
      <td>4 bytes</td>
      <td>
       Signature flags.  <code class="literal">0x0001</code> is used to
       define an MD5 signature, <code class="literal">0x0002</code> is used
       to define an SHA1 signature, <code class="literal">0x0003</code> is used
       to define an SHA256 signature, and <code class="literal">0x0004</code> is
       used to define an SHA512 signature.  The SHA256 and SHA512 signature
       support is available as of API version 1.1.0.
       <code class="literal">0x0010</code> is used to define an OPENSSL signature, what
       is available as of API version 1.1.1, if OpenSSL is available.
      </td>
     </tr>

     <tr>
      <td>4 bytes</td>
      <td>
       Magic <code class="literal">GBMB</code> used to define the presence of a signature.
      </td>
     </tr>

    </tbody>
   
  </table>

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