rsa

package
v0.0.0-...-2bfd647 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PKCS1 = "PKCS1"
	PKCS8 = "PKCS8"
)
View Source
const (
	MD5  = "MD5"
	SHA1 = "SHA1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func WithBits

func WithBits(bits int) Option

func WithFormat

func WithFormat(format string) Option

func WithPrivatePemFile

func WithPrivatePemFile(path string) Option

func WithPublicPemFile

func WithPublicPemFile(path string) Option

func WithSignatureAlgorithm

func WithSignatureAlgorithm(algo string) Option

type Options

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

type Rsa

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

func NewRsa

func NewRsa(opts ...Option) *Rsa

func (*Rsa) GenRsaKey

func (r *Rsa) GenRsaKey() error

GenRsaKey RSA公钥私钥产生

func (*Rsa) LoadRsaKey

func (r *Rsa) LoadRsaKey() (*rsa.PrivateKey, *rsa.PublicKey, error)

LoadRsaKey 加载私匙公匙

func (*Rsa) ParseBase64Key

func (r *Rsa) ParseBase64Key(base64PublicKey, base64PrivateKey string) error

func (*Rsa) ParsePemKey

func (r *Rsa) ParsePemKey(publicKey, privateKey string) error

func (*Rsa) RsaDecrypt

func (r *Rsa) RsaDecrypt(ciphertext []byte) ([]byte, error)

func (*Rsa) RsaEncrypt

func (r *Rsa) RsaEncrypt(origData []byte) ([]byte, error)

func (*Rsa) RsaSign

func (r *Rsa) RsaSign(data []byte) ([]byte, error)

func (*Rsa) RsaVerySign

func (r *Rsa) RsaVerySign(origData, signData []byte) error

Jump to

Keyboard shortcuts

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