def test_loaded_key_infos(): cmp = _kms_cmp(material_description={}) assert cmp._content_key_info == KeyInfo.from_description( _DEFAULT_CONTENT_ENCRYPTION_ALGORITHM) assert cmp._signing_key_info == KeyInfo.from_description( _DEFAULT_SIGNING_ALGORITHM) assert cmp._regional_clients == {}
def test_derive_encryption_key(default_kms_cmp, description, method_name, key_name): key_info = KeyInfo.from_description(description) test = getattr(default_kms_cmp, method_name)( initial_material=_DERIVED_KEYS["initial_material"], key_info=key_info) assert test.key == _DERIVED_KEYS[key_name]
def test_key_info_from_description_fails(): with pytest.raises(ValueError): KeyInfo.from_description(description="AES")