keys

package
v0.0.0-...-dee8dd0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2017 License: ISC Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPrivateID = errors.New("Invalid Private ID")

ErrInvalidPrivateID is returned when a PrivateID cannot be marshalled to JSON.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Get retrieves the private key given the address.
	Get(address string) *PrivateID

	// New creates a new key.
	New(name string, stream uint64, behavior uint32) *PrivateID

	// NewUnnamed creates a new key with no name.
	NewUnnamed(stream uint64, behavior uint32) *PrivateID

	// Names returns the map of addresses to names.
	Names() map[string]string
}

Manager represents a private key manager.

type MasterKey

type MasterKey hdkeychain.ExtendedKey

MasterKey is the key from which all HD keys are derived. It's an ExtendedKey with JSON marshalling/unmarshalling support.

func (*MasterKey) MarshalJSON

func (k *MasterKey) MarshalJSON() ([]byte, error)

MarshalJSON marshals the object into JSON. Part of json.Marshaller interface.

func (*MasterKey) UnmarshalJSON

func (k *MasterKey) UnmarshalJSON(in []byte) error

UnmarshalJSON unmarshals the object from JSON. Part of json.Unmarshaller interface.

type PrivateID

type PrivateID struct {
	Private *identity.PrivateID

	// IsChan tells whether the identity is that of a channel. Based on this,
	// bmclient could figure out whether to prepare/send ack messages or not,
	// and handle this identity separately from others.
	IsChan bool

	// Disabled tells whether the identity has been marked as inactive. This
	// could be either because it cannot be removed (it's an HD identity that
	// we don't want to receive messages for anymore) or we want to store the
	// private keys for an imported identity but not actively listen on it.
	Disabled bool

	// IsImported says whether the identity is imported or derived.
	Imported bool

	// Name is a name for this id.
	Name string
}

PrivateID embeds an identity.Private object, adding support for JSON marshalling/unmarshalling and other params.

func (*PrivateID) Address

func (p *PrivateID) Address() Address

Address generates the bitmessage address.

func (*PrivateID) Data

func (p *PrivateID) Data() *obj.PubKeyData

Data returns the PubKeyData object from the PrivateID.

func (*PrivateID) MarshalJSON

func (p *PrivateID) MarshalJSON() ([]byte, error)

MarshalJSON marshals the object into JSON. Part of json.Marshaller interface.

func (*PrivateID) Public

func (p *PrivateID) Public() identity.Public

Public generates the Public id from a PrivateID.

func (*PrivateID) UnmarshalJSON

func (p *PrivateID) UnmarshalJSON(in []byte) error

UnmarshalJSON unmarshals the object from JSON. Part of json.Unmarshaller interface.

Jump to

Keyboard shortcuts

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