package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"time"
)
func main() {
var bits int
bits = 2048
if err := GenRsaKey(bits); err != nil {
log.Fatal("密钥文件生成失败!")
}
log.Println("密钥文件生成成功!")
initData := "abcdefghijklmnopq"
init := []byte(initData)
data, err := RsaEncrypt(init)
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"time"
)
func main() {
var bits int
bits = 2048
if err := GenRsaKey(bits); err != nil {
log.Fatal("密钥文件生成失败!")
}
log.Println("密钥文件生成成功!")
initData := "abcdefghijklmnopq"
init := []byte(initData)
data, err := RsaEncrypt(init)