rsa

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = &http.Client{
	Transport: NewSignTransport(http.DefaultTransport),
}

DefaultClient ...

Functions

func Decrypt

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

RSA解密 cipherText 需要解密的byte数据

func DecryptByPrivateKey added in v1.9.9

func DecryptByPrivateKey(cryptText, key []byte) (plainText []byte, err error)

func Encrypt

func Encrypt(plainText []byte) []byte

RSA加密 plainText 要加密的数据

func EncryptByPublicKey added in v1.9.9

func EncryptByPublicKey(plainText, key []byte) (cryptText []byte, err error)

func GetRsaKey added in v1.9.9

func GetRsaKey() (error, []byte, []byte)

func LoadPrivKey

func LoadPrivKey(filename string) (err error)

LoadPrivKey ...

func LoadPubKey

func LoadPubKey(filename string) (err error)

LoadPubKey ...

func NewSignTransport

func NewSignTransport(t http.RoundTripper) http.RoundTripper

NewSignTransport ...

func VerifyHTTPRequest

func VerifyHTTPRequest(req *http.Request) (err error)

VerifyHTTPRequest ...

Types

type SignTransport

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

SignTransport ...

func (*SignTransport) RoundTrip

func (t *SignTransport) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip ...

Jump to

Keyboard shortcuts

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