Documentación offline PHP master

La clase MongoDB\Driver\ClientEncryption

master Ver versión oficial en línea Licencia CC-BY-3.0Descargado el 2026-08-02

En esta página

Introducción#

La clase MongoDB\Driver\ClientEncryption gestiona la creación de claves de datos para la cifrado lado-cliente, así como el cifrado y descifrado manual de valores.

Sinopsis de la clase#

MongoDB\Driver\ClientEncryption

final

MongoDB\Driver\ClientEncryption

Constantes

const

string

MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC

AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic

const

string

MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM

AEAD_AES_256_CBC_HMAC_SHA_512-Random

const

string

MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED

Indexed

const

string

MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED

Unindexed

const

string

MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE

Range

const

string

MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY

equality

const

string

MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE

range

Métodos

Constantes predefinidas#

MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC
Especifica un algoritmo para el cifrado determinista, que es adecuado para consultas.

MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM
Especifica un algoritmo para el cifrado aleatorio

MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED
Especifica un algoritmo para un contenido cifrado indexado, que puede usarse con cifrado consultable.

Para insertar o consultar con un contenido cifrado indexado, el MongoDB\Driver\Manager debe configurarse con la opción de controlador "autoEncryption". La opción de auto-cifrado "bypassQueryAnalysis" puede ser true. La opción de auto-cifrado "bypassAutoEncryption" debe ser false.

MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED
Especifica un algoritmo para un contenido cifrado no indexado.

MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE
Especifica un algoritmo para un contenido cifrado de rango, que puede usarse con cifrado consultable.

Para consultar con un contenido cifrado de rango, el MongoDB\Driver\Manager debe configurarse con la opción de controlador "autoEncryption". La opción de auto-cifrado "bypassQueryAnalysis" puede ser true. La opción de auto-cifrado "bypassAutoEncryption" debe ser false.

[!NOTE] La extensión aún no admite consultas de rango para tipos de campo BSON Decimal128.

MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY
Especifica un tipo de consulta de igualdad, que se usa en conjunto con MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED.

MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE
Especifica un tipo de consulta de rango, que se usa en conjunto con MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE.

Historial de cambios#

Versión Descripción
PECL mongodb 2.0.0

Se eliminó MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW y MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW.

PECL mongodb 1.20.0

Se añadió MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE y MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE.

Se declaró obsoleto MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW y MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW.

PECL mongodb 1.16.0 Se añadió MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW y MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW.
PECL mongodb 1.14.0 Se añadió MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED, MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED, y MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY.

Véase también#

MongoDB\Driver\Manager::createClientEncryption