rsa

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 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

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

func Encrypt

func Encrypt(plainText []byte) []byte

RSA加密 plainText 要加密的数据

func EncryptByDefaultPublicKey

func EncryptByDefaultPublicKey(plainText []byte) (cryptText []byte, err error)

func EncryptByPublicKey

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

func GetRsaKey

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