@@ -638,16 +638,19 @@ public static WxMaMessage fromEncryptedJson(String encryptedJson, WxMaConfig con
638638 * @param nonce 随机串
639639 * @param msgSignature 签名串
640640 */
641- public static WxMaMessage fromEncryptedJson (String encryptedJson , WxMaConfig config ,
642- String timestamp , String nonce , String msgSignature ) {
643- try {
644- WxMaMessage encryptedMessage = fromJson (encryptedJson );
645- String plainText = new WxMaCryptUtils (config ).decryptContent (msgSignature , timestamp , nonce ,
646- encryptedMessage .getEncrypt ());
647- return fromJson (plainText );
648- } catch (Exception e ) {
649- throw new WxRuntimeException (e );
650- }
641+ public static WxMaMessage fromEncryptedJson (String encryptedJson , WxMaConfig config ,
642+ String timestamp , String nonce , String msgSignature ) {
643+ try {
644+ WxMaMessage encryptedMessage = fromJson (encryptedJson );
645+ String plainText = new WxMaCryptUtils (config ).decryptContent (msgSignature , timestamp , nonce ,
646+ encryptedMessage .getEncrypt ());
647+ return fromJson (plainText );
648+ } catch (WxRuntimeException e ) {
649+ throw e ;
650+ } catch (Exception e ) {
651+ throw new WxRuntimeException (e );
652+ }
653+ }
651654 }
652655
653656 public static WxMaMessage fromEncryptedJson (InputStream inputStream , WxMaConfig config ) {
0 commit comments