sss
This commit is contained in:
@@ -19,21 +19,21 @@ class Rsa {
|
||||
}
|
||||
|
||||
|
||||
// 公钥加密
|
||||
PublicKeyEncryption(text) {
|
||||
return (new NodeRsa(this.public_key)).encrypt(JSON.stringify(text), 'base64')
|
||||
}
|
||||
// // 公钥加密
|
||||
// PublicKeyEncryption(text) {
|
||||
// return (new NodeRsa(this.public_key)).encrypt(JSON.stringify(text), 'base64')
|
||||
// }
|
||||
|
||||
// 公钥解密
|
||||
PublicKeyDecryption(text) {
|
||||
return JSON.parse((new NodeRsa(this.public_key)).decryptPublic(text, 'utf8'))
|
||||
}
|
||||
// // 公钥解密
|
||||
// PublicKeyDecryption(text) {
|
||||
// return JSON.parse((new NodeRsa(this.public_key)).decryptPublic(text, 'utf8'))
|
||||
// }
|
||||
|
||||
|
||||
// 私钥加密
|
||||
PrivateKeyEncryption(text) {
|
||||
return (new NodeRsa(this.private_key)).encryptPrivate(JSON.stringify(text), 'base64')
|
||||
}
|
||||
// // 私钥加密
|
||||
// PrivateKeyEncryption(text) {
|
||||
// return (new NodeRsa(this.private_key)).encryptPrivate(JSON.stringify(text), 'base64')
|
||||
// }
|
||||
|
||||
// 私钥解密
|
||||
PrivateKeyDecryption(text) {
|
||||
|
||||
Reference in New Issue
Block a user