rsa

package
v0.0.0-...-cdfbdfc Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Demo

func Demo()

Demo demo

func GenerateKeys

func GenerateKeys(publicKeyWriter, privateKeyWriter io.Writer, keyLength int) error

GenerateKeys a

func LoadKeys

func LoadKeys(publicKeyReader, privateKeyReader io.Reader) ([]byte, []byte, error)

LoadKeys 加载 key

func PrivateEncrypt

func PrivateEncrypt(privt *rsa.PrivateKey, data []byte) ([]byte, error)

PrivateEncrypt a

func PublicDecrypt

func PublicDecrypt(pub *rsa.PublicKey, data []byte) ([]byte, error)

PublicDecrypt a

Types

type XRsa

type XRsa struct {
	// contains filtered or unexported fields
}

XRsa a

func NewXRsa

func NewXRsa(publicKey []byte, privateKey []byte) (*XRsa, error)

NewXRsa a

func (*XRsa) PrivateDecrypt

func (r *XRsa) PrivateDecrypt(encrypted string) (string, error)

PrivateDecrypt a

func (*XRsa) PrivateEncrypt

func (r *XRsa) PrivateEncrypt(data string) (string, error)

PrivateEncrypt a

func (*XRsa) PublicDecrypt

func (r *XRsa) PublicDecrypt(encrypted string) (string, error)

PublicDecrypt a

func (*XRsa) PublicEncrypt

func (r *XRsa) PublicEncrypt(data string) (string, error)

PublicEncrypt A

func (*XRsa) Sign

func (r *XRsa) Sign(data string) (string, error)

Sign a

func (*XRsa) Verify

func (r *XRsa) Verify(data string, sign string) error

Verify a

Jump to

Keyboard shortcuts

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