The MongoDB\Driver\ClientEncryption class
The MongoDB\Driver\ClientEncryption class handles creation of data keys for client-side encryption, as well as manually encrypting and decrypting values.
Intro
The MongoDB\Driver\ClientEncryption class handles creation of data keys for client-side encryption, as well as manually encrypting and decrypting values.
Class synopsis
Predefined Constants
MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTICSpecifies an algorithm for deterministic encryption, which is suitable for querying.
MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOMSpecifies an algorithm for randomized encryption
MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXEDSpecifies an algorithm for an indexed, encrypted payload, which can be used with queryable encryption.
To insert or query with an indexed, encrypted payload, the
MongoDB\Driver\Managermust be configured with the"autoEncryption"driver option. The"bypassQueryAnalysis"auto encryption option may be true. The"bypassAutoEncryption"auto encryption option must be false.MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXEDSpecifies an algorithm for an unindexed, encrypted payload.
MongoDB\Driver\ClientEncryption::ALGORITHM_RANGESpecifies an algorithm for a range encrypted payload, which can be used with queryable encryption.
To query with a range encrypted payload, the
MongoDB\Driver\Managermust be configured with the"autoEncryption"driver option. The"bypassQueryAnalysis"auto encryption option may be true. The"bypassAutoEncryption"auto encryption option must be false.NoteThe extension does not yet support range queries for Decimal128 BSON field types.
MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITYSpecifies an equality query type, which is used in conjunction with
MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED.MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGESpecifies a range query type, which is used in conjunction with
MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE.
Changelog
| Version | Description |
|---|---|
| PECL mongodb 2.0.0 | Removed MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW and MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW. |
| PECL mongodb 1.20.0 | Added MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE and MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE.Deprecated MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW and MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW. |
| PECL mongodb 1.16.0 | Added MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW and MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW. |
| PECL mongodb 1.14.0 | Added MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED, MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED, and MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY. |
See Also
Clientencryption