def verify_request_signature(request: RequestType, public_key: Union[(str, bytes)]):
    '\n    Verify HTTP signature in request against a public key.\n    '
    key = encode_if_text(public_key)
    date_header = request.headers.get('Date')
    if (not date_header):
        raise ValueError('Rquest Date header is missing')
    ts = parse_http_date(date_header)
    dt = datetime.datetime.utcfromtimestamp(ts).replace(tzinfo=pytz.utc)
    past_delta = datetime.timedelta(hours=24)
    future_delta = datetime.timedelta(seconds=30)
    now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)
    if ((dt < (now - past_delta)) or (dt > (now + future_delta))):
        raise ValueError('Request Date is too far in future or past')
    HTTPSignatureHeaderAuth.verify(request, key_resolver=(lambda **kwargs: key))
Verify HTTP signature in request against a public key.
def verify_request_signature(request: RequestType, public_key: Union[(str, bytes)]):
    '\n    \n    '
    key = encode_if_text(public_key)
    date_header = request.headers.get('Date')
    if (not date_header):
        raise ValueError('Rquest Date header is missing')
    ts = parse_http_date(date_header)
    dt = datetime.datetime.utcfromtimestamp(ts).replace(tzinfo=pytz.utc)
    past_delta = datetime.timedelta(hours=24)
    future_delta = datetime.timedelta(seconds=30)
    now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)
    if ((dt < (now - past_delta)) or (dt > (now + future_delta))):
        raise ValueError('Request Date is too far in future or past')
    HTTPSignatureHeaderAuth.verify(request, key_resolver=(lambda **kwargs: key))