Documentation ¶
Overview ¶
Package mockhsm provides a mock HSM for development environments. It is unsafe for use in production.
Index ¶
- Variables
- type HSM
- func (h *HSM) Create(ctx context.Context, alias string) (*Pub, error)
- func (h *HSM) DeleteChainKDKey(ctx context.Context, xpub chainkd.XPub) error
- func (h *HSM) GetOrCreate(ctx context.Context, alias string) (*Pub, bool, error)
- func (h *HSM) ListKeys(ctx context.Context, aliases []string, after string, limit int) ([]*XPub, string, error)
- func (h *HSM) Sign(ctx context.Context, pub ed25519.PublicKey, bh *legacy.BlockHeader) ([]byte, error)
- func (h *HSM) XCreate(ctx context.Context, alias string) (*XPub, error)
- func (h *HSM) XSign(ctx context.Context, xpub chainkd.XPub, path [][]byte, msg []byte) ([]byte, error)
- type Pub
- type XPub
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type HSM ¶
type HSM struct {
// contains filtered or unexported fields
}
func (*HSM) DeleteChainKDKey ¶
func (*HSM) GetOrCreate ¶
GetOrCreate looks for the Ed25519 key with the given alias, generating a new one if it's not found.
func (*HSM) ListKeys ¶
func (h *HSM) ListKeys(ctx context.Context, aliases []string, after string, limit int) ([]*XPub, string, error)
ListKeys returns a list of all xpubs from the db.
func (*HSM) Sign ¶
func (h *HSM) Sign(ctx context.Context, pub ed25519.PublicKey, bh *legacy.BlockHeader) ([]byte, error)
Sign looks up the prv given the pub and signs the given msg.
Click to show internal directories.
Click to hide internal directories.