Documentation
¶
Index ¶
- type Sm2Encryption
- func (sm2x *Sm2Encryption) Decrypt(ciphertext string) ([]byte, error)
- func (sm2x *Sm2Encryption) Encrypt(msg interface{}) (string, error)
- func (sm2x *Sm2Encryption) EncryptWithNoError(msg string) string
- func (sm2x *Sm2Encryption) GetPublicKey() string
- func (sm2x *Sm2Encryption) SetPublicKey(pubKeyStr string) (string, error)
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)
Click to show internal directories.
Click to hide internal directories.