asymmetric

package
v2.18.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PemBase64

type PemBase64 struct {
	// contains filtered or unexported fields
}
var PemBase64Helper PemBase64

func (*PemBase64) GeneratePemPrivateKey

func (r *PemBase64) GeneratePemPrivateKey() (*PemBase64, error)

GeneratePemPrivateKey 生成pem密钥

func (*PemBase64) GeneratePemPublicKey

func (r *PemBase64) GeneratePemPublicKey() (*PemBase64, error)

func (*PemBase64) GetBase64PrivateKey

func (r *PemBase64) GetBase64PrivateKey() string

func (*PemBase64) GetBase64PublicKey

func (r *PemBase64) GetBase64PublicKey() string

func (*PemBase64) GetPemPrivateKey

func (r *PemBase64) GetPemPrivateKey() []byte

GetPemPrivateKey 获取pem私钥

func (*PemBase64) GetPemPublicKey

func (r *PemBase64) GetPemPublicKey() []byte

func (PemBase64) New

func (PemBase64) New() *PemBase64

func (*PemBase64) SetBase64PrivateKye

func (r *PemBase64) SetBase64PrivateKye(base64PrivateKye string) *PemBase64

func (*PemBase64) SetBase64PublicKey

func (r *PemBase64) SetBase64PublicKey(base64PublicKey string) *PemBase64

type Rsa

type Rsa struct{}
var RsaHelper Rsa

func (Rsa) DecryptByBase64

func (r Rsa) DecryptByBase64(base64PrivateKey string, cipherText []byte) ([]byte, error)

DecryptByBase64 通过base64私钥解密

func (Rsa) DecryptByPem

func (r Rsa) DecryptByPem(pemPrivateKey []byte, cipherText []byte) ([]byte, error)

DecryptByPem 使用PEM私钥进行RSA解密

func (Rsa) Demo

func (r Rsa) Demo()

func (Rsa) DemoDecryptRsa added in v2.14.11

func (Rsa) DemoDecryptRsa(base64Encrypted string) string

func (Rsa) DemoEncryptRsa added in v2.14.11

func (Rsa) DemoEncryptRsa(unEncrypt []byte) string

func (Rsa) EncryptByBase64

func (r Rsa) EncryptByBase64(base64PublicKey string, plainText []byte) ([]byte, error)

EncryptByBase64 通过base64公钥加密

func (Rsa) EncryptByPem

func (r Rsa) EncryptByPem(pemPublicKey []byte, plainText []byte) ([]byte, error)

EncryptByPem 通过pem公钥加密

func (Rsa) New

func (Rsa) New() *Rsa

New 实例化:Rsa加密

type UnEncrypt

type UnEncrypt struct {
	Username string `json:"username"`
	Password string `json:"password"`
	AesKey   string `json:"aes_key"`
}

Jump to

Keyboard shortcuts

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