sm2_lib

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sm2Encryption

type Sm2Encryption struct {
	PrivateKey *sm2.PrivateKey
	PublicKey  *sm2.PublicKey
	// contains filtered or unexported fields
}

func NewSm2

func NewSm2() *Sm2Encryption

func (*Sm2Encryption) Decrypt

func (sm2x *Sm2Encryption) Decrypt(ciphertext string) ([]byte, error)

Decrypt sm2解密

func (*Sm2Encryption) Encrypt

func (sm2x *Sm2Encryption) Encrypt(msg interface{}) (string, error)

Encrypt sm2加密

func (*Sm2Encryption) EncryptWithNoError

func (sm2x *Sm2Encryption) EncryptWithNoError(msg string) string

EncryptWithNoError sm2加密

func (*Sm2Encryption) GetPublicKey

func (sm2x *Sm2Encryption) GetPublicKey() string

GetPublicKey 获取公钥

func (*Sm2Encryption) SetPublicKey

func (sm2x *Sm2Encryption) SetPublicKey(pubKeyStr string) (string, error)

Jump to

Keyboard shortcuts

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