Documentation
¶
Index ¶
- Variables
- func CreateAgKey(maxNum int32, KeyFun KeyFunction, opts ...ko.KeyOption) (newKey *agkey, err error)
- func ExportPubAgKey(priKeyfile string, outfile string) error
- func GeneratePriAgKey(num int32, cipher []byte, outfile string) error
- func MarshalSm2PrivateKey(key *sm2.PrivateKey) string
- func MarshalSm2PublicKey(key *sm2.PublicKey) string
- func New() *agkey
- func ParsePKCS8PrivateKey(dHex string) (*sm2.PrivateKey, error)
- func ParseSm2PublicKey(dHex string) (*sm2.PublicKey, error)
- type AgkeyGenerate
- type KeyFunction
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ERR_AGKEY_CAP_UNSUPPORT = errors.New("unsupport capablity") ERR_AGKEY_NOT_FOUND = errors.New("key not found") ERR_AGKEY_INVALID_CIPHERTEXT = errors.New("invalid cipher text") ERR_AGKEY_INVALID_PARAM = errors.New("invalid params") ERR_AGKEY_UNEXCEPTED_KEY = errors.New("unexpected key") ERR_AGKEY_KEY_UNSUPPORT = errors.New("unsupport key") )
Functions ¶
func CreateAgKey ¶
func CreateAgKey(maxNum int32, KeyFun KeyFunction, opts ...ko.KeyOption) (newKey *agkey, err error)
func ExportPubAgKey ¶
func MarshalSm2PrivateKey ¶
func MarshalSm2PrivateKey(key *sm2.PrivateKey) string
////////////////////////////////////////////////////
func MarshalSm2PublicKey ¶
//////////////////////////////////////////////
func ParsePKCS8PrivateKey ¶
func ParsePKCS8PrivateKey(dHex string) (*sm2.PrivateKey, error)
Types ¶
type AgkeyGenerate ¶
type AgkeyGenerate struct {
Key agkey
}
type KeyFunction ¶
构建或者获取key的函数, 返回kid 与 key
Click to show internal directories.
Click to hide internal directories.