Documentation ¶
Index ¶
- Constants
- func LoadTrust(wicHome string) (m map[uint32]*Personae, err error)
- type Alias
- type Channel
- func (c *Channel) CloneKey() *symmetric.Key
- func (c *Channel) Name() string
- func (c *Channel) Open(srcnickhost, dst string, tstamp uint64, in []byte) (out string, err error)
- func (c *Channel) Seal(srcnickhost, dst string, in []byte) (out []byte, tstamp uint64, err error)
- func (c *Channel) SealLen(inlen int) int
- func (c *Channel) SetName(name string)
- type Client
- func (ic *Client) CheckAndUpdateTrust(wicHome string) error
- func (ic *Client) CountNetwork() int
- func (ic *Client) CountTrust() int
- func (ic *Client) DelNetwork(name string) error
- func (ic *Client) Me() *Self
- func (ic *Client) Network(name string) (*Network, error)
- func (ic *Client) NewNetwork(name string)
- func (ic *Client) NewTrust(trust map[uint32]*Personae)
- func (ic *Client) TrustLookup(id uint32) (*Personae, error)
- func (ic *Client) TrustUpdateTime() int64
- type Network
- func (n *Network) ChannelKey(name string) (c *Channel, ok bool)
- func (n *Network) DeleteChannelKey(name string)
- func (n *Network) DeletePersonae(nick string)
- func (n *Network) Me() *Self
- func (n *Network) Personae(nick string) (p *Personae, ok bool)
- func (n *Network) SetChannelKey(name string, k *Channel)
- func (n *Network) SetPersonae(nick string, p *Personae)
- type Personae
- func (p *Personae) Alias() *Alias
- func (p *Personae) CanKexOpen(peer *Personae) bool
- func (p *Personae) CanSign() bool
- func (p *Personae) CanVerify() bool
- func (p *Personae) FromEphemeral(channel, nickhost string, pk, sig []byte, tstamp uint64) (err error)
- func (p *Personae) FromIdentityKeys(pub, priv []byte) error
- func (p *Personae) Host() string
- func (p *Personae) Id() (uint32, error)
- func (p *Personae) IdentityKeys() (pub, priv []byte)
- func (p *Personae) IdentityNick() string
- func (p *Personae) IsKexReady() bool
- func (p *Personae) IsTrusted() bool
- func (p *Personae) NewPublicKey() error
- func (p *Personae) Nick() string
- func (p *Personae) NickHost() string
- type Self
- func (p *Self) Alias(network string) (a *Alias, ok bool)
- func (s *Self) KeyExchangeOpen(src *Personae, network, channel, nickhost string, kex, sig []byte, id uint32, ...) (key []byte, err error)
- func (s *Self) KeyExchangeSeal(to *Personae, network, channel string, key []byte) (kex, sig []byte, id uint32, tstamp uint64, err error)
- func (p *Self) PublicKey(network, channel string) (pk, sig []byte, id uint32, tstamp uint64, err error)
- func (s *Self) Seal(wicHome, password string) error
- func (p *Self) SetAlias(network, nick, host string)
- func (p *Self) Unalias(server, nick string)
- func (s *Self) UntrustedKeyExchangeOpen(src *Personae, network, channel, nickhost string, kex []byte, id uint32, ...) (key []byte, err error)
Constants ¶
const ( MsgTTL = 1 * time.Minute AEADOverhead = 16 // take from xcha )
const ( IdentityFilePriv = "id_ed25519" IdentityFilePub = IdentityFilePriv + ".pub" TrustedFile = "authorized_nicks" )
const (
KexTTL = 1 * time.Minute
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Channel ¶
type Channel struct { sync.Mutex // to protect the key mask/unmask // contains filtered or unexported fields }
func NewChannel ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CheckAndUpdateTrust ¶ added in v0.1.1
func (*Client) CountNetwork ¶ added in v0.2.0
func (*Client) CountTrust ¶ added in v0.2.0
func (*Client) DelNetwork ¶
func (*Client) NewNetwork ¶
func (*Client) TrustUpdateTime ¶ added in v0.2.0
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
func (*Network) DeleteChannelKey ¶
func (*Network) DeletePersonae ¶
func (*Network) Personae ¶
func (n *NetworkContext) Personae(nick string) (p *personae.Personae, err error) {
func (*Network) SetChannelKey ¶
func (n *Network) SetChannelKey(k *Channel, name string) {
func (*Network) SetPersonae ¶
type Personae ¶
type Personae struct {
// contains filtered or unexported fields
}
func FromIdentity ¶
func FromIdentity(nick, pub string, dbg *log.Logger) (p *Personae, err error) {
func (*Personae) CanKexOpen ¶
func (*Personae) FromEphemeral ¶
func (*Personae) FromIdentityKeys ¶
func (*Personae) IdentityKeys ¶
func (*Personae) IdentityNick ¶
func (*Personae) IsKexReady ¶
func (*Personae) NewPublicKey ¶
type Self ¶
type Self struct { *Personae // contains filtered or unexported fields }
func NewIdentity ¶
func OpenIdentity ¶
func (*Self) KeyExchangeOpen ¶
func (*Self) KeyExchangeSeal ¶
func (s *Self) KeyExchangeSeal(to *Personae, network, channel string, key []byte) (kex, sig []byte, id uint32, tstamp uint64, err error)
KEY EXCHANGE
scenarios: - no ephemeral -> ERROR - always sign - timestamp uses unixnano sec as counter. nonce building: sha3(timestamp_nano_bigendian)||sha3(server)||sha3(channel)||sha3(src_nick)||sha3(dst_nick)
output: gob( uint32 nonce, timestamp_nano int64 : []byte blob ) func (p *Personae) KeyExchangeSeal(dst *Personae, channel string, key []byte) (out string, err error) { func (s *Self) KeyExchangeSeal(to *Personae, network, channel string, key []byte) (kex, tstamp, sig, id []byte, err error) {