Documentation ¶
Overview ¶
Package identity is responsible for creation and management of user identities.
Index ¶
- Constants
- type Private
- func ImportWIF(address, signingKeyWif, encryptionKeyWif string, ...) (*Private, error)
- func NewDeterministic(passphrase string, initialZeros uint64, n int) ([]*Private, error)
- func NewHD(masterKey *hdkeychain.ExtendedKey, n uint32, stream uint32) (*Private, error)
- func NewRandom(initialZeros int) (*Private, error)
- type Public
Constants ¶
const (
// BMPurposeCode is the purpose code used for HD key derivation.
BMPurposeCode = 0x80000052
)
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 Behavior uint32 }
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 ¶
NewDeterministic creates n identities based on a deterministic passphrase. Note that this does not create an address.
func NewHD ¶
func NewHD(masterKey *hdkeychain.ExtendedKey, n uint32, stream uint32) (*Private, error)
NewHD generates a new hierarchically deterministic key based on BIP-BM01. Master key must be a private master key generated according to BIP32. `n' is the n'th identity to generate. NewHD also generates a v4 address based on the specified stream.
func NewRandom ¶
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 ¶
CreateAddress populates the Address object within the identity based on the provided version and stream values and also generates the ripe.
type Public ¶
type Public struct { bmutil.Address NonceTrialsPerByte uint64 ExtraBytes uint64 SigningKey *btcec.PublicKey EncryptionKey *btcec.PublicKey Behavior uint32 }
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 NewPublic ¶
func NewPublic(signingKey, encryptionKey *btcec.PublicKey, nonceTrials, extraBytes, addrVersion, addrStream uint64) *Public
NewPublic creates and initializes an *identity.Public object.
func (*Public) CreateAddress ¶
CreateAddress populates the Address object within the identity based on the provided version and stream values and also generates the ripe.