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

Method decrypt

pymongo/synchronous/encryption.py:476–485  ·  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

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:

Callers 15

test_encrypt_decryptMethod · 0.45
test_validationMethod · 0.45
test_codec_optionsMethod · 0.45
test_closeMethod · 0.45
_test_corpusMethod · 0.45
_test_explicitMethod · 0.45
run_testMethod · 0.45
run_test_casesMethod · 0.45

Calls 2

_check_closedMethod · 0.95
_wrap_encryption_errorsFunction · 0.70

Tested by 15

test_encrypt_decryptMethod · 0.36
test_validationMethod · 0.36
test_codec_optionsMethod · 0.36
test_closeMethod · 0.36
_test_corpusMethod · 0.36
_test_explicitMethod · 0.36
run_testMethod · 0.36
run_test_casesMethod · 0.36