Files
encryptx/rsax/rsax_test.go
T
2023-12-27 19:00:14 +08:00

20 lines
330 B
Go

package rsax_test
import (
"fmt"
"testing"
"code.yun.ink/pkg/encryptx/rsax"
)
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))
}