Gets all key documents

- « MongoDB\Driver\ClientEncryption::getKeyByAltName

- MongoDB\Driver\ClientEncryption::removeKeyAltName »

- PHP Manual
- MongoDB\Driver\ClientEncryption
- Gets all key documents

# MongoDB\Driver\ClientEncryption::getKeys

(mongodb >=1.15.0)

MongoDB\Driver\ClientEncryption::getKeys — Gets all key documents

### Description

final public MongoDB\Driver\ClientEncryption::getKeys(): MongoDB\Driver\Cursor

Finds all key documents in the key vault collection.

### Parameters

This function has no parameters.

### Return Values

Returns MongoDB\Driver\Cursor on success.

### Errors/Exceptions

- Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors.
- Throws MongoDB\Driver\Exception\ConnectionException if connection to the server fails (for reasons other than authentication).
- Throws MongoDB\Driver\Exception\AuthenticationException if authentication is needed and fails.
- Throws MongoDB\Driver\Exception\RuntimeException on other errors.