<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mongodb-driver-clientencryption.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'mongodb-driver-clientencryption.construct.php',
    1 => 'MongoDB\\Driver\\ClientEncryption::__construct',
    2 => 'Create a new ClientEncryption object',
  ),
  'up' => 
  array (
    0 => 'class.mongodb-driver-clientencryption.php',
    1 => 'MongoDB\\Driver\\ClientEncryption',
  ),
  'prev' => 
  array (
    0 => 'mongodb-driver-clientencryption.addkeyaltname.php',
    1 => 'MongoDB\\Driver\\ClientEncryption::addKeyAltName',
  ),
  'next' => 
  array (
    0 => 'mongodb-driver-clientencryption.createdatakey.php',
    1 => 'MongoDB\\Driver\\ClientEncryption::createDataKey',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mongodb/mongodb/driver/clientencryption/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mongodb-driver-clientencryption.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\Driver\ClientEncryption::__construct</h1>
  <p class="verinfo">(mongodb &gt;=1.14.0)</p><p class="refpurpose"><span class="refname">MongoDB\Driver\ClientEncryption::__construct</span> &mdash; <span class="dc-title">Create a new ClientEncryption object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-driver-clientencryption.construct-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\Driver\ClientEncryption::__construct</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$options</code></span>)</div>

  <p class="para rdfs-comment">
   Constructs a new <span class="classname"><a href="class.mongodb-driver-clientencryption.php" class="classname">MongoDB\Driver\ClientEncryption</a></span> object with the specified options.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-driver-clientencryption.construct-parameters">
  <h3 class="title">Параметри</h3>
  <dl>
   
    <dt><code class="parameter">options</code></dt>
    <dd>
     <p class="para">
      <table class="doctable table">
       <caption><strong>options</strong></caption>
       
        <thead>
         <tr>
          <th>Option</th>
          <th>Type</th>
          <th>Description</th>
         </tr>

        </thead>

        <tbody class="tbody">
         <tr>
          <td>keyVaultClient</td>
          <td><span class="classname"><a href="class.mongodb-driver-manager.php" class="classname">MongoDB\Driver\Manager</a></span></td>
          <td>The Manager used to route data key queries. This option is required (unlike with <span class="function"><a href="mongodb-driver-manager.createclientencryption.php" class="function">MongoDB\Driver\Manager::createClientEncryption()</a></span>).</td>
         </tr>

         
         <tr>
          <td>keyVaultNamespace</td>
          <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
          <td>Повна назва простору імен (напр.
          <code class="literal">&quot;databaseName.collectionName&quot;</code>), що позначає
          колекцію, яка містить усі ключі даних, що використовуються для
          шифрування та дешифрування. Цей параметр є обов&#039;язковим.</td>
         </tr>


         
         <tr>
          <td>kmsProviders</td>
          <td><span class="type"><a href="language.types.array.php" class="type array">array</a></span></td>
          <td>
           <p class="para">
            Документ, що містить налаштування для одного або кількох
            KMS-провайдерів, які використовуються для шифрування ключів даних.
            Підтримувані провайдери: <code class="literal">&quot;aws&quot;</code>,
            <code class="literal">&quot;azure&quot;</code>, <code class="literal">&quot;gcp&quot;</code>,
            <code class="literal">&quot;kmip&quot;</code> і <code class="literal">&quot;local&quot;</code>. Цей параметр
            є обов&#039;язковим.
           </p>
           <p class="para">
            Якщо вказано порожній документ для <code class="literal">&quot;aws&quot;</code>,
            <code class="literal">&quot;azure&quot;</code> або <code class="literal">&quot;gcp&quot;</code>, драйвер
            спробує налаштувати провайдера, використовуючи <a href="https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#automatic-credentials" class="link external">&raquo;&nbsp;Автоматичні
            облікові дані</a>.
           </p>
           <p class="para">
            Формат для <code class="literal">&quot;aws&quot;</code> наступний:
           </p>
           <div class="example-contents">
<div class="javascriptcode"><pre class="javascriptcode">aws: {
    accessKeyId: &lt;string&gt;,
    secretAccessKey: &lt;string&gt;,
    sessionToken: &lt;string (необов&amp;apos;язковий)&gt;
}</pre>
</div>
           </div>

           <p class="para">
            Формат для <code class="literal">&quot;azure&quot;</code> наступний:
           </p>
           <div class="example-contents">
<div class="javascriptcode"><pre class="javascriptcode">azure: {
    tenantId: &lt;string&gt;,
    clientId: &lt;string&gt;,
    clientSecret: &lt;string&gt;,
    identityPlatformEndpoint: &lt;string (необов&amp;apos;язковий)&gt; // Початково: &quot;login.microsoftonline.com&quot;
}</pre>
</div>
           </div>

           <p class="para">
            Формат для <code class="literal">&quot;gcp&quot;</code> наступний:
           </p>
           <div class="example-contents">
<div class="javascriptcode"><pre class="javascriptcode">gcp: {
    email: &lt;string&gt;,
    privateKey: &lt;base64 string&gt;|&lt;MongoDB\BSON\Binary&gt;,
    endpoint: &lt;string (необов&amp;apos;язковий)&gt; // Початково: &quot;oauth2.googleapis.com&quot;
}</pre>
</div>
           </div>

           <p class="para">
            Формат для <code class="literal">&quot;kmip&quot;</code> наступний:
           </p>
           <div class="example-contents">
<div class="javascriptcode"><pre class="javascriptcode">kmip: {
    endpoint: &lt;string&gt;
}</pre>
</div>
           </div>

           <p class="para">
            Формат для <code class="literal">&quot;local&quot;</code> наступний:
           </p>
           <div class="example-contents">
<div class="javascriptcode"><pre class="javascriptcode">local: {
    // 96-байтний головний ключ, що застосовується для шифрування/дешифрування ключів даних
    key: &lt;base64 string&gt;|&lt;MongoDB\BSON\Binary&gt;
}</pre>
</div>
           </div>

          </td>
         </tr>


         
         <tr>
          <td>tlsOptions</td>
          <td><span class="type"><a href="language.types.array.php" class="type array">array</a></span></td>
          <td>
           <p class="para">
            Документ, який містить налаштування TLS для одного або кількох
            KMS-провайдерів. Підтримуються такі провайдери:
            <code class="literal">&quot;aws&quot;</code>, <code class="literal">&quot;azure&quot;</code>,
            <code class="literal">&quot;gcp&quot;</code> та <code class="literal">&quot;kmip&quot;</code>. Для кожного
            провайдера можна задавати такі параметри:
           </p>
           <div class="example-contents">
<div class="javascriptcode"><pre class="javascriptcode">&lt;provider&gt;: {
    tlsCaFile: &lt;string&gt; (необов&amp;apos;язковий),
    tlsCertificateKeyFile: &lt;string&gt; (необов&amp;apos;язковий),
    tlsCertificateKeyFilePassword: &lt;string&gt; (необов&amp;apos;язковий),
    tlsDisableOCSPEndpointCheck: &lt;bool&gt; (необов&amp;apos;язковий)
}</pre>
</div>
           </div>

          </td>
         </tr>


        </tbody>
       
      </table>

     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-driver-clientencryption.construct-errors">
  <h3 class="title">Помилки/виключення</h3>
  <ul class="simplelist">
   <li>У разі помилки обробки параметрів
викидається
<span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.php" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span>.</li>
   <li>Throws <span class="classname"><a href="class.mongodb-driver-exception-runtimeexception.php" class="classname">MongoDB\Driver\Exception\RuntimeException</a></span> if the extension was compiled without libmongocrypt support</li>
  </ul>
 </div>


 <div class="refsect1 changelog" id="refsect1-mongodb-driver-clientencryption.construct-changelog">
  <h3 class="title">Журнал змін</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Версія</th>
       <th>Опис</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL mongodb 1.16.0</td>
       <td>
        <p class="para">
         The AWS KMS provider for client-side encryption now accepts a
         <code class="literal">&quot;sessionToken&quot;</code> option, which can be used to
         authenticate with temporary AWS credentials.
        </p>
        <p class="para">
         Added <code class="literal">&quot;tlsDisableOCSPEndpointCheck&quot;</code> to the
         <code class="literal">&quot;tlsOptions&quot;</code> option.
        </p>
        <p class="para">
         If an empty document is specified for the <code class="literal">&quot;azure&quot;</code> or
         <code class="literal">&quot;gcp&quot;</code> KMS provider, the driver will attempt to
         configure the provider using
         <a href="https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#automatic-credentials" class="link external">&raquo;&nbsp;Automatic Credentials</a>.
        </p>
       </td>
      </tr>

      <tr>
       <td>PECL mongodb 1.15.0</td>
       <td>
        <p class="para">
         If an empty document is specified for the <code class="literal">&quot;aws&quot;</code> KMS
         provider, the driver will attempt to configure the provider using
         <a href="https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#automatic-credentials" class="link external">&raquo;&nbsp;Automatic Credentials</a>.
        </p>
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-driver-clientencryption.construct-seealso">
  <h3 class="title">Прогляньте також</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="mongodb-driver-manager.createclientencryption.php" class="function" rel="rdfs-seeAlso">MongoDB\Driver\Manager::createClientEncryption()</a> - Create a new ClientEncryption object</span></li>
   <li><a href="https://www.mongodb.com/docs/manual/core/security-explicit-client-side-encryption/" class="link external">&raquo;&nbsp;Explicit (Manual) Client-Side Field Level Encryption</a> in the MongoDB manual</li>
  </ul>
 </div>


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