Documentation ¶
Overview ¶
Package identity implements a node's identity, consisting out of id and public key. A LocalIdentity additionally contains the private key and enables signing messages.
Index ¶
Constants ¶
View Source
const IDLength = sha256.Size
IDLength defines the length of an ID.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
ID is a unique identifier for each peer.
func IDFromMarshalUtil ¶
func IDFromMarshalUtil(marshalUtil *marshalutil.MarshalUtil) (id ID, err error)
IDFromMarshalUtil unmarshals an ID using a MarshalUtil (for easier unmarshaling).
type Identity ¶
type Identity struct {
// contains filtered or unexported fields
}
LocalIdentity is a node's identity.
func GenerateIdentity ¶
func GenerateIdentity() *Identity
func Parse ¶
func Parse(marshalUtil *marshalutil.MarshalUtil, optionalTargetObject ...*Identity) (result *Identity, err error)
type LocalIdentity ¶
type LocalIdentity struct { *Identity // contains filtered or unexported fields }
LocalIdentity is a local node's identity.
func GenerateLocalIdentity ¶
func GenerateLocalIdentity() *LocalIdentity
func NewLocalIdentity ¶
func NewLocalIdentity(publicKey ed25519.PublicKey, privateKey ed25519.PrivateKey) *LocalIdentity
NewLocalIdentity creates a new LocalIdentity.
func NewLocalIdentityWithIdentity ¶
func NewLocalIdentityWithIdentity(identity *Identity, privateKey ed25519.PrivateKey) *LocalIdentity
NewLocalIdentityWithIdentity creates a new LocalIdentity with a given LocalIdentity.
Click to show internal directories.
Click to hide internal directories.