PHP 8.1.28 Released!

MongoDB\Driver\ClientEncryption::__construct

(mongodb >=1.14.0)

MongoDB\Driver\ClientEncryption::__constructCreate a new ClientEncryption object

Beschreibung

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

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

Parameter-Liste

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 Ein vollständig qualifizierter Namensraum (z. B. "databaseName.collectionName"), der die Kollektion bezeichnet, die alle Datenschlüssel enthält, die für Ver- und Entschlüsselung verwendet werden. Diese Option muss angegeben werden.
kmsProviders array

Ein Dokument, das die Konfiguration für einen oder mehrere KMS-Provider enthält, die verwendet werden, um Datenschlüssel zu verschlüsseln. Zu den unterstützten Providern gehören "aws", "azure", "gcp", "kmip" und "local" und wenigstens einer muss angegeben werden.

Wenn für "aws", "azure" oder "gcp" ein leeres Dokument angegeben wird, versucht der Treiber, den Provider mit » Automatic Credentials (automatische Anmeldeinformationen) zu konfigurieren.

Das Format für "aws" ist wie folgt:

aws: {
    accessKeyId: <string>,
    secretAccessKey: <string>,
    sessionToken: <optionale Zeichenkette>
}

Das Format für "azure" ist wie folgt:

azure: {
    tenantId: <string>,
    clientId: <string>,
    clientSecret: <string>,
    identityPlatformEndpoint: <optional string> // Der Standardwert ist "login.microsoftonline.com"

}

Das Format für "gcp" ist wie folgt:

gcp: {
    email: <string>,
    privateKey: <base64 string>|<MongoDB\BSON\Binary>,
    endpoint: <optional string> // Der Standardwert ist "oauth2.googleapis.com"

}

Das Format für "kmip" ist wie folgt:

kmip: {
    endpoint: <string>
}

Das Format für "local" ist wie folgt:

local: {
    // Der 96-Byte-Hauptschlüssel, der zur Ver- und Entschlüsselung von
    // Datenschlüsseln verwendet wird
    key: <base64 string>|<MongoDB\BSON\Binary>
}
tlsOptions array

Ein Dokument, das die TLS-Konfiguration für einen oder mehrere KMS-Provider enthält. Zu den unterstützten Providern gehören "aws", "azure", "gcp" und "kmip". Alle Provider unterstützen die folgenden Optionen:

<provider>: {
    tlsCaFile: <optionale Zeichenkette>,
    tlsCertificateKeyFile: <optionale Zeichenkette>,
    tlsCertificateKeyFilePassword: <optionale Zeichenkette>,
    tlsDisableOCSPEndpointCheck: <optionaler Boolean>
}

Fehler/Exceptions

Changelog

Version Beschreibung
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.

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top