<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/openssl.constants.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'openssl.pkcs7.flags.php',
    1 => 'PKCS7 Flags/Constants',
    2 => 'PKCS7 Flags/Constants',
  ),
  'up' => 
  array (
    0 => 'openssl.constants.php',
    1 => 'Predefined Constants',
  ),
  'prev' => 
  array (
    0 => 'openssl.key-types.php',
    1 => 'Key types',
  ),
  'next' => 
  array (
    0 => 'openssl.cms.flags.php',
    1 => 'CMS Flags/Constants',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/openssl/constants.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="openssl.pkcs7.flags" class="section">
   <h2 class="title"><abbr>PKCS7</abbr> Flags/Constants</h2>
   <p class="para">
    The S/MIME functions make use of flags which are specified using a
    bitfield which can include one or more of the following values:
    <table class="doctable table">
     <caption><strong><abbr>PKCS7</abbr> CONSTANTS</strong></caption>
      
       <thead>
        <tr>
         <th>Constant</th>
         <th>Description</th>
        </tr>

       </thead>

       <tbody class="tbody">
        <tr id="constant.pkcs7-text">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-text">PKCS7_TEXT</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>Adds <code class="literal">text/plain</code> content type headers to encrypted/signed
         message. If decrypting or verifying, it strips those headers from
         the output - if the decrypted or verified message is not of <abbr title="Multipurpose Internet Mail Extensions">MIME</abbr> type
         <code class="literal">text/plain</code> then an error will occur.</td>
        </tr>

        <tr id="constant.pkcs7-binary">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-binary">PKCS7_BINARY</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>Normally the input message is converted to &quot;canonical&quot; format
         which is effectively using <code class="literal">CR</code> and <code class="literal">LF</code>
          as end of line: as required by the S/MIME specification.  When this
          option is present, no translation occurs. This is useful when
          handling binary data which may not be in MIME format.</td>
        </tr>

        <tr id="constant.pkcs7-nointern">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-nointern">PKCS7_NOINTERN</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>When verifying a message, certificates (if
           any) included in the message are normally searched for the
           signing certificate. With this option only the
           certificates specified in the <code class="parameter">untrusted_certificates_filename</code>
           parameter of <span class="function"><a href="function.openssl-pkcs7-verify.php" class="function">openssl_pkcs7_verify()</a></span> are
           used.  The supplied certificates can still be used as
           untrusted CAs however.
         </td>
        </tr>

        <tr id="constant.pkcs7-noverify">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-noverify">PKCS7_NOVERIFY</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>Do not verify the signers certificate of a signed
         message.</td>
        </tr>

        <tr id="constant.pkcs7-nochain">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-nochain">PKCS7_NOCHAIN</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>Do not chain verification of signers certificates: that is
         don&#039;t use the certificates in the signed message as untrusted CAs.
         </td>
        </tr>

        <tr id="constant.pkcs7-nocerts">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-nocerts">PKCS7_NOCERTS</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>When signing a message the signer&#039;s certificate is normally
         included - with this option it is excluded.  This will reduce the
         size of the signed message but the verifier must have a copy of the
         signers certificate available locally (passed using the
         <code class="parameter">untrusted_certificates_filename</code> to
         <span class="function"><a href="function.openssl-pkcs7-verify.php" class="function">openssl_pkcs7_verify()</a></span> for example).
         </td>
        </tr>

        <tr id="constant.pkcs7-noattr">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-noattr">PKCS7_NOATTR</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>Normally when a message is signed, a set of attributes are
         included which include the signing time and the supported symmetric
         algorithms.  With this option they are not included.
         </td>
        </tr>

        <tr id="constant.pkcs7-detached">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-detached">PKCS7_DETACHED</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>When signing a message, use cleartext signing with the MIME
         type <code class="literal">&quot;multipart/signed&quot;</code>. This is the default
         if you do not specify any <code class="parameter">flags</code> to
         <span class="function"><a href="function.openssl-pkcs7-sign.php" class="function">openssl_pkcs7_sign()</a></span>.
         If you turn this option off, the message will be signed using
         opaque signing, which is more resistant to translation by mail relays
         but cannot be read by mail agents that do not support S/MIME.</td>
        </tr>

        <tr id="constant.pkcs7-nosigs">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-nosigs">PKCS7_NOSIGS</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>Don&#039;t try and verify the signatures on a message</td>
        </tr>

        <tr id="constant.pkcs7-nooldmimetype">
         <td>
          <strong><code><a href="openssl.pkcs7.flags.php#constant.pkcs7-nooldmimetype">PKCS7_NOOLDMIMETYPE</a></code></strong>
          (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
         </td>
         <td>
          Available as of PHP 8.3.0.
          Sets the content-type to <code class="literal">application/pkcs7-mime</code> instead of
          <code class="literal">application/x-pkcs7-mime</code> to encrypt a message.
         </td>
        </tr>

       </tbody>
      
     </table>

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