Versions in this module Expand all Collapse all v1 v1.0.3 Feb 15, 2024 v1.0.2 Feb 15, 2024 Changes in this version + type Chain struct + func NewChain(senderRatchetKeyPair *ecc.ECKeyPair, chainKey *chain.Key, ...) *Chain + func NewChainFromStructure(structure *ChainStructure) (*Chain, error) + func (c *Chain) AddMessageKeys(keys *message.Keys) + func (c *Chain) ChainKey() *chain.Key + func (c *Chain) MessageKeys() []*message.Keys + func (c *Chain) PopFirstMessageKeys() *message.Keys + func (c *Chain) SenderRatchetKey() *ecc.ECKeyPair + func (c *Chain) SetChainKey(key *chain.Key) + func (c *Chain) SetMessageKeys(keys []*message.Keys) + func (c *Chain) SetSenderRatchetKey(key *ecc.ECKeyPair) + type ChainStructure struct + ChainKey *chain.KeyStructure + MessageKeys []*message.KeysStructure + SenderRatchetKeyPrivate []byte + SenderRatchetKeyPublic []byte + type PendingKeyExchange struct + func NewPendingKeyExchange(sequence uint32, localBaseKeyPair, localRatchetKeyPair *ecc.ECKeyPair, ...) *PendingKeyExchange + func NewPendingKeyExchangeFromStruct(structure *PendingKeyExchangeStructure) *PendingKeyExchange + type PendingKeyExchangeStructure struct + LocalBaseKeyPrivate []byte + LocalBaseKeyPublic []byte + LocalIdentityKeyPrivate []byte + LocalIdentityKeyPublic []byte + LocalRatchetKeyPrivate []byte + LocalRatchetKeyPublic []byte + Sequence uint32 + type PendingPreKey struct + func NewPendingPreKey(preKeyID *optional.Uint32, signedPreKeyID uint32, baseKey ecc.ECPublicKeyable) *PendingPreKey + func NewPendingPreKeyFromStruct(preKey *PendingPreKeyStructure) (*PendingPreKey, error) + type PendingPreKeyStructure struct + BaseKey []byte + PreKeyID *optional.Uint32 + SignedPreKeyID uint32 + type PreKey struct + func NewPreKey(id uint32, keyPair *ecc.ECKeyPair, serializer PreKeySerializer) *PreKey + func NewPreKeyFromBytes(serialized []byte, serializer PreKeySerializer) (*PreKey, error) + func NewPreKeyFromStruct(structure *PreKeyStructure, serializer PreKeySerializer) (*PreKey, error) + func (p *PreKey) ID() *optional.Uint32 + func (p *PreKey) KeyPair() *ecc.ECKeyPair + func (p *PreKey) Serialize() []byte + type PreKeySerializer interface + Deserialize func(serialized []byte) (*PreKeyStructure, error) + Serialize func(preKey *PreKeyStructure) []byte + type PreKeyStructure struct + ID uint32 + PrivateKey []byte + PublicKey []byte + type ReceiverChainPair struct + Index int + ReceiverChain *Chain + func NewReceiverChainPair(receiverChain *Chain, index int) *ReceiverChainPair + type Session struct + func NewSession(serializer SessionSerializer, stateSerializer StateSerializer) *Session + func NewSessionFromBytes(serialized []byte, serializer SessionSerializer, ...) (*Session, error) + func NewSessionFromState(sessionState *State, serializer SessionSerializer) *Session + func NewSessionFromStructure(structure *SessionStructure, serializer SessionSerializer, ...) (*Session, error) + func (r *Session) ArchiveCurrentState() + func (r *Session) HasSessionState(version int, senderBaseKey []byte) bool + func (r *Session) IsFresh() bool + func (r *Session) PreviousSessionStates() []*State + func (r *Session) PromoteState(promotedState *State) + func (r *Session) Serialize() []byte + func (r *Session) SessionState() *State + func (r *Session) SetState(sessionState *State) + func (r *Session) Structure() *SessionStructure + type SessionSerializer interface + Deserialize func(serialized []byte) (*SessionStructure, error) + Serialize func(state *SessionStructure) []byte + type SessionStructure struct + PreviousStates []*StateStructure + SessionState *StateStructure + type SignedPreKey struct + func NewSignedPreKey(id uint32, timestamp int64, keyPair *ecc.ECKeyPair, sig [64]byte, ...) *SignedPreKey + func NewSignedPreKeyFromBytes(serialized []byte, serializer SignedPreKeySerializer) (*SignedPreKey, error) + func NewSignedPreKeyFromStruct(structure *SignedPreKeyStructure, serializer SignedPreKeySerializer) (*SignedPreKey, error) + func (s *SignedPreKey) ID() uint32 + func (s *SignedPreKey) KeyPair() *ecc.ECKeyPair + func (s *SignedPreKey) Serialize() []byte + func (s *SignedPreKey) Signature() [64]byte + func (s *SignedPreKey) Timestamp() int64 + type SignedPreKeySerializer interface + Deserialize func(serialized []byte) (*SignedPreKeyStructure, error) + Serialize func(signedPreKey *SignedPreKeyStructure) []byte + type SignedPreKeyStructure struct + ID uint32 + PrivateKey []byte + PublicKey []byte + Signature []byte + Timestamp int64 + type State struct + func NewState(serializer StateSerializer) *State + func NewStateFromBytes(serialized []byte, serializer StateSerializer) (*State, error) + func NewStateFromStructure(structure *StateStructure, serializer StateSerializer) (*State, error) + func (s *State) AddReceiverChain(senderRatchetKey ecc.ECPublicKeyable, chainKey session.ChainKeyable) + func (s *State) ClearUnackPreKeyMessage() + func (s *State) HasMessageKeys(senderEphemeral ecc.ECPublicKeyable, counter uint32) bool + func (s *State) HasPendingKeyExchange() bool + func (s *State) HasReceiverChain(senderEphemeral ecc.ECPublicKeyable) bool + func (s *State) HasSenderChain() bool + func (s *State) HasUnacknowledgedPreKeyMessage() bool + func (s *State) LocalIdentityKey() *identity.Key + func (s *State) LocalRegistrationID() uint32 + func (s *State) PendingKeyExchangeBaseKeyPair() *ecc.ECKeyPair + func (s *State) PendingKeyExchangeIdentityKeyPair() *identity.KeyPair + func (s *State) PendingKeyExchangeRatchetKeyPair() *ecc.ECKeyPair + func (s *State) PendingKeyExchangeSequence() uint32 + func (s *State) PreviousCounter() uint32 + func (s *State) ReceiverChainKey(senderEphemeral ecc.ECPublicKeyable) *chain.Key + func (s *State) RemoteIdentityKey() *identity.Key + func (s *State) RemoteRegistrationID() uint32 + func (s *State) RemoveMessageKeys(senderEphemeral ecc.ECPublicKeyable, counter uint32) *message.Keys + func (s *State) RootKey() session.RootKeyable + func (s *State) SenderBaseKey() []byte + func (s *State) SenderChainKey() session.ChainKeyable + func (s *State) SenderRatchetKey() ecc.ECPublicKeyable + func (s *State) SenderRatchetKeyPair() *ecc.ECKeyPair + func (s *State) Serialize() []byte + func (s *State) SetLocalIdentityKey(identityKey *identity.Key) + func (s *State) SetLocalRegistrationID(registrationID uint32) + func (s *State) SetMessageKeys(senderEphemeral ecc.ECPublicKeyable, messageKeys *message.Keys) + func (s *State) SetPendingKeyExchange(sequence uint32, ourBaseKey, ourRatchetKey *ecc.ECKeyPair, ...) + func (s *State) SetPreviousCounter(previousCounter uint32) + func (s *State) SetReceiverChainKey(senderEphemeral ecc.ECPublicKeyable, chainKey session.ChainKeyable) + func (s *State) SetRemoteIdentityKey(identityKey *identity.Key) + func (s *State) SetRemoteRegistrationID(registrationID uint32) + func (s *State) SetRootKey(rootKey session.RootKeyable) + func (s *State) SetSenderBaseKey(senderBaseKey []byte) + func (s *State) SetSenderChain(senderRatchetKeyPair *ecc.ECKeyPair, chainKey session.ChainKeyable) + func (s *State) SetSenderChainKey(nextChainKey session.ChainKeyable) + func (s *State) SetUnacknowledgedPreKeyMessage(preKeyID *optional.Uint32, signedPreKeyID uint32, baseKey ecc.ECPublicKeyable) + func (s *State) SetVersion(version int) + func (s *State) UnackPreKeyMessageItems() (*UnackPreKeyMessageItems, error) + func (s *State) Version() int + type StateSerializer interface + Deserialize func(serialized []byte) (*StateStructure, error) + Serialize func(state *StateStructure) []byte + type StateStructure struct + LocalIdentityPublic []byte + LocalRegistrationID uint32 + NeedsRefresh bool + PendingKeyExchange *PendingKeyExchangeStructure + PendingPreKey *PendingPreKeyStructure + PreviousCounter uint32 + ReceiverChains []*ChainStructure + RemoteIdentityPublic []byte + RemoteRegistrationID uint32 + RootKey []byte + SenderBaseKey []byte + SenderChain *ChainStructure + SessionVersion int + type UnackPreKeyMessageItems struct + func NewUnackPreKeyMessageItems(preKeyID *optional.Uint32, signedPreKeyID uint32, baseKey ecc.ECPublicKeyable) *UnackPreKeyMessageItems + func NewUnackPreKeyMessageItemsFromStruct(structure *UnackPreKeyMessageItemsStructure) *UnackPreKeyMessageItems + func (u *UnackPreKeyMessageItems) BaseKey() ecc.ECPublicKeyable + func (u *UnackPreKeyMessageItems) PreKeyID() *optional.Uint32 + func (u *UnackPreKeyMessageItems) SignedPreKeyID() uint32 + type UnackPreKeyMessageItemsStructure struct + BaseKey []byte + PreKeyID *optional.Uint32 + SignedPreKeyID uint32