Versions in this module Expand all Collapse all v1 v1.0.4 Jan 22, 2019 Changes in this version + const DEFAULT_DERIVED_KEY_LENGTH + const DEFAULT_N + const DEFAULT_P + const DEFAULT_R + const ED25519 + const P224 + const P256 + const P384 + const P521 + const SM2P256V1 + func ComparePublicKey(k0, k1 PublicKey) bool + func FindKey(list []PublicKey, key PublicKey) int + func GenerateKeyPair(t KeyType, opts interface{}) (PrivateKey, PublicKey, error) + func GetCurve(label byte) (elliptic.Curve, error) + func GetCurveLabel(c elliptic.Curve) (byte, error) + func GetNamedCurve(name string) (elliptic.Curve, error) + func GetNamedCurveLabel(name string) (byte, error) + func Key2WIF(key PrivateKey) ([]byte, error) + func SerializePrivateKey(pri PrivateKey) []byte + func SerializePublicKey(key PublicKey) []byte + type DecryptError EncryptError + func NewDecryptError(msg string) *DecryptError + func (e *DecryptError) Error() string + type EncryptError struct + func NewEncryptError(msg string) *EncryptError + func (e *EncryptError) Error() string + type KeyType byte + const PK_ECDSA + const PK_EDDSA + const PK_P256_E + const PK_P256_NC + const PK_P256_O + const PK_SM2 + func GetKeyType(p PublicKey) KeyType + type PrivateKey interface + Public func() crypto.PublicKey + func DecryptPrivateKey(prot *ProtectedKey, pwd []byte) (PrivateKey, error) + func DecryptWithCustomScrypt(prot *ProtectedKey, pwd []byte, param *ScryptParam) (PrivateKey, error) + func DeserializePrivateKey(data []byte) (pri PrivateKey, err error) + func GetP256KeyPairFromWIF(wif []byte) (PrivateKey, error) + func WIF2Key(wif []byte) (PrivateKey, error) + type ProtectedKey struct + Address string + Alg string + EncAlg string + Hash string + Key []byte + Param map[string]string + Salt []byte + func EncryptPrivateKey(pri PrivateKey, addr string, pwd []byte) (*ProtectedKey, error) + func EncryptWithCustomScrypt(pri PrivateKey, addr string, pwd []byte, param *ScryptParam) (*ProtectedKey, error) + func ReencryptPrivateKey(prot *ProtectedKey, oldPwd, newPwd []byte, oldParam, newParam *ScryptParam) (*ProtectedKey, error) + type PublicKey crypto.PublicKey + func DeserializePublicKey(data []byte) (PublicKey, error) + func SortPublicKeys(list []PublicKey) []PublicKey + type ScryptParam struct + DKLen int + N int + P int + R int + func GetScryptParameters() *ScryptParam