使用jsencrypt 解密字符串过长后解密内容为Null 求解怎么办??
地址jsencrypt :https://github.com/travist/js...
网站找了一些但是都不能用 很多都是不全的
求解这个问题怎么解决啊?
import JSEncrypt from 'jsencrypt';
var RSA = new JSEncrypt();
/*
解密数据
* content 内容(String)
* mode 方法(String)
* */
static decrypt(content,mode='RSA'){
if(!content){
console.log("输入内容为空");
return "";
}
let res;
let key;
switch(mode){
case 'RSA':
//开发测试解密
key = "XXX"
console.log('要解密的内容',content);
RSA.setPrivateKey(key);
res = RSA.decrypt(content);
console.log("解密后的数据res",res);//这里打印出来是null 因为太长了
break;
}
return res;
}
慕森王
慕尼黑5688855
呼如林
紫衣仙女
相关分类