File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 66import me .chanjar .weixin .common .util .xml .XStreamCDataConverter ;
77import me .chanjar .weixin .cp .bean .outxmlbuilder .*;
88import me .chanjar .weixin .cp .config .WxCpConfigStorage ;
9+ import me .chanjar .weixin .cp .config .WxCpTpConfigStorage ;
910import me .chanjar .weixin .cp .util .crypto .WxCpCryptUtil ;
11+ import me .chanjar .weixin .cp .util .crypto .WxCpTpCryptUtil ;
1012import me .chanjar .weixin .cp .util .xml .XStreamTransformer ;
1113
1214import java .io .Serializable ;
@@ -141,4 +143,15 @@ public String toEncryptedXml(WxCpConfigStorage wxCpConfigStorage) {
141143 WxCpCryptUtil pc = new WxCpCryptUtil (wxCpConfigStorage );
142144 return pc .encrypt (plainXml );
143145 }
146+
147+ /**
148+ * 企业微信服务商 转换加密的xml 格式
149+ * @param wxCpTpConfigStorage th wx cp tp config storage
150+ * @return the string
151+ */
152+ public String toEncryptedXml (WxCpTpConfigStorage wxCpTpConfigStorage ) {
153+ String plainXml = toXml ();
154+ WxCpTpCryptUtil pc = new WxCpTpCryptUtil (wxCpTpConfigStorage );
155+ return pc .encrypt (plainXml );
156+ }
144157}
You can’t perform that action at this time.
0 commit comments