MongoDB\Driver\ClientEncryption::__construct

(mongodb >=1.14.0)

MongoDB\Driver\ClientEncryption::__construct — Create a new ClientEncryption object

Descrizione

final public function MongoDB\Driver\ClientEncryption::__construct(array $options)

Constructs a new MongoDB\Driver\ClientEncryption object with the specified options.

Elenco dei parametri

options

options
Option Type Description
keyVaultClient MongoDB\Driver\Manager The Manager used to route data key queries. This option is required (unlike with MongoDB\Driver\Manager::createClientEncryption()).
keyVaultNamespace string Un namespace completamente qualificato (ad es. "databaseName.collectionName") che indica la collezione che contiene tutte le chiavi dati usate per la cifratura e la decifratura. Questa opzione è obbligatoria.
kmsProviders array Un documento contenente la configurazione di uno o più provider KMS, usati per cifrare le chiavi dati. I provider supportati includono "aws", "azure", "gcp", "kmip" e "local" e se ne deve specificare almeno uno. Se viene specificato un documento vuoto per "aws", "azure" o "gcp", il driver tenterà di configurare il provider usando le » Automatic Credentials. Il formato per "aws" è il seguente:
aws: {
    accessKeyId: <string>,
    secretAccessKey: <string>,
    sessionToken: <optional string>
}
Il formato per "azure" è il seguente:
azure: {
    tenantId: <string>,
    clientId: <string>,
    clientSecret: <string>,
    identityPlatformEndpoint: <optional string> // Il valore predefinito è "login.microsoftonline.com"
}
Il formato per "gcp" è il seguente:
gcp: {
    email: <string>,
    privateKey: <base64 string>|<MongoDB\BSON\Binary>,
    endpoint: <optional string> // Il valore predefinito è "oauth2.googleapis.com"
}
Il formato per "kmip" è il seguente:
kmip: {
    endpoint: <string>
}
Il formato per "local" è il seguente:
local: {
    // master key di 96 byte usata per cifrare/decifrare le chiavi dati
    key: <base64 string>|<MongoDB\BSON\Binary>
}
tlsOptions array Un documento contenente la configurazione TLS di uno o più provider KMS. I provider supportati includono "aws", "azure", "gcp" e "kmip". Tutti i provider supportano le seguenti opzioni:
<provider>: {
    tlsCaFile: <optional string>,
    tlsCertificateKeyFile: <optional string>,
    tlsCertificateKeyFilePassword: <optional string>,
    tlsDisableOCSPEndpointCheck: <optional bool>
}

Errori/Eccezioni

Log delle modifiche

Versione Descrizione
PECL mongodb 1.16.0 The AWS KMS provider for client-side encryption now accepts a "sessionToken" option, which can be used to authenticate with temporary AWS credentials. Added "tlsDisableOCSPEndpointCheck" to the "tlsOptions" option. If an empty document is specified for the "azure" or "gcp" KMS provider, the driver will attempt to configure the provider using » Automatic Credentials.
PECL mongodb 1.15.0 If an empty document is specified for the "aws" KMS provider, the driver will attempt to configure the provider using » Automatic Credentials.

Vedere anche:

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top