crypto

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GM_SM2_Decry

func GM_SM2_Decry(ciphertext []byte, priv *sm2.PrivateKey) (origData []byte, err error)

/国密—SM2-解密

func GM_SM2_Encry

func GM_SM2_Encry(origData []byte, pub *sm2.PublicKey) (ciphertext []byte, err error)

/国密—SM2-加密

func GM_SM2_Sign

func GM_SM2_Sign(origData, key string) (sign string, err error)

/国密—SM2-签名

func GM_SM2_Verify

func GM_SM2_Verify(origData, sign, key string) (isok bool, err error)

/国密—SM2-验签

func GM_SM3_Hash

func GM_SM3_Hash(origData string) (hash string)

/国密—SM3-哈希

func GM_SM4_Dec

func GM_SM4_Dec(ciphertext string, key string) (origData string, err error)

/国密-SM4-sm4Ecb模式pksc7填充加密

func GM_SM4_Ecb

func GM_SM4_Ecb(origData string, key string) (ciphertext string, err error)

/国密-SM4-sm4Ecb模式pksc7填充加密

func GenerateKey

func GenerateKey(key string) (*sm2.PrivateKey, error)

/生成密钥对

func ReadPrivateKeyFromPem

func ReadPrivateKeyFromPem(privateKeyPem []byte, pwd []byte) (*sm2.PrivateKey, error)

/读取私钥

func ReadPublicKeyFromPem

func ReadPublicKeyFromPem(privateKeyPem []byte) (*sm2.PublicKey, error)

/读取私钥

Types

This section is empty.

Jump to

Keyboard shortcuts

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