Decrypt a MongoDB command response. :param response: A MongoDB command response as BSON. :return: The decrypted command response.
(self, response: bytes | memoryview)
| 474 | return _inflate_bson(encrypted_cmd, DEFAULT_RAW_BSON_OPTIONS) |
| 475 | |
| 476 | def decrypt(self, response: bytes | memoryview) -> Optional[bytes]: |
| 477 | """Decrypt a MongoDB command response. |
| 478 | |
| 479 | :param response: A MongoDB command response as BSON. |
| 480 | |
| 481 | :return: The decrypted command response. |
| 482 | """ |
| 483 | self._check_closed() |
| 484 | with _wrap_encryption_errors(): |
| 485 | return cast(bytes, self._auto_encrypter.decrypt(response)) |
| 486 | |
| 487 | def _check_closed(self) -> None: |
| 488 | if self._closed: |