def validate_request_certificate(headers, data):
<EOL>if '<STR_LIT>' not in headers or'<STR_LIT>' not in headers:<EOL><INDENT>log.error('<STR_LIT>')<EOL>return False<EOL><DEDENT>cert_url = headers['<STR_LIT>']<EOL>sig = base64.b64decode(headers['<STR_LIT>'])<EOL>cert = _get_certificate(cert_url)<EOL>if not cert:<EOL><INDENT>return False<EOL><DEDENT>try:<EOL><INDENT>crypto.verify(cert, sig, data, '<STR_LIT>')<EOL>return True<EOL><DEDENT>except:<EOL><INDENT>log.error('<STR_LIT>')<EOL>return False<EOL><DEDENT>
Ensure that the certificate and signature specified in the
    request headers are truely from Amazon and correctly verify.

    Returns True if certificate verification succeeds, False otherwise.

    :param headers: Dictionary (or sufficiently dictionary-like) map of request
        headers.
    :param data: Raw POST data attached to this request.