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