rsa

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 EncryptByDefaultPublicKey added in v1.9.9

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

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