public class WxCpCryptUtil extends WxCryptUtil
WxCryptUtil.EncryptContext
aesKey, appidOrCorpid, token
构造器和说明 |
---|
WxCpCryptUtil(WxCpConfigStorage wxCpConfigStorage)
Instantiates a new Wx cp crypt util.
|
限定符和类型 | 方法和说明 |
---|---|
static String |
decryptPriKey(String encryptRandomKey,
String msgAuditPriKey,
Integer pkcs1)
判断使用PKCS8或者PKCS1进行解密
|
static String |
decryptPriKeyByPKCS1(String encryptRandomKey,
String msgAuditPriKey)
会话存档,PKCS1 解密私钥
企业获取的会话内容将用公钥加密,企业用自行保存的私钥解开会话内容数据
|
static String |
decryptPriKeyByPKCS8(String encryptRandomKey,
String msgAuditPriKey)
PKCS8 解密私钥
|
decrypt, decrypt, decryptContent, decryptXml, encrypt, encrypt, encryptContext
public WxCpCryptUtil(WxCpConfigStorage wxCpConfigStorage)
wxCpConfigStorage
- the wx cp config storagepublic static String decryptPriKey(String encryptRandomKey, String msgAuditPriKey, Integer pkcs1) throws Exception
encryptRandomKey
- 使用PUBLICKEY_VER指定版本的公钥进行非对称加密后base64加密的内容msgAuditPriKey
- 会话存档私钥pkcs1
- 使用什么方式进行解密,1代表使用PKCS1进行解密,2代表PKCS8进行解密 ...Exception
- the exceptionpublic static String decryptPriKeyByPKCS8(String encryptRandomKey, String msgAuditPriKey) throws Exception
encryptRandomKey
- the encrypt random keymsgAuditPriKey
- the msg audit pri keyException
- the exceptionpublic static String decryptPriKeyByPKCS1(String encryptRandomKey, String msgAuditPriKey) throws Exception
encryptRandomKey
- 使用PUBLICKEY_VER指定版本的公钥进行非对称加密后base64加密的内容,需要业务方先base64
decode处理后,再使用指定版本的私钥进行解密,得出内容。String类型msgAuditPriKey
- 会话存档私钥Exception
- the exceptionCopyright © 2024. All rights reserved.