Documentation ¶
Index ¶
- Variables
- func DegistAndSign(msg []byte, priv SM2) ([]byte, error)
- func DegistAndVerify(msg, sign []byte, pub SM2) bool
- func ReadFile(filename string) ([]byte, error)
- func WriteFile(content []byte, filename string) error
- type CCSSM2
- func (instance *CCSSM2) Decrypt(encrypted []byte) ([]byte, error)
- func (instance *CCSSM2) Encrypt(msg []byte) ([]byte, error)
- func (instance *CCSSM2) ExportKey() (privPEM []byte, pubPEM []byte, err error)
- func (instance *CCSSM2) SaveFile(priFile, pubFile string) error
- func (instance *CCSSM2) Sign(msg []byte) ([]byte, error)
- func (instance *CCSSM2) Verify(msg []byte, sign []byte) bool
- type CCSSM4
- type SM2
- type SM4
- type TJSM2
- func (instance *TJSM2) Decrypt(encrypted []byte) ([]byte, error)
- func (instance *TJSM2) Encrypt(msg []byte) ([]byte, error)
- func (instance *TJSM2) ExportKey() (privPEM []byte, pubPEM []byte, err error)
- func (instance *TJSM2) SaveFile(priFile, pubFile string) error
- func (instance *TJSM2) Sign(msg []byte) ([]byte, error)
- func (instance *TJSM2) Verify(msg []byte, sign []byte) bool
- type TJSM4
Constants ¶
This section is empty.
Variables ¶
View Source
var CCS = "CCS"
View Source
var PKU = "PKU"
View Source
var TJ = "TJ"
Functions ¶
func DegistAndVerify ¶
Types ¶
type CCSSM2 ¶
type CCSSM2 struct { PrivateKey *ccs.PrivateKey PublicKey *ccs.PublicKey }
type SM2 ¶
type SM2 interface { Encrypt(msg []byte) ([]byte, error) Decrypt(encrypted []byte) ([]byte, error) Sign(msg []byte) ([]byte, error) Verify(msg []byte, sign []byte) bool ExportKey() (privPEM []byte, pubPEM []byte, err error) SaveFile(priFile, pubFile string) error }
func GenerateSM2Instance ¶
func LoadFromPubPem ¶
type SM4 ¶
type SM4 interface { Encrypt(msg []byte, mode string) ([]byte, error) Decrypt(encrypted []byte, mode string) ([]byte, error) }
func GenerateSM4Instance ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.