php8.5
Home/ Manual/ driver / clientencryption/ MongoDB\Driver\ClientEncryption::getKey

MongoDB\Driver\ClientEncryption::getKey

PHP function Edit on GitHub ✎

(mongodb >=1.15.0)

Gets a key document

Description

MongoDB\Driver\ClientEncryption::getKey(MongoDB\BSON\Binary $keyId): object|null

Finds a single key document in the key vault collection with the given UUID keyId.

Parameters

keyId

A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document.

Return Values

Returns the key document, or null if no document matched.

Errors/Exceptions

  • Throws MongoDB\Driver\Exception\RuntimeException on other errors.

Source: reference/mongodb/mongodb/driver/clientencryption/getkey.xml · from the official PHP manual (php/doc-en)