identity

package
v0.0.0-...-bdbe780 Latest Latest
Warning

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

Go to latest
Published: May 18, 2015 License: ISC Imports: 9 Imported by: 0

Documentation

Overview

Package identity is responsible for creation and management of user identities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Private

type Private struct {
	bmutil.Address
	NonceTrialsPerByte uint64
	ExtraBytes         uint64
	SigningKey         *btcec.PrivateKey
	EncryptionKey      *btcec.PrivateKey
}

Private contains the identity of the user, which includes private encryption and signing keys, POW parameters and the address that contains information about stream number and address version.

func ImportWIF

func ImportWIF(address, signingKeyWif, encryptionKeyWif string,
	nonceTrials, extraBytes uint64) (*Private, error)

ImportWIF creates a Private identity from the Bitmessage address and Wallet Import Format (WIF) signing and encryption keys.

func NewDeterministic

func NewDeterministic(passphrase string, initialZeros uint64) (*Private, error)

Create identities based on a deterministic passphrase. Note that this does not create an address.

func NewRandom

func NewRandom(initialZeros int) (*Private, error)

NewRandom creates an identity based on a random data, with the required number of initial zeros in front (minimum 1). Each initial zero requires exponentially more work. Note that this does not create an address.

func (*Private) CreateAddress

func (id *Private) CreateAddress(version, stream uint64)

CreateAddress populates the Address object within the identity based on the provided version and stream values and also generates the ripe.

func (*Private) ExportWIF

func (id *Private) ExportWIF() (address, signingKeyWif, encryptionKeyWif string,
	err error)

ExportWIF exports a Private identity to WIF for storage on disk or use by other software. It exports the address, private signing key and private encryption key.

func (*Private) ToPublic

func (id *Private) ToPublic() *Public

ToPublic turns a Private identity object into Public identity object.

type Public

type Public struct {
	bmutil.Address
	NonceTrialsPerByte uint64
	ExtraBytes         uint64
	SigningKey         *btcec.PublicKey
	EncryptionKey      *btcec.PublicKey
}

Public contains the identity of the remote user, which includes public encryption and signing keys, POW parameters and the address that contains information about stream number and address version.

func IdentityFromPubKeyMsg

func IdentityFromPubKeyMsg(msg *wire.MsgPubKey) (*Public, error)

IdentityFromPubKeyMsg generates an *identity.Public object based on a wire.MsgPubKey object.

func (*Public) CreateAddress

func (id *Public) CreateAddress(version, stream uint64)

CreateAddress populates the Address object within the identity based on the provided version and stream values and also generates the ripe.

Jump to

Keyboard shortcuts

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