rsa

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKeyX509PKCS1

func CreateKeyX509PKCS1(bits int) (pub string, pri string)

CreateKeyX509PKCS1 生成指定长度的公钥和私钥

func Decrypt

func Decrypt(key *rsa.PrivateKey, src []byte) (data []byte, err error)

func Encrypt

func Encrypt(key *rsa.PublicKey, src []byte) (data []byte, err error)

func PrivateKeyFromX509PKCS1

func PrivateKeyFromX509PKCS1(pri string) (*rsa.PrivateKey, error)

PrivateKeyFromX509PKCS1 pri解析为 rsa.PrivateKey

func PublicKeyFromX509PKCS1

func PublicKeyFromX509PKCS1(pub string) (*rsa.PublicKey, error)

PublicKeyFromX509PKCS1 pub rsa.PublicKey

func Sign

func Sign(key *rsa.PrivateKey, src []byte) (sign []byte, err error)

func Verify

func Verify(key *rsa.PublicKey, sign, src []byte) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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