mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-27 20:14:52 +08:00
♻️ 过时语义不清晰的 decrypt 方法
This commit is contained in:
@ -259,7 +259,9 @@ public class WxCryptUtil {
|
||||
* @param nonce 随机串,对应URL参数的nonce
|
||||
* @param encryptedXml 包含 Encrypt 密文的 xml,对应POST请求的数据
|
||||
* @return 解密后的原文
|
||||
* @deprecated 由于语义不清晰,置为过时方法,请查看替代方法 {@link #decryptXml}
|
||||
*/
|
||||
@Deprecated
|
||||
public String decrypt(String msgSignature, String timeStamp, String nonce, String encryptedXml) {
|
||||
return decryptXml(msgSignature, timeStamp, nonce, encryptedXml);
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class WxCryptUtilTest {
|
||||
|
||||
String encrypt = nodelist1.item(0).getTextContent();
|
||||
String fromXML = String.format(this.xmlFormat, encrypt);
|
||||
pc.decrypt("12345", this.timestamp, this.nonce, fromXML); // 这里签名错误
|
||||
pc.decryptXml("12345", this.timestamp, this.nonce, fromXML); // 这里签名错误
|
||||
} catch (RuntimeException e) {
|
||||
assertEquals(e.getMessage(), "加密消息签名校验失败");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user