Documentation ¶
Index ¶
Constants ¶
const MaxCodenameLength = 32
MaxCodenameLength is the maximum length, in bytes, that a codename can be.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeNamePart ¶
type Identity ¶
type Identity struct { PubKey ed25519.PublicKey Honorific CodeNamePart Adjective CodeNamePart Noun CodeNamePart Codename string Color string Extension string CodesetVersion uint8 }
Identity is the public object describing all aspects of a channel definition
func ConstructIdentity ¶
ConstructIdentity creates a codename from an extant identity for a given version
func UnmarshalIdentity ¶
UnmarshalIdentity created an identity from a marshaled version
type Language ¶
type Language uint8
Language represents possible languages to generate code names from.
type PrivateIdentity ¶
type PrivateIdentity struct { Privkey ed25519.PrivateKey Identity }
PrivateIdentity is a user's private identity on a channel. It contains their public identity and their private key.
func GenerateIdentity ¶
func GenerateIdentity(rng io.Reader) (PrivateIdentity, error)
GenerateIdentity create a new channels identity from scratch and assigns it a codename
func ImportPrivateIdentity ¶
func ImportPrivateIdentity(password string, data []byte) (PrivateIdentity, error)
ImportPrivateIdentity generates a new PrivateIdentity from exported data.
func UnmarshalPrivateIdentity ¶
func UnmarshalPrivateIdentity(data []byte) (PrivateIdentity, error)
UnmarshalPrivateIdentity created a private identity from a marshaled version
func (PrivateIdentity) Export ¶
Export exports the PrivateIdentity into a portable encrypted string that can be used to restore it later.
func (PrivateIdentity) GetDMToken ¶
func (i PrivateIdentity) GetDMToken() uint32
GetDMToken returns the DM Token for this codename identity. TODO: This is not yet stored in the data model, which is why it is computed here and accessed through this function.
func (PrivateIdentity) Marshal ¶
func (i PrivateIdentity) Marshal() []byte
Marshal creates en exportable version of the PrivateIdentity.