rsa

package
v0.0.0-...-5c98b36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2022 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipherText []byte, priKey []byte) ([]byte, error)

Decrypt 解密

func DecryptByKeyFile

func DecryptByKeyFile(cipherText []byte, priKeyFilename string) ([]byte, error)

DecryptByKeyFile 解密,通过密钥文件

func Encrypt

func Encrypt(plainText []byte, pubKey []byte) ([]byte, error)

Encrypt 加密

func EncryptByKeyFile

func EncryptByKeyFile(plainText []byte, pubKeyFilename string) ([]byte, error)

EncryptByKeyFile 加密,通过密钥文件

func GenerateKey

func GenerateKey(bits int) (private []byte, public []byte, err error)

GenerateKey 生成RSA密钥对, bits是证书长度 通过 x509 标准得到的序列化为 ASN.1 的 DER 编码字符串,然后进行pem格式编码

func GenerateKeyToFile

func GenerateKeyToFile(bits int, priFilename, pubFilename string) error

GenerateKeyToFile 生成RSA密钥对,并保存到文件

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL