def _raw_rsa_providers()

in features/awses_message_encryption_utils.py [0:0]


def _raw_rsa_providers(keys):
    """Build all RSA Raw Master Key configurations to test.

    :param dict keys: Parsed keys manifest
    """

    def _key_builder(name, key):
        return {
            "type": "raw",
            "key": name,
            "provider-id": "aws-raw-vectors-persistant",
            "encryption-algorithm": "rsa",
        }

    cyclable, encrypt_only = _split_on_decryptable(
        keys, functools.partial(_keys_for_algorithm, "rsa"), _key_builder
    )

    for key in cyclable:
        for padding_config in RAW_RSA_PADDING_ALGORITHMS:
            # Single RSA Asymmetric Static Raw MasterKey, which can be decrypted
            _key = key.copy()
            _key.update(padding_config)
            yield (_key,)

            # Multiple Asymmetric Raw MasterKeys, only one of which can be decrypted
            for blackhole in encrypt_only:
                _blackhole_key = blackhole.copy()
                _blackhole_key.update(RAW_RSA_BLACKHOLE_ARGUMENTS_OVERRIDE)
                yield (_key, _blackhole_key)