crypto

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RSA = &RSAEncrypt{}

RSA RSA

Functions

func DumpPriKeyPKCS1Base64

func DumpPriKeyPKCS1Base64(privateKey *rsa.PrivateKey) (string, error)

DumpPriKeyPKCS1Base64 DumpPriKeyPKCS1Base64

func DumpPriKeyPKCS8Base64

func DumpPriKeyPKCS8Base64(privateKey *rsa.PrivateKey) (string, error)

DumpPriKeyPKCS8Base64 DumpPriKeyPKCS8Base64

func DumpPubPKCS1Base64

func DumpPubPKCS1Base64(publickey *rsa.PublicKey) (string, error)

DumpPubPKCS1Base64 DumpPubPKCS1Base64

func DumpPubPKCS8Base64

func DumpPubPKCS8Base64(publickey *rsa.PublicKey) (string, error)

DumpPubPKCS8Base64 DumpPubPKCS8Base64

func GenerateRSAKey

func GenerateRSAKey(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)

GenerateRSAKey GenerateRSAKey

Types

type RSAEncrypt

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

RSAEncrypt RSAEncrypt

func (*RSAEncrypt) GetPrivatekey

func (rsas *RSAEncrypt) GetPrivatekey() (*rsa.PrivateKey, error)

GetPrivatekey *rsa.PublicKey

func (*RSAEncrypt) GetPublickey

func (rsas *RSAEncrypt) GetPublickey() (*rsa.PublicKey, error)

GetPublickey *rsa.PrivateKey

func (*RSAEncrypt) PriKeyDecrypt

func (rsas *RSAEncrypt) PriKeyDecrypt(input []byte) ([]byte, error)

PriKeyDecrypt 私钥解密

func (*RSAEncrypt) PubKeyEncrypt

func (rsas *RSAEncrypt) PubKeyEncrypt(input []byte) ([]byte, error)

PubKeyEncrypt 公钥加密

func (*RSAEncrypt) SetPriKey

func (rsas *RSAEncrypt) SetPriKey(priKeyStr string) (err error)

SetPriKey 设置私钥

func (*RSAEncrypt) SetPubKey

func (rsas *RSAEncrypt) SetPubKey(pubKeyStr string) (err error)

SetPubKey 设置公钥

func (*RSAEncrypt) SignWithSha1Base64

func (rsas *RSAEncrypt) SignWithSha1Base64(data string) (string, error)

SignWithSha1Base64 SignWithSha1Base64

func (*RSAEncrypt) SignWithSha1Hex

func (rsas *RSAEncrypt) SignWithSha1Hex(data string) (string, error)

SignWithSha1Hex RsaSignWithSha1Hex

func (*RSAEncrypt) SignWithSha256Base64

func (rsas *RSAEncrypt) SignWithSha256Base64(data string) (string, error)

SignWithSha256Base64 SignWithSha256Base64

func (*RSAEncrypt) SignWithSha256Hex

func (rsas *RSAEncrypt) SignWithSha256Hex(data string) (string, error)

SignWithSha256Hex SignWithSha256Hex

func (*RSAEncrypt) SignWithSha512Base64

func (rsas *RSAEncrypt) SignWithSha512Base64(data string) (string, error)

SignWithSha512Base64 SignWithSha512Base64

func (*RSAEncrypt) SignWithSha512Hex

func (rsas *RSAEncrypt) SignWithSha512Hex(data string) (string, error)

SignWithSha512Hex SignWithSha512Hex

func (*RSAEncrypt) VerySignWithSha1Base64

func (rsas *RSAEncrypt) VerySignWithSha1Base64(originalData, signData string) error

VerySignWithSha1Base64 验签

func (*RSAEncrypt) VerySignWithSha1Hex

func (rsas *RSAEncrypt) VerySignWithSha1Hex(originalData, signData string) error

VerySignWithSha1Hex 验签

func (*RSAEncrypt) VerySignWithSha256Base64

func (rsas *RSAEncrypt) VerySignWithSha256Base64(originalData, signData string) error

VerySignWithSha256Base64 验签

func (*RSAEncrypt) VerySignWithSha256Hex

func (rsas *RSAEncrypt) VerySignWithSha256Hex(originalData, signData string) error

VerySignWithSha256Hex 验签

func (*RSAEncrypt) VerySignWithSha512Base64

func (rsas *RSAEncrypt) VerySignWithSha512Base64(originalData, signData string) error

VerySignWithSha512Base64 验签

func (*RSAEncrypt) VerySignWithSha512Hex

func (rsas *RSAEncrypt) VerySignWithSha512Hex(originalData, signData string) error

VerySignWithSha512Hex 验签

Jump to

Keyboard shortcuts

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