ledger

package
v0.0.0-...-572f49c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// discoverLedger defines a function to be invoked at runtime for discovering
	// a connected Ledger device.
	DiscoverLedger discoverLedgerFn
)

Functions

This section is empty.

Types

type DerivationPath

type DerivationPath []uint32

DerivationPath represents a Ledger derivation path.

type LedgerSecp256k1

type LedgerSecp256k1 interface {
	GetPublicKeySECP256K1([]uint32) ([]byte, error)
	ShowAddressSECP256K1([]uint32, string) error
	SignSECP256K1([]uint32, []byte) ([]byte, error)
	GetVersion() (*ledgergo.VersionInfo, error)
	Close() error
}

LedgerSecp256k1 reflects an interface a Ledger API must implement for the SECP256K1 scheme.

type PrivKeyLedgerSecp256k1

type PrivKeyLedgerSecp256k1 struct {
	crypto.PrivKey
	// contains filtered or unexported fields
}

PrivKeyLedgerSecp256k1 implements PrivKey, calling the ledger nano we cache the PubKey from the first call to use it later.

func GenLedgerSecp256k1Key

func GenLedgerSecp256k1Key(path DerivationPath, device LedgerSecp256k1) (*PrivKeyLedgerSecp256k1, error)

func (PrivKeyLedgerSecp256k1) Bytes

func (pkl PrivKeyLedgerSecp256k1) Bytes() []byte

func (PrivKeyLedgerSecp256k1) Equals

func (pkl PrivKeyLedgerSecp256k1) Equals(other crypto.PrivKey) bool

func (PrivKeyLedgerSecp256k1) PubKey

func (pkl PrivKeyLedgerSecp256k1) PubKey() crypto.PubKey

func (PrivKeyLedgerSecp256k1) ShowSignAddr

func (pkl PrivKeyLedgerSecp256k1) ShowSignAddr() error

func (PrivKeyLedgerSecp256k1) Sign

func (pkl PrivKeyLedgerSecp256k1) Sign(msg []byte) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL