Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ECDSAP256KeyGen ECDSA类型 ECDSAP256KeyGen = 1 // SM2P256KygGen SM2类型 SM2P256KygGen = 2 )
Variables ¶
This section is empty.
Functions ¶
func MarshalECDSASignature ¶
MarshalECDSASignature 编码ECDSA类型签名
Types ¶
type CSP ¶
type CSP interface { KeyGen(opts int) (k Key, err error) Sign(k Key, digest []byte, opts SignerOpts) (signature []byte, err error) }
CSP 证书生成器接口
type Key ¶
type Key interface { Bytes() ([]byte, error) SKI() []byte Symmetric() bool Private() bool PublicKey() (Key, error) }
Key 通用key接口
type KeyGenerator ¶
KeyGenerator key生成器接口
type SM2PrivateKey ¶
type SM2PrivateKey struct {
PrivKey *sm2.PrivateKey
}
SM2PrivateKey sm2私钥结构
func (*SM2PrivateKey) Bytes ¶
func (k *SM2PrivateKey) Bytes() (raw []byte, err error)
Bytes sm2私钥转成byte
func (*SM2PrivateKey) PublicKey ¶
func (k *SM2PrivateKey) PublicKey() (Key, error)
PublicKey sm2私钥对应公钥
type SM2PublicKey ¶
SM2PublicKey sm2公钥结构
func (*SM2PublicKey) Bytes ¶
func (k *SM2PublicKey) Bytes() (raw []byte, err error)
Bytes sm2公钥转成byte
Source Files ¶
Click to show internal directories.
Click to hide internal directories.