def check_signature(token, signature, timestamp, nonce):
signer = WeChatSigner()<EOL>signer.add_data(token, timestamp, nonce)<EOL>if signer.signature != signature:<EOL><INDENT>from wechatpy.exceptions import InvalidSignatureException<EOL>raise InvalidSignatureException()<EOL><DEDENT>
Check WeChat callback signature, raises InvalidSignatureException
    if check failed.

    :param token: WeChat callback token
    :param signature: WeChat callback signature sent by WeChat server
    :param timestamp: WeChat callback timestamp sent by WeChat server
    :param nonce: WeChat callback nonce sent by WeChat sever