Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
MarshalJSON marshals the object into JSON. Part of json.Marshaller interface.
func (*MasterKey) UnmarshalJSON ¶
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 ¶
MarshalJSON marshals the object into JSON. Part of json.Marshaller interface.
func (*PrivateID) UnmarshalJSON ¶
UnmarshalJSON unmarshals the object from JSON. Part of json.Unmarshaller interface.