aesRsaEncrypt static method
AES+RSA混合解密
aesKey 长度为32的AES的密钥
publicKey Rsa的公钥
data 需要加密的内容
Implementation
static Map<String, String>? aesRsaEncrypt(
String aesKey,
String publicKey,
String data,
) {
try {
var encryptData = aesEncrypt(aesKey, data);
if (encryptData == null) return null;
var encryptAesKey = rsaEncrypt(publicKey, aesKey);
if (encryptAesKey == null) return null;
return {"key": encryptAesKey, "data": encryptData};
} catch (e) {
return null;
}
}