Documentation ¶
Index ¶
- func Decrypt(cipherText []byte, priKey []byte) ([]byte, error)
- func DecryptByKeyFile(cipherText []byte, priKeyFilename string) ([]byte, error)
- func Encrypt(plainText []byte, pubKey []byte) ([]byte, error)
- func EncryptByKeyFile(plainText []byte, pubKeyFilename string) ([]byte, error)
- func GenerateKey(bits int) (private []byte, public []byte, err error)
- func GenerateKeyToFile(bits int, priFilename, pubFilename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptByKeyFile ¶
DecryptByKeyFile 解密,通过密钥文件
func EncryptByKeyFile ¶
EncryptByKeyFile 加密,通过密钥文件
func GenerateKey ¶
GenerateKey 生成RSA密钥对, bits是证书长度 通过 x509 标准得到的序列化为 ASN.1 的 DER 编码字符串,然后进行pem格式编码
func GenerateKeyToFile ¶
GenerateKeyToFile 生成RSA密钥对,并保存到文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.