public class DingTalkEncryptor extends Object
| 构造器和说明 |
|---|
DingTalkEncryptor(String token,
String encodingAesKey,
String corpId)
构造函数
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getDecryptMsg(String msgSignature,
String timeStamp,
String nonce,
String encryptMsg)
密文解密
|
Map<String,String> |
getEncryptedMap(String plaintext,
Long timeStamp,
String nonce)
将和钉钉开放平台同步的消息体加密,返回加密Map
|
String |
getSignature(String token,
String timestamp,
String nonce,
String encrypt)
数字签名
|
public DingTalkEncryptor(String token, String encodingAesKey, String corpId) throws DingTalkEncryptException
token - 钉钉开放平台上,开发者设置的tokenencodingAesKey - 钉钉开放台上,开发者设置的EncodingAESKeycorpId - ISV进行配置的时候应该传对应套件的SUITE_KEY(第一次创建时传的是默认的CREATE_SUITE_KEY),普通企业是Corpid,定制服务商传customKeyDingTalkEncryptException - 执行失败,请查看该异常的错误码和具体的错误信息public Map<String,String> getEncryptedMap(String plaintext, Long timeStamp, String nonce) throws DingTalkEncryptException
plaintext - 传递的消息体明文timeStamp - 时间戳nonce - 随机字符串DingTalkEncryptExceptionpublic String getDecryptMsg(String msgSignature, String timeStamp, String nonce, String encryptMsg) throws DingTalkEncryptException
msgSignature - 签名串timeStamp - 时间戳nonce - 随机串encryptMsg - 密文DingTalkEncryptExceptionpublic String getSignature(String token, String timestamp, String nonce, String encrypt) throws DingTalkEncryptException
token - isv tokentimestamp - 时间戳nonce - 随机串encrypt - 加密文本DingTalkEncryptExceptionCopyright © 2021 江苏南大先腾信息产业股份有限公司. All rights reserved.