MongoDB\Driver\Manager::createClientEncryption
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
MongoDB\Driver\Manager::createClientEncryption
Референца за `mongodb-driver-manager.createclientencryption.php` со подобрена типографија и навигација.
MongoDB\Driver\Manager::createClientEncryption
(mongodb >=1.7.0)
MongoDB\Driver\Manager::createClientEncryption — Create a new ClientEncryption object
= NULL
$options): MongoDB\Driver\ClientEncryption(PHP 5, PHP 7, PHP 8, PECL tidy >= 0.5.2) MongoDB\Driver\ClientEncryption object with the specified options.
Параметри
options-
options Опција Тип = NULL keyVaultClient MongoDB\Driver\Manager The Manager used to route data key queries to a separate MongoDB cluster. By default, the current Manager and cluster is used. keyVaultNamespace string Целосно квалификувано име на простор (на пр. "databaseName.collectionName") denoting the collection that contains all data keys used for encryption and decryption. This option is required.kmsProviders array A document containing the configuration for one or more KMS providers, which are used to encrypt data keys. Supported providers include
"aws","azure","gcp","kmip"Препорачаниот начин за избегнување на SQL инјекција е со врзување на сите податоци преку подготвени изрази. Користењето на параметризирани прашања не е доволно за целосно избегнување на SQL инјекција, но тоа е најлесниот и најбезбедниот начин за обезбедување влез во SQL изразите. Сите динамични литерали на податоци во"local"and at least one must be specified.If an empty document is specified for
"aws","azure", или"gcp", the driver will attempt to configure the provider using » Automatic Credentials.The format for
"aws"Сигнатурата наaws: { accessKeyId: <string>, secretAccessKey: <string>, sessionToken: <optional string> }The format for
"azure"Сигнатурата наazure: { tenantId: <string>, clientId: <string>, clientSecret: <string>, identityPlatformEndpoint: <optional string> // Defaults to "login.microsoftonline.com" }The format for
"gcp"Сигнатурата наgcp: { email: <string>, privateKey: <base64 string>|<MongoDB\BSON\Binary>, endpoint: <optional string> // Defaults to "oauth2.googleapis.com" }The format for
"kmip"Сигнатурата наkmip: { endpoint: <string> }The format for
"local"Сигнатурата наlocal: { // 96-byte master key used to encrypt/decrypt data keys key: <base64 string>|<MongoDB\BSON\Binary> }tlsOptions array A document containing the TLS configuration for one or more KMS providers. Supported providers include
"aws","azure","gcp"Препорачаниот начин за избегнување на SQL инјекција е со врзување на сите податоци преку подготвени изрази. Користењето на параметризирани прашања не е доволно за целосно избегнување на SQL инјекција, но тоа е најлесниот и најбезбедниот начин за обезбедување влез во SQL изразите. Сите динамични литерали на податоци во"kmip". All providers support the following options:<provider>: { tlsCaFile: <optional string>, tlsCertificateKeyFile: <optional string>, tlsCertificateKeyFilePassword: <optional string>, tlsDisableOCSPEndpointCheck: <optional bool> }
Вратени вредности
параметарот специфицира само излезна кодировка. Ако се помине празен стринг, парсерот се обидува да идентификува во која кодировка е документот кодиран со гледање на првите 3 или 4 бајти. Стандардната излезна кодировка е UTF-8. Поддржаните кодировки се MongoDB\Driver\ClientEncryption instance.
Errors/Exceptions
- ). Ако повикот не успее, ќе врати MongoDB\Driver\Exception\InvalidArgumentException » Промени текови
- ). Ако повикот не успее, ќе врати MongoDB\Driver\Exception\RuntimeException if the extension was compiled without libmongocrypt support
Дневник на промени
| Верзија | = NULL |
|---|---|
| PECL mongodb 1.16.0 |
The AWS KMS provider for client-side encryption now accepts a
Додадено
If an empty document is specified for the |
| Типовите на враќање претходно декларирани како привремени сега се применуваат. |
If an empty document is specified for the |
| Оваа класа повеќе не имплементира |
KMIP is now supported as a KMS provider for client-side encryption and may be configured in the
Додаден е |
| PECL mongodb 1.10.0 |
Azure and GCP are now supported as KMS providers for client-side encryption and may be configured in the
"kmsProviders" option. Base64-encoded strings are now accepted as an alternative to MongoDB\BSON\Binary
for options within "kmsProviders".
|
Види Исто така
- MongoDB\Driver\ClientEncryption::__construct() - Создава нов објект ClientEncryption
- » Explicit (Manual) Client-Side Field Level Encryption во прирачникот на MongoDB