(mongodb >=1.14.0)
MongoDB\Driver\ClientEncryption::__construct — Create a new ClientEncryption object
Constructs a new MongoDB\Driver\ClientEncryption object with the specified 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>
}
"azure" è il seguente:
azure: {
tenantId: <string>,
clientId: <string>,
clientSecret: <string>,
identityPlatformEndpoint: <optional string> // Il valore predefinito è "login.microsoftonline.com"
}
"gcp" è il seguente:
gcp: {
email: <string>,
privateKey: <base64 string>|<MongoDB\BSON\Binary>,
endpoint: <optional string> // Il valore predefinito è "oauth2.googleapis.com"
}
"kmip" è il seguente:
kmip: {
endpoint: <string>
}
"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>
}
|
| 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.
|