Documentation ¶
Overview ¶
Package pseudohsm provides a pseudo HSM for development environments.
Index ¶
- Constants
- Variables
- func EncryptKey(key *XKey, auth string, scryptN, scryptP int) ([]byte, error)
- type AmbiguousAddrError
- type HSM
- func (h *HSM) ListKeys(after string, limit int) ([]XPub, string, error)
- func (h *HSM) ResetPassword(xpub chainkd.XPub, auth, newAuth string) error
- func (h *HSM) UpdateAlias(xpub chainkd.XPub, auth, newAlias string) error
- func (h *HSM) XCreate(auth string, alias string) (*XPub, 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 XKey
- type XPub
Constants ¶
View Source
const ( // n,r,p = 2^18, 8, 1 uses 256MB memory and approx 1s CPU time on a modern CPU. StandardScryptN = 1 << 18 StandardScryptP = 1 // n,r,p = 2^12, 8, 6 uses 4MB memory and approx 100ms CPU time on a modern CPU. LightScryptN = 1 << 12 LightScryptP = 6 )
Variables ¶
View Source
var ( ErrDuplicateKeyAlias = errors.New("duplicate key alias") ErrInvalidAfter = errors.New("invalid after") ErrNoKey = errors.New("key not found") ErrInvalidKeySize = errors.New("key invalid size") ErrTooManyAliasesToList = errors.New("requested aliases exceeds limit") ErrAmbiguousAddr = errors.New("multiple keys match address") ErrDecrypt = errors.New("could not decrypt key with given passphrase") ErrInvalidKeyType = errors.New("key type stored invalid") )
Functions ¶
Types ¶
type AmbiguousAddrError ¶
AmbiguousAddrError is returned when attempting to unlock an address for which more than one file exists.
func (*AmbiguousAddrError) Error ¶
func (err *AmbiguousAddrError) Error() string
type HSM ¶
type HSM struct {
// contains filtered or unexported fields
}
func (*HSM) ResetPassword ¶
Update changes the passphrase of an existing xpub
func (*HSM) UpdateAlias ¶
Update alias of an existing xpub
Click to show internal directories.
Click to hide internal directories.