def check_signature(signature, private_key, full_path, payload):
    """
    Checks signature received and verifies that we are able to re-create
    it from the private key, path, and payload given.

    :param signature:
        Signature received from request.
    :param private_key:
        Base 64, url encoded private key.
    :full_path:
        Full path of request, including GET query string (excluding host)
    :payload:
        The request.POST data if present. None if not.

    :returns:
        Boolean of whether signature matched or not.
    """
    if isinstance(private_key, bytes):
        private_key = private_key.decode("ascii")

    if isinstance(payload, bytes):
        payload = payload.decode()

    url_to_check = _strip_signature_from_url(signature, full_path)
    computed_signature = apysigner.get_signature(private_key, url_to_check, payload)
    return constant_time_compare(signature, computed_signature)
def check_signature ( signature , private_key , full_path , payload ) : if isinstance ( private_key , bytes ) : private_key = private_key . decode ( "ascii" ) if isinstance ( payload , bytes ) : payload = payload . decode ( ) url_to_check = _strip_signature_from_url ( signature , full_path ) computed_signature = apysigner . get_signature ( private_key , url_to_check , payload ) return constant_time_compare ( signature , computed_signature )
Checks signature received and verifies that we are able to re-create
    it from the private key, path, and payload given.

    :param signature:
        Signature received from request.
    :param private_key:
        Base 64, url encoded private key.
    :full_path:
        Full path of request, including GET query string (excluding host)
    :payload:
        The request.POST data if present. None if not.

    :returns:
        Boolean of whether signature matched or not.