封装的方法类
This commit is contained in:
@@ -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))
|
||||
}
|
||||
Reference in New Issue
Block a user