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 AmbiguousKeyError
- 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) XCreate(alias string, auth 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 ( // StandardScryptN n,r,p = 2^18, 8, 1 uses 256MB memory and approx 1s CPU time on a modern CPU. StandardScryptN = 1 << 18 // StandardScryptP fit above StandardScryptP = 1 // LightScryptN n,r,p = 2^12, 8, 6 uses 4MB memory and approx 100ms CPU time on a modern CPU. LightScryptN = 1 << 12 //LightScryptP fit above 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") ErrAmbiguousAlias = errors.New("multiple keys match alias") ErrDecrypt = errors.New("could not decrypt key with given passphrase") ErrInvalidKeyType = errors.New("key type stored invalid") )
Functions ¶
Types ¶
type AmbiguousKeyError ¶ added in v0.1.4
AmbiguousKeyError is returned when attempting to unlock an XPub for which more than one file exists.
func (*AmbiguousKeyError) Error ¶ added in v0.1.4
func (err *AmbiguousKeyError) Error() string
type HSM ¶
type HSM struct {
// contains filtered or unexported fields
}
HSM type for storing pubkey and privatekey
func (*HSM) ResetPassword ¶
ResetPassword the passphrase of an existing xpub
Click to show internal directories.
Click to hide internal directories.