crypto

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyBag

type KeyBag struct {
	// contains filtered or unexported fields
}

KeyBag is a PrivateKey collection for signing and verifying purposes.

func NewKeyBag

func NewKeyBag() *KeyBag

func (*KeyBag) Add

func (b *KeyBag) Add(wifKey string) error

func (*KeyBag) ImportFromFile

func (b *KeyBag) ImportFromFile(path string) error

func (KeyBag) Marshal

func (p KeyBag) Marshal(enc *util.TypeEncoder) error

func (KeyBag) Privates

func (b KeyBag) Privates() (out types.PrivateKeys)

func (KeyBag) PrivatesByPublics

func (b KeyBag) PrivatesByPublics(pubKeys types.PublicKeys) (out types.PrivateKeys)

func (KeyBag) PublicPresent

func (b KeyBag) PublicPresent(pub *types.PublicKey) bool

func (KeyBag) Publics

func (b KeyBag) Publics() (out types.PublicKeys)

func (*KeyBag) Remove

func (b *KeyBag) Remove(pub string) bool

func (*KeyBag) Unmarshal

func (p *KeyBag) Unmarshal(dec *util.TypeDecoder) error

type TransactionSigner

type TransactionSigner struct {
	*types.SignedTransaction
}

TransactionSigner can sign and verify a transaction.

func NewTransactionSigner

func NewTransactionSigner(tx *types.SignedTransaction) *TransactionSigner

NewTransactionSigner creates an New TransactionSigner. Invalid expiration time will be adjusted.

func (*TransactionSigner) Sign

func (tx *TransactionSigner) Sign(privKeys types.PrivateKeys, chain *config.ChainConfig) error

Sign signs the underlying transaction

func (*TransactionSigner) Verify

func (tx *TransactionSigner) Verify(keyBag *KeyBag, chain *config.ChainConfig) (bool, error)

Verify verifies the underlying transaction against a given KeyBag

Jump to

Keyboard shortcuts

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