

def validate(self, bucket, key, public_key, digest_data, inflated_digest):
    'Validates a digest file.\n\n        Throws a DigestError when the digest is invalid.\n\n        :param bucket: Bucket of the digest file\n        :param key: Key of the digest file\n        :param public_key: Public key bytes.\n        :param digest_data: Dict of digest data returned when JSON\n            decoding a manifest.\n        :param inflated_digest: Inflated digest file contents as bytes.\n        '
    try:
        decoded_key = base64.b64decode(public_key)
        public_key = rsa.PublicKey.load_pkcs1(decoded_key, format='DER')
        to_sign = key._create_string_to_sign(digest_data, inflated_digest)
        signature_bytes = binascii.unhexlify(digest_data['_signature'])
        rsa.verify(to_sign, signature_bytes, public_key)
    except PyAsn1Error:
        raise DigestError(('Digest file\ts3://%s/%s\tINVALID: Unable to load PKCS #1 key with fingerprint %s' % (bucket, key, digest_data['digestPublicKeyFingerprint'])))
    except rsa.pkcs1.VerificationError:
        raise DigestSignatureError(bucket, key)

dataset/ETHPy150Open aws/aws-cli/awscli/customizations/cloudtrail/validation.py Sha256RSADigestValidator.validate/VarMisuse@52/223 `self`->`key`