封装的方法类

This commit is contained in:
Yun
2023-09-16 20:14:20 +08:00
commit 1bbc7db405
59 changed files with 3671 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package rsax_test
import (
"fmt"
"yunink/app/pkg/encryptx/rsax"
"testing"
)
func TestRsa(t *testing.T) {
//加密
data := []byte("hello world")
encrypt := rsax.RSA_Encrypt(data, "public.pem")
fmt.Println(string(encrypt))
// 解密
decrypt := rsax.RSA_Decrypt(encrypt, "private.pem")
fmt.Println(string(decrypt))
}