Versions in this module Expand all Collapse all v1 v1.1.2 Sep 16, 2021 Changes in this version + const EntropyLength + const LightScryptN + const LightScryptP + const StandardScryptN + const StandardScryptP + var ErrDecrypt = errors.New("could not decrypt key with given passphrase") + var ErrDuplicateKeyAlias = errors.New("duplicate key alias") + var ErrLoadKey = errors.New("key not found or wrong password ") + var ErrMnemonicLength = errors.New("mnemonic length error") + var ErrXPubFormat = errors.New("xpub format error") + func EncryptKey(key *XKey, auth string, scryptN, scryptP int) ([]byte, error) + type AmbiguousKeyError struct + Matches []XPub + Pubkey string + func (err *AmbiguousKeyError) Error() string + type HSM struct + func New(keypath string) (*HSM, error) + func (h *HSM) Backup() (*KeyImage, error) + func (h *HSM) HasAlias(alias string) bool + func (h *HSM) HasKey(xprv chainkd.XPrv) bool + func (h *HSM) ImportKeyFromMnemonic(alias string, auth string, mnemonic string, language string) (*XPub, error) + func (h *HSM) ListKeys() []XPub + func (h *HSM) LoadChainKDKey(xpub chainkd.XPub, auth string) (xprv chainkd.XPrv, err error) + func (h *HSM) ResetPassword(xpub chainkd.XPub, oldAuth, newAuth string) error + func (h *HSM) Restore(image *KeyImage) error + func (h *HSM) UpdateKeyAlias(xpub chainkd.XPub, newAlias string) error + func (h *HSM) XCreate(alias string, auth string, language string) (*XPub, *string, error) + func (h *HSM) XDelete(xpub chainkd.XPub, auth string) error + func (h *HSM) XSign(xpub chainkd.XPub, path [][]byte, msg []byte, auth string) ([]byte, error) + type KeyImage struct + XKeys []*encryptedKeyJSON + type XKey struct + Alias string + ID uuid.UUID + KeyType string + XPrv chainkd.XPrv + XPub chainkd.XPub + func DecryptKey(keyjson []byte, auth string) (*XKey, error) + type XPub struct + Alias string + File string + XPub chainkd.XPub