<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.openssl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.openssl-private-encrypt.php',
    1 => 'openssl_private_encrypt',
    2 => 'Verschl&uuml;sselt Daten mit einem privaten Schl&uuml;ssel',
  ),
  'up' => 
  array (
    0 => 'ref.openssl.php',
    1 => 'OpenSSL-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.openssl-private-decrypt.php',
    1 => 'openssl_private_decrypt',
  ),
  'next' => 
  array (
    0 => 'function.openssl-public-decrypt.php',
    1 => 'openssl_public_decrypt',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/openssl/functions/openssl-private-encrypt.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.openssl-private-encrypt" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_private_encrypt</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">openssl_private_encrypt</span> &mdash; <span class="dc-title">Verschlüsselt Daten mit einem privaten Schlüssel</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.openssl-private-encrypt-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_private_encrypt</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="attribute"><a href="class.sensitiveparameter.php">#[\SensitiveParameter]</a> </span><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter reference">&$encrypted_data</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="attribute"><a href="class.sensitiveparameter.php">#[\SensitiveParameter]</a> </span><span class="type"><span class="type"><a href="class.opensslasymmetrickey.php" class="type OpenSSLAsymmetricKey">OpenSSLAsymmetricKey</a></span>|<span class="type"><a href="class.opensslcertificate.php" class="type OpenSSLCertificate">OpenSSLCertificate</a></span>|<span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$private_key</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$padding</code><span class="initializer"> = <strong><code><a href="openssl.padding.php#constant.openssl-pkcs1-padding">OPENSSL_PKCS1_PADDING</a></code></strong></span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>openssl_private_encrypt()</strong></span> verschlüsselt
   <code class="parameter">data</code> mit dem privaten Schlüssel
   <code class="parameter">private_key</code>, und speichert das Ergebnis in
   <code class="parameter">encrypted_data</code>. Verschlüsselte Daten können mit
   <span class="function"><a href="function.openssl-public-decrypt.php" class="function">openssl_public_decrypt()</a></span> entschlüsselt werden.
  </p>
  <p class="para">
   Diese Funktion kann z. B. verwendet werden, um Daten (oder deren Hashwert)
   zu signieren um damit sicherzustellen, dass diese Daten wirklich von einem
   bestimmten Sender stammen, und nicht von jemand anderem.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-private-encrypt-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
      </p>
     </dd>
    
    
     <dt><code class="parameter">encrypted_data</code></dt>
     <dd>
      <p class="para">
      </p>
     </dd>
    
    
     <dt><code class="parameter">private_key</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">public_key</code> muss der öffentliche Schlüssel sein,
       der zu dem privaten Schlüssel gehört, mit dem die Daten verschlüsselt
       wurden.
      </p>
     </dd>
    
    
     <dt><code class="parameter">padding</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">padding</code> kann entweder
       <strong><code><a href="openssl.padding.php#constant.openssl-pkcs1-padding">OPENSSL_PKCS1_PADDING</a></code></strong> oder
       <strong><code><a href="openssl.padding.php#constant.openssl-no-padding">OPENSSL_NO_PADDING</a></code></strong> sein.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-private-encrypt-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt bei Erfolg <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück. Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.openssl-private-encrypt-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">private_key</code> akzeptiert nun eine
       <span class="classname"><a href="class.opensslasymmetrickey.php" class="classname">OpenSSLAsymmetricKey</a></span>- oder
       <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span>-Instanz; vorher wurde eine
       <a href="language.types.resource.php" class="link">Ressource</a> vom Typ <code class="literal">OpenSSL-Schlüssel</code> oder
       <code class="literal">OpenSSL X.509</code> akzeptiert.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.openssl-private-encrypt-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.openssl-public-encrypt.php" class="function" rel="rdfs-seeAlso">openssl_public_encrypt()</a> - Verschl&uuml;sselt Daten mit einem &ouml;ffentlichen Schl&uuml;ssel</span></li>
    <li><span class="function"><a href="function.openssl-public-decrypt.php" class="function" rel="rdfs-seeAlso">openssl_public_decrypt()</a> - Entschl&uuml;sselt Daten mit einem &ouml;ffentlichen Schl&uuml;ssel</span></li>
   </ul>
  </p>
 </div>


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