Documentation ¶
Overview ¶
Package sm2 系统签名包
Index ¶
- Constants
- func Deserialize(sigStr []byte) (*big.Int, *big.Int, error)
- func IsLowS(s *big.Int) bool
- func Serialize(r, s *big.Int) []byte
- func SerializePrivateKey(p *sm2.PrivateKey) []byte
- func SerializePublicKey(p *sm2.PublicKey) []byte
- func ToLowS(k *sm2.PublicKey, s *big.Int) *big.Int
- type Driver
- type PrivKeySM2
- type PubKeySM2
- type Signature
- type SignatureS
- type SignatureSM2
Constants ¶
View Source
const ( SM2PrivateKeyLength = 32 SM2PublicKeyLength = 65 )
const
View Source
const ( Name = "sm2" ID = 3 )
const
Variables ¶
This section is empty.
Functions ¶
func SerializePrivateKey ¶
func SerializePrivateKey(p *sm2.PrivateKey) []byte
SerializePrivateKey 私钥序列化
Types ¶
type Driver ¶
type Driver struct{}
Driver 驱动
func (Driver) PrivKeyFromBytes ¶
PrivKeyFromBytes 字节转为私钥
func (Driver) PubKeyFromBytes ¶
PubKeyFromBytes 字节转为公钥
type PrivKeySM2 ¶
type PrivKeySM2 [SM2PrivateKeyLength]byte
PrivKeySM2 私钥
func (PrivKeySM2) String ¶
func (privKey PrivKeySM2) String() string
type PubKeySM2 ¶
type PubKeySM2 [SM2PublicKeyLength]byte
PubKeySM2 公钥
type SignatureSM2 ¶
type SignatureSM2 []byte
SignatureSM2 签名
func (SignatureSM2) String ¶
func (sig SignatureSM2) String() string
Click to show internal directories.
Click to hide internal directories.