xrsa

package
v0.0.0-...-9493ce7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptWithPrivateKey

func DecryptWithPrivateKey(privateKey *rsa.PrivateKey, in []byte) (out []byte, err error)

DecryptWithPrivateKey 私钥解密

func EncryptWithPublicKey

func EncryptWithPublicKey(publicKey *rsa.PublicKey, in []byte) (out []byte, err error)

EncryptWithPublicKey 公钥加密

Types

type RSA

type RSA struct {
	PrivateKey *rsa.PrivateKey
}

RSA

func (*RSA) Decrypt

func (object *RSA) Decrypt(in []byte) (out []byte, err error)

Decrypt 解密

func (*RSA) Encrypt

func (object *RSA) Encrypt(in []byte) (out []byte, err error)

Encrypt 加密

func (*RSA) MakeKey

func (object *RSA) MakeKey(keySize int) (err error)

MakeKey 创建Key

func (*RSA) PrivateToPem

func (object *RSA) PrivateToPem() (str string, err error)

PrivateToPem 私钥转换为PEM格式

func (*RSA) PublicToPem

func (object *RSA) PublicToPem() (str string,
	err error)

PublicToPem 公钥转换为PEM格式

func (*RSA) Sign

func (object *RSA) Sign(hash crypto.Hash, src []byte) (sign []byte, err error)

Sign 签名

func (*RSA) Verify

func (object *RSA) Verify(hash crypto.Hash, src, sign []byte) (err error)

Verify 验证签名

Jump to

Keyboard shortcuts

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