怎么在阅读里实现非对称加密 #2877
Closed
xingluo233
started this conversation in
General
怎么在阅读里实现非对称加密
#2877
Replies: 2 comments 5 replies
-
//调用hutool
var javaImport = new JavaImporter();
javaImport.importPackage(
Packages.java.lang,
Packages.android.util,
Packages.cn.hutool.crypto.asymmetric
);
with(javaImport){
// key可传String byteArray
function decryptWithPublicKey(privateKey, publicKey, bytesOrString){
var rsa= RSA(privateKey, publicKey)
return rsa.decrypt(bytesOrString, KeyType.PublicKey)
//return byteArray 要返回String 改成rsa.decryptStr(.....
}
} |
Beta Was this translation helpful? Give feedback.
5 replies
-
重新打开一下阅读 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我最近写某个软件的源,碰到了RSA加密,但是我不会Java,不会使用hutool实现rsa加密,有大佬能给个例子吗
Beta Was this translation helpful? Give feedback.
All reactions