MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / decrypt

Method decrypt

pymongo/asynchronous/encryption.py:479–488  ·  view source on GitHub ↗

Decrypt a MongoDB command response. :param response: A MongoDB command response as BSON. :return: The decrypted command response.

(self, response: bytes | memoryview)

Source from the content-addressed store, hash-verified

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:

Callers 3

commandFunction · 0.45
run_operationMethod · 0.45
decryptMethod · 0.45

Calls 2

_check_closedMethod · 0.95
_wrap_encryption_errorsFunction · 0.70

Tested by

no test coverage detected