Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if not lib.mongocrypt_setopt_kms_provider_aws(
self.__crypt,
access_key_id, len(access_key_id),
secret_access_key, len(secret_access_key)):
self.__raise_from_status()
if 'local' in kms_providers:
key = kms_providers['local']['key']
with MongoCryptBinaryIn(key) as binary_key:
if not lib.mongocrypt_setopt_kms_provider_local(
self.__crypt, binary_key.bin):
self.__raise_from_status()
schema_map = self.__opts.schema_map
if schema_map is not None:
with MongoCryptBinaryIn(schema_map) as binary_schema_map:
if not lib.mongocrypt_setopt_schema_map(
self.__crypt, binary_schema_map.bin):
self.__raise_from_status()
if not lib.mongocrypt_setopt_crypto_hooks(
self.__crypt, aes_256_cbc_encrypt, aes_256_cbc_decrypt,
secure_random, hmac_sha_512, hmac_sha_256, sha_256, ffi.NULL):
self.__raise_from_status()
if not lib.mongocrypt_init(self.__crypt):
self.__raise_from_status()