asymmetric

package
v1.66.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 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 APP added in v1.66.1

type APP struct {
	PEMBase64 PEMBase64
	RSA       RSA
}

type PEMBase64 added in v1.66.1

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

func NewPEMBase64 added in v1.66.1

func NewPEMBase64() *PEMBase64

NewPEMBase64 实例化

func (*PEMBase64) GeneratePemPrivateKey added in v1.66.1

func (my *PEMBase64) GeneratePemPrivateKey() (*PEMBase64, error)

GeneratePemPrivateKey 生成pem密钥

func (*PEMBase64) GeneratePemPublicKey added in v1.66.1

func (my *PEMBase64) GeneratePemPublicKey() (*PEMBase64, error)

func (*PEMBase64) GetBase64PrivateKey added in v1.66.1

func (my *PEMBase64) GetBase64PrivateKey() string

func (*PEMBase64) GetBase64PublicKey added in v1.66.1

func (my *PEMBase64) GetBase64PublicKey() string

func (*PEMBase64) GetPemPrivateKey added in v1.66.1

func (my *PEMBase64) GetPemPrivateKey() []byte

GetPemPrivateKey 获取pem私钥

func (*PEMBase64) GetPemPublicKey added in v1.66.1

func (my *PEMBase64) GetPemPublicKey() []byte

func (*PEMBase64) New added in v1.66.1

func (*PEMBase64) New() *PEMBase64

func (*PEMBase64) SetBase64PrivateKye added in v1.66.1

func (my *PEMBase64) SetBase64PrivateKye(base64PrivateKey string) *PEMBase64

func (*PEMBase64) SetBase64PublicKey added in v1.66.1

func (my *PEMBase64) SetBase64PublicKey(base64PublicKey string) *PEMBase64

type RSA added in v1.66.1

type RSA struct{}

func NewRSA added in v1.66.1

func NewRSA() *RSA

NewRSA 实例化:Rsa加密

func (*RSA) DecryptByBase64 added in v1.66.1

func (my *RSA) DecryptByBase64(base64PrivateKey string, cipherText []byte) ([]byte, error)

DecryptByBase64 通过base64私钥解密

func (*RSA) DecryptByPem added in v1.66.1

func (my *RSA) DecryptByPem(pemPrivateKey []byte, cipherText []byte) ([]byte, error)

DecryptByPem 使用PEM私钥进行RSA解密

func (*RSA) Demo added in v1.66.1

func (my *RSA) Demo()

func (*RSA) DemoDecryptRsa added in v1.66.1

func (*RSA) DemoDecryptRsa(base64Encrypted string) string

func (*RSA) DemoEncryptRsa added in v1.66.1

func (*RSA) DemoEncryptRsa(unEncrypt []byte) string

func (*RSA) EncryptByBase64 added in v1.66.1

func (my *RSA) EncryptByBase64(base64PublicKey string, plainText []byte) ([]byte, error)

EncryptByBase64 通过base64公钥加密

func (*RSA) EncryptByPem added in v1.66.1

func (my *RSA) EncryptByPem(pemPublicKey []byte, plainText []byte) ([]byte, error)

EncryptByPem 通过pem公钥加密

func (*RSA) New added in v1.66.1

func (*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