rsax

package
v0.0.0-...-8deeed5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHAR_SET               = "UTF-8"
	BASE_64_FORMAT         = "UrlSafeNoPadding"
	RSA_ALGORITHM_KEY_TYPE = "PKCS8"
	RSA_ALGORITHM_SIGN     = crypto.SHA256
)

Variables

This section is empty.

Functions

func CreateKeys

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

生成密钥对

func MarshalPKCS8PrivateKey

func MarshalPKCS8PrivateKey(key *rsa.PrivateKey) []byte

Types

type XRsa

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

func NewXRsa

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

func (*XRsa) PrivateDecrypt

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

private key decrypt

func (*XRsa) PublicEncrypt

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

public key encode

func (*XRsa) Sign

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

data sign

func (*XRsa) Verify

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

verify data sign

Jump to

Keyboard shortcuts

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