<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 344831 $ -->

<phpdoc:classref xml:id="class.mongodb-driver-clientencryption" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">

 <title>The MongoDB\Driver\ClientEncryption class</title>
 <titleabbrev>MongoDB\Driver\ClientEncryption</titleabbrev>

 <partintro>

  <!-- {{{ MongoDB\Driver\ClientEncryption intro -->
  <section xml:id="mongodb-driver-clientencryption.intro">
   &reftitle.intro;
   <para>
    The <classname>MongoDB\Driver\ClientEncryption</classname> class handles
    creation of data keys for client-side encryption, as well as manually
    encrypting and decrypting values.
   </para>
  </section>
  <!-- }}} -->

  <section xml:id="mongodb-driver-clientencryption.synopsis">
   &reftitle.classsynopsis;

   <!-- {{{ Synopsis -->
   <classsynopsis>
    <ooclass><classname>MongoDB\Driver\ClientEncryption</classname></ooclass>

    <!-- {{{ Class synopsis -->
    <classsynopsisinfo>
     <modifier>final</modifier>
     <ooclass>
      <classname>MongoDB\Driver\ClientEncryption</classname>
     </ooclass>
    </classsynopsisinfo>
    <!-- }}} -->

    <!-- {{{ MongoDB\Driver\ReadPreference constants -->
    <classsynopsisinfo role="comment">&Constants;</classsynopsisinfo>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>string</type>
     <varname linkend="mongodb-driver-clientencryption.constants.deterministic">MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC</varname>
     <initializer>AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>string</type>
     <varname linkend="mongodb-driver-clientencryption.constants.random">MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM</varname>
     <initializer>AEAD_AES_256_CBC_HMAC_SHA_512-Random</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>string</type>
     <varname linkend="mongodb-driver-clientencryption.constants.algorithm-indexed">MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED</varname>
     <initializer>Indexed</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>string</type>
     <varname linkend="mongodb-driver-clientencryption.constants.algorithm-unindexed">MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED</varname>
     <initializer>Unindexed</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>string</type>
     <varname linkend="mongodb-driver-clientencryption.constants.algorithm-range-preview">MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW</varname>
     <initializer>RangePreview</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>string</type>
     <varname linkend="mongodb-driver-clientencryption.constants.query-type-equality">MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY</varname>
     <initializer>equality</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>string</type>
     <varname linkend="mongodb-driver-clientencryption.constants.query-type-range-preview">MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW</varname>
     <initializer>rangePreview</initializer>
    </fieldsynopsis>

    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongodb-driver-clientencryption')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])" />
   </classsynopsis>
   <!-- }}} -->

  </section>

  <!-- {{{ MongoDB\Driver\ClientEncryption constants -->
  <section xml:id="mongodb-driver-clientencryption.constants">
   &reftitle.constants;
   <variablelist>

    <varlistentry xml:id="mongodb-driver-clientencryption.constants.deterministic">
     <term><constant>MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC</constant></term>
     <listitem>
      <para>Specifies an algorithm for <link xlink:href="&url.mongodb.docs;core/security-client-side-encryption/#deterministic-encryption">deterministic encryption</link>, which is suitable for querying.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-driver-clientencryption.constants.random">
     <term><constant>MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM</constant></term>
     <listitem>
      <para>Specifies an algorithm for <link xlink:href="&url.mongodb.docs;core/security-client-side-encryption/#randomized-encryption">randomized encryption</link></para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-driver-clientencryption.constants.algorithm-indexed">
     <term><constant>MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED</constant></term>
     <listitem>
      <para>Specifies an algorithm for an indexed, encrypted payload, which can be used with queryable encryption.</para>
      <para>To insert or query with an indexed, encrypted payload, the <classname>MongoDB\Driver\Manager</classname> must be configured with the <literal>"autoEncryption"</literal> driver option. The <literal>"bypassQueryAnalysis"</literal> auto encryption option may be &true;. The <literal>"bypassAutoEncryption"</literal> auto encryption option must be &false;.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-driver-clientencryption.constants.algorithm-unindexed">
     <term><constant>MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED</constant></term>
     <listitem>
      <para>Specifies an algorithm for an unindexed, encrypted payload.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-driver-clientencryption.constants.algorithm-range-preview">
     <term><constant>MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW</constant></term>
     <listitem>
      <para>Specifies an algorithm for a range, encrypted payload, which can be used with queryable encryption.</para>
      <para>To query with a range encrypted payload, the <classname>MongoDB\Driver\Manager</classname> must be configured with the <literal>"autoEncryption"</literal> driver option. The <literal>"bypassQueryAnalysis"</literal> auto encryption option may be &true;. The <literal>"bypassAutoEncryption"</literal> auto encryption option must be &false;.</para>
      <note>
       <para>The range algorithm is experimental only. It is not intended for public use.</para>
       <para>The PHP driver does not yet support range queries for decimal128 BSON field types.</para>
      </note>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-driver-clientencryption.constants.query-type-equality">
     <term><constant>MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY</constant></term>
     <listitem>
      <para>Specifies an equality query type, which is used in conjunction with <constant>MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED</constant>.</para>
     </listitem>
    </varlistentry>

    <varlistentry xml:id="mongodb-driver-clientencryption.constants.query-type-range-preview">
     <term><constant>MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW</constant></term>
     <listitem>
      <para>Specifies a range query type, which is used in conjunction with <constant>MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW</constant>.</para>
     </listitem>
    </varlistentry>

   </variablelist>
  </section>
  <!-- }}} -->

  <section role="changelog">
   &reftitle.changelog;
   <para>
    <informaltable>
     <tgroup cols="2">
      <thead>
       <row>
        <entry>&Version;</entry>
        <entry>&Description;</entry>
       </row>
      </thead>
      <tbody>
       <row>
        <entry>PECL mongodb 1.16.0</entry>
        <entry>
          Added <constant>MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW</constant> and <constant>MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW</constant>.
        </entry>
       </row>
       <row>
        <entry>PECL mongodb 1.14.0</entry>
        <entry>
          Added <constant>MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED</constant>, <constant>MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED</constant>, and <constant>MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY</constant>
        </entry>
       </row>
      </tbody>
     </tgroup>
    </informaltable>
   </para>
  </section>

  <section xml:id="mongodb-driver-clientencryption.seealso">
   &reftitle.seealso;
   <simplelist>
    <member><function>MongoDB\Driver\Manager::createClientEncryption</function></member>
   </simplelist>
  </section>

 </partintro>

 &reference.mongodb.mongodb.driver.entities.clientencryption;

</phpdoc:classref>

        <!-- Keep this comment at the end of the file
        Local variables:
        mode: sgml
        sgml-omittag:t
        sgml-shorttag:t
        sgml-minimize-attributes:nil
        sgml-always-quote-attributes:t
        sgml-indent-step:1
        sgml-indent-data:t
        indent-tabs-mode:nil
        sgml-parent-document:nil
        sgml-default-dtd-file:"~/.phpdoc/manual.ced"
        sgml-exposed-tags:nil
        sgml-local-catalogs:nil
        sgml-local-ecat-files:nil
        End:
        vim600: syn=xml fen fdm=syntax fdl=2 si
        vim: et tw=78 syn=sgml
        vi: ts=1 sw=1
        -->
