ec_rsa

package
v0.0.0-...-7ce39f2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(src []byte, privateKey *rsa.PrivateKey) ([]byte, error)

rsa私匙解密

func DecryptByPem

func DecryptByPem(src []byte, file string) ([]byte, error)

DecryptByPem 通过Pem文件解码

func Encrypt

func Encrypt(src []byte, publickey *rsa.PublicKey) ([]byte, error)

rsa公匙加密

func GenKeys

func GenKeys(bits int) (privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey, err error)

func GenPemFiles

func GenPemFiles(dir string, bits int) error

GenPemFiles

func GenPems

func GenPems(privateKeyWriter, publicKeyWriter io.Writer, bits int) error

GenPems 产生公钥私钥对应的pem文件

func JSEncrypt

func JSEncrypt(msg string, privateData []byte) string

JSEncrypt 用于用户名、密码解密

func JSEncryptByPem

func JSEncryptByPem(msg string, privatePemPath string) string

RSA_JSEncrypt 用于用户名、密码解密

func PrivateKeyFromBytes

func PrivateKeyFromBytes(priByte []byte) (*rsa.PrivateKey, error)

解析私匙

func PrivateKeyFromFile

func PrivateKeyFromFile(file string) (*rsa.PrivateKey, error)

解析私匙

func PublicKeyFromBytes

func PublicKeyFromBytes(pubByte []byte) (*rsa.PublicKey, error)

解析公匙

func PublicKeyFromFile

func PublicKeyFromFile(file string) (*rsa.PublicKey, error)

解析公匙

Types

This section is empty.

Jump to

Keyboard shortcuts

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