crypto

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RSADecrypt

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

RSA解密 cipherText 需要解密的byte数据 path 私钥文件路径

func RSADecryptWithFile

func RSADecryptWithFile(cipherText []byte, priKeyPath string) ([]byte, error)

RSA解密 cipherText 需要解密的byte数据 priKeyPath 私钥文件路径

func RSAEncrypt

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

RSA加密 plainText 要加密的数据 path 公钥匙文件地址

func RSAEncryptWithFile

func RSAEncryptWithFile(plainText []byte, pubKeyPath string) ([]byte, error)

RSA加密 plainText 要加密的数据 pubKeyPath 公钥匙文件地址

func RSAGenerateKey

func RSAGenerateKey(bits int, priKeyFile, pubKeyFile string) error

openssl genrsa -out rsa_private_key.pem 2048 openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem openssl pkcs8 -topk8 -in rsa_private_key.pem -out pkcs8_rsa_private_key.pem -nocrypt 生成RSA私钥和公钥,保存到文件中 bits 证书大小

Types

This section is empty.

Jump to

Keyboard shortcuts

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