WXBizMsgCrypt { public String VerifyURL(String msgSignature, String timeStamp, String nonce, String echoStr) throws AesException { String signature = SHA1.getSHA1(token, timeStamp, nonce, echoStr); if (!signature.equals(msgSignature)) { throw new AesException(AesException.ValidateSignatureError); } String result = decrypt(echoStr); return result; } WXBizMsgCrypt(String token, String encodingAesKey, String CorpId); String EncryptMsg(String replyMsg, String timeStamp, String nonce); String DecryptMsg(String msgSignature, String timeStamp, String nonce, String postData); String VerifyURL(String msgSignature, String timeStamp, String nonce, String echoStr);  }
@Test public void testVerifyUrl() throws AesException { WXBizMsgCrypt wxcpt = new WXBizMsgCrypt("QDG6eK", "jWmYm7qr5nMoAUwZRjGtBxmz3KA1tkAj3ykkR6q2B2C", "wx5823bf96d3bd56c7"); String verifyMsgSig = "5c45ff5e21c57e6ad56bac8758b79b1d9ac89fd3"; String timeStamp = "1409659589"; String nonce = "263014780"; String echoStr = "P9nAzCzyDtyTWESHep1vC5X9xho/qYX3Zpb4yKa9SKld1DsH3Iyt3tP3zNdtp+4RPcs8TgAE7OaBO+FZXvnaqQ=="; wxcpt.VerifyURL(verifyMsgSig, timeStamp, nonce, echoStr); }