Versions in this module Expand all Collapse all v0 v0.16.2 Oct 4, 2018 v0.16.1 Sep 28, 2018 v0.16.0 Sep 27, 2018 v0.15.1 Sep 27, 2018 Changes in this version + var ErrSessionNotFound = errors.New("session not found") + func DirectMessageToWhisper(rpcMsg *SendDirectMessageRPC, payload []byte) *whisper.NewMessage + func ExtractIdentity(bundle *Bundle) (string, error) + func PerformActiveDH(publicKey *ecdsa.PublicKey) ([]byte, *ecdsa.PublicKey, error) + func PerformActiveX3DH(identity []byte, signedPreKey []byte, prv *ecdsa.PrivateKey) ([]byte, *ecdsa.PublicKey, error) + func PerformDH(privateKey *ecies.PrivateKey, publicKey *ecies.PublicKey) ([]byte, error) + func PerformPassiveX3DH(theirIdentityKey *ecdsa.PublicKey, mySignedPreKey *ecdsa.PrivateKey, ...) ([]byte, error) + func PublicMessageToWhisper(rpcMsg *SendPublicMessageRPC, payload []byte) *whisper.NewMessage + func SignBundle(identity *ecdsa.PrivateKey, bundleContainer *BundleContainer) error + func VerifyBundle(bundle *Bundle) error + type Bundle struct + Identity []byte + Signature []byte + SignedPreKeys map[string]*SignedPreKey + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func FromBase64(str string) (*Bundle, error) + func (*Bundle) Descriptor() ([]byte, []int) + func (*Bundle) ProtoMessage() + func (bundle *Bundle) ToBase64() (string, error) + func (m *Bundle) GetIdentity() []byte + func (m *Bundle) GetSignature() []byte + func (m *Bundle) GetSignedPreKeys() map[string]*SignedPreKey + func (m *Bundle) Reset() + func (m *Bundle) String() string + func (m *Bundle) XXX_DiscardUnknown() + func (m *Bundle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Bundle) XXX_Merge(src proto.Message) + func (m *Bundle) XXX_Size() int + func (m *Bundle) XXX_Unmarshal(b []byte) error + type BundleContainer struct + Bundle *Bundle + PrivateSignedPreKey []byte + Timestamp int64 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func NewBundleContainer(identity *ecdsa.PrivateKey, installationID string) (*BundleContainer, error) + func (*BundleContainer) Descriptor() ([]byte, []int) + func (*BundleContainer) ProtoMessage() + func (m *BundleContainer) GetBundle() *Bundle + func (m *BundleContainer) GetPrivateSignedPreKey() []byte + func (m *BundleContainer) GetTimestamp() int64 + func (m *BundleContainer) Reset() + func (m *BundleContainer) String() string + func (m *BundleContainer) XXX_DiscardUnknown() + func (m *BundleContainer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *BundleContainer) XXX_Merge(src proto.Message) + func (m *BundleContainer) XXX_Size() int + func (m *BundleContainer) XXX_Unmarshal(b []byte) error + type ChatMessagePayload struct + ClockValue float64 + Content string + ContentType string + MessageType string + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ChatMessagePayload) Descriptor() ([]byte, []int) + func (*ChatMessagePayload) ProtoMessage() + func (m *ChatMessagePayload) GetClockValue() float64 + func (m *ChatMessagePayload) GetContent() string + func (m *ChatMessagePayload) GetContentType() string + func (m *ChatMessagePayload) GetMessageType() string + func (m *ChatMessagePayload) Reset() + func (m *ChatMessagePayload) String() string + func (m *ChatMessagePayload) XXX_DiscardUnknown() + func (m *ChatMessagePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ChatMessagePayload) XXX_Merge(src proto.Message) + func (m *ChatMessagePayload) XXX_Size() int + func (m *ChatMessagePayload) XXX_Unmarshal(b []byte) error + type ChatProtocolMessage struct + Payload []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ChatProtocolMessage) Descriptor() ([]byte, []int) + func (*ChatProtocolMessage) ProtoMessage() + func (m *ChatProtocolMessage) GetPayload() []byte + func (m *ChatProtocolMessage) Reset() + func (m *ChatProtocolMessage) String() string + func (m *ChatProtocolMessage) XXX_DiscardUnknown() + func (m *ChatProtocolMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ChatProtocolMessage) XXX_Merge(src proto.Message) + func (m *ChatProtocolMessage) XXX_Size() int + func (m *ChatProtocolMessage) XXX_Unmarshal(b []byte) error + type ContactUpdatePayload struct + Address string + FcmToken string + Name string + ProfileImage string + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ContactUpdatePayload) Descriptor() ([]byte, []int) + func (*ContactUpdatePayload) ProtoMessage() + func (m *ContactUpdatePayload) GetAddress() string + func (m *ContactUpdatePayload) GetFcmToken() string + func (m *ContactUpdatePayload) GetName() string + func (m *ContactUpdatePayload) GetProfileImage() string + func (m *ContactUpdatePayload) Reset() + func (m *ContactUpdatePayload) String() string + func (m *ContactUpdatePayload) XXX_DiscardUnknown() + func (m *ContactUpdatePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ContactUpdatePayload) XXX_Merge(src proto.Message) + func (m *ContactUpdatePayload) XXX_Size() int + func (m *ContactUpdatePayload) XXX_Unmarshal(b []byte) error + type ContactUpdateRPC struct + Dst string + Payload *ContactUpdatePayload + Src string + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ContactUpdateRPC) Descriptor() ([]byte, []int) + func (*ContactUpdateRPC) ProtoMessage() + func (m *ContactUpdateRPC) GetDst() string + func (m *ContactUpdateRPC) GetPayload() *ContactUpdatePayload + func (m *ContactUpdateRPC) GetSrc() string + func (m *ContactUpdateRPC) Reset() + func (m *ContactUpdateRPC) String() string + func (m *ContactUpdateRPC) XXX_DiscardUnknown() + func (m *ContactUpdateRPC) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ContactUpdateRPC) XXX_Merge(src proto.Message) + func (m *ContactUpdateRPC) XXX_Size() int + func (m *ContactUpdateRPC) XXX_Unmarshal(b []byte) error + type DHHeader struct + Key []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*DHHeader) Descriptor() ([]byte, []int) + func (*DHHeader) ProtoMessage() + func (m *DHHeader) GetKey() []byte + func (m *DHHeader) Reset() + func (m *DHHeader) String() string + func (m *DHHeader) XXX_DiscardUnknown() + func (m *DHHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *DHHeader) XXX_Merge(src proto.Message) + func (m *DHHeader) XXX_Size() int + func (m *DHHeader) XXX_Unmarshal(b []byte) error + type DRHeader struct + Id []byte + Key []byte + N uint32 + Pn uint32 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*DRHeader) Descriptor() ([]byte, []int) + func (*DRHeader) ProtoMessage() + func (m *DRHeader) GetId() []byte + func (m *DRHeader) GetKey() []byte + func (m *DRHeader) GetN() uint32 + func (m *DRHeader) GetPn() uint32 + func (m *DRHeader) Reset() + func (m *DRHeader) String() string + func (m *DRHeader) XXX_DiscardUnknown() + func (m *DRHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *DRHeader) XXX_Merge(src proto.Message) + func (m *DRHeader) XXX_Size() int + func (m *DRHeader) XXX_Unmarshal(b []byte) error + type DirectMessageProtocol struct + DHHeader *DHHeader + DRHeader *DRHeader + Payload []byte + X3DHHeader *X3DHHeader + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*DirectMessageProtocol) Descriptor() ([]byte, []int) + func (*DirectMessageProtocol) ProtoMessage() + func (m *DirectMessageProtocol) GetDHHeader() *DHHeader + func (m *DirectMessageProtocol) GetDRHeader() *DRHeader + func (m *DirectMessageProtocol) GetPayload() []byte + func (m *DirectMessageProtocol) GetX3DHHeader() *X3DHHeader + func (m *DirectMessageProtocol) Reset() + func (m *DirectMessageProtocol) String() string + func (m *DirectMessageProtocol) XXX_DiscardUnknown() + func (m *DirectMessageProtocol) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *DirectMessageProtocol) XXX_Merge(src proto.Message) + func (m *DirectMessageProtocol) XXX_Size() int + func (m *DirectMessageProtocol) XXX_Unmarshal(b []byte) error + type EncryptionService struct + func NewEncryptionService(p PersistenceService, installationID string) *EncryptionService + func (s *EncryptionService) CreateBundle(privateKey *ecdsa.PrivateKey) (*Bundle, error) + func (s *EncryptionService) DecryptPayload(myIdentityKey *ecdsa.PrivateKey, theirIdentityKey *ecdsa.PublicKey, ...) ([]byte, error) + func (s *EncryptionService) DecryptWithDH(myIdentityKey *ecdsa.PrivateKey, theirEphemeralKey *ecdsa.PublicKey, ...) ([]byte, error) + func (s *EncryptionService) EncryptPayload(theirIdentityKey *ecdsa.PublicKey, myIdentityKey *ecdsa.PrivateKey, ...) (map[string]*DirectMessageProtocol, error) + func (s *EncryptionService) ProcessPublicBundle(myIdentityKey *ecdsa.PrivateKey, b *Bundle) error + type OneToOneRPC struct + Dst string + Payload []byte + Src string + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*OneToOneRPC) Descriptor() ([]byte, []int) + func (*OneToOneRPC) ProtoMessage() + func (m *OneToOneRPC) GetDst() string + func (m *OneToOneRPC) GetPayload() []byte + func (m *OneToOneRPC) GetSrc() string + func (m *OneToOneRPC) Reset() + func (m *OneToOneRPC) String() string + func (m *OneToOneRPC) XXX_DiscardUnknown() + func (m *OneToOneRPC) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *OneToOneRPC) XXX_Merge(src proto.Message) + func (m *OneToOneRPC) XXX_Size() int + func (m *OneToOneRPC) XXX_Unmarshal(b []byte) error + type PersistenceService interface + AddPrivateBundle func(*BundleContainer) error + AddPublicBundle func(*Bundle) error + AddRatchetInfo func([]byte, []byte, []byte, []byte, string) error + GetAnyPrivateBundle func([]byte) (*BundleContainer, error) + GetAnyRatchetInfo func([]byte, string) (*RatchetInfo, error) + GetKeysStorage func() dr.KeysStorage + GetPrivateKeyBundle func([]byte) ([]byte, error) + GetPublicBundle func(*ecdsa.PublicKey) (*Bundle, error) + GetRatchetInfo func([]byte, []byte) (*RatchetInfo, error) + GetSessionStorage func() dr.SessionStorage + MarkBundleExpired func([]byte) error + RatchetInfoConfirmed func([]byte, []byte) error + type ProtocolMessage struct + Bundle *Bundle + DirectMessage map[string]*DirectMessageProtocol + PublicMessage []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtocolMessage) Descriptor() ([]byte, []int) + func (*ProtocolMessage) ProtoMessage() + func (m *ProtocolMessage) GetBundle() *Bundle + func (m *ProtocolMessage) GetDirectMessage() map[string]*DirectMessageProtocol + func (m *ProtocolMessage) GetPublicMessage() []byte + func (m *ProtocolMessage) Reset() + func (m *ProtocolMessage) String() string + func (m *ProtocolMessage) XXX_DiscardUnknown() + func (m *ProtocolMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtocolMessage) XXX_Merge(src proto.Message) + func (m *ProtocolMessage) XXX_Size() int + func (m *ProtocolMessage) XXX_Unmarshal(b []byte) error + type ProtocolService struct + Enabled bool + func NewProtocolService(encryption *EncryptionService) *ProtocolService + func (p *ProtocolService) BuildDirectMessage(myIdentityKey *ecdsa.PrivateKey, theirPublicKeys []*ecdsa.PublicKey, ...) (map[*ecdsa.PublicKey][]byte, error) + func (p *ProtocolService) BuildPublicMessage(myIdentityKey *ecdsa.PrivateKey, payload []byte) ([]byte, error) + func (p *ProtocolService) GetBundle(myIdentityKey *ecdsa.PrivateKey) (*Bundle, error) + func (p *ProtocolService) HandleMessage(myIdentityKey *ecdsa.PrivateKey, theirPublicKey *ecdsa.PublicKey, ...) ([]byte, error) + func (p *ProtocolService) ProcessPublicBundle(myIdentityKey *ecdsa.PrivateKey, bundle *Bundle) error + type RatchetInfo struct + BundleID []byte + EphemeralKey []byte + ID []byte + Identity []byte + InstallationID string + PrivateKey []byte + PublicKey []byte + Sk []byte + type SQLLiteKeysStorage struct + func NewSQLLiteKeysStorage(db *sql.DB) *SQLLiteKeysStorage + func (s *SQLLiteKeysStorage) All() (map[dr.Key]map[uint]dr.Key, error) + func (s *SQLLiteKeysStorage) Count(pubKey dr.Key) (uint, error) + func (s *SQLLiteKeysStorage) DeleteMk(pubKey dr.Key, msgNum uint) error + func (s *SQLLiteKeysStorage) DeletePk(pubKey dr.Key) error + func (s *SQLLiteKeysStorage) Get(pubKey dr.Key, msgNum uint) (dr.Key, bool, error) + func (s *SQLLiteKeysStorage) Put(pubKey dr.Key, msgNum uint, mk dr.Key) error + type SQLLitePersistence struct + func NewSQLLitePersistence(path string, key string) (*SQLLitePersistence, error) + func (s *SQLLitePersistence) AddPrivateBundle(b *BundleContainer) error + func (s *SQLLitePersistence) AddPublicBundle(b *Bundle) error + func (s *SQLLitePersistence) AddRatchetInfo(key []byte, identity []byte, bundleID []byte, ephemeralKey []byte, ...) error + func (s *SQLLitePersistence) GetAnyPrivateBundle(myIdentityKey []byte) (*BundleContainer, error) + func (s *SQLLitePersistence) GetAnyRatchetInfo(identity []byte, installationID string) (*RatchetInfo, error) + func (s *SQLLitePersistence) GetKeysStorage() dr.KeysStorage + func (s *SQLLitePersistence) GetPrivateKeyBundle(bundleID []byte) ([]byte, error) + func (s *SQLLitePersistence) GetPublicBundle(publicKey *ecdsa.PublicKey) (*Bundle, error) + func (s *SQLLitePersistence) GetRatchetInfo(bundleID []byte, theirIdentity []byte) (*RatchetInfo, error) + func (s *SQLLitePersistence) GetSessionStorage() dr.SessionStorage + func (s *SQLLitePersistence) MarkBundleExpired(identity []byte) error + func (s *SQLLitePersistence) Open(path string, key string) error + func (s *SQLLitePersistence) RatchetInfoConfirmed(bundleID []byte, theirIdentity []byte) error + type SQLLiteSessionStorage struct + func NewSQLLiteSessionStorage(db *sql.DB) *SQLLiteSessionStorage + func (s *SQLLiteSessionStorage) Load(id []byte) (*dr.State, error) + func (s *SQLLiteSessionStorage) Save(id []byte, state *dr.State) error + type SendDirectMessageRPC struct + Payload hexutil.Bytes + PubKey hexutil.Bytes + Sig string + type SendGroupMessageRPC struct + Payload hexutil.Bytes + PubKeys []hexutil.Bytes + Sig string + type SendPublicMessageRPC struct + Chat string + Payload hexutil.Bytes + Sig string + type SignedPreKey struct + SignedPreKey []byte + Version uint32 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*SignedPreKey) Descriptor() ([]byte, []int) + func (*SignedPreKey) ProtoMessage() + func (m *SignedPreKey) GetSignedPreKey() []byte + func (m *SignedPreKey) GetVersion() uint32 + func (m *SignedPreKey) Reset() + func (m *SignedPreKey) String() string + func (m *SignedPreKey) XXX_DiscardUnknown() + func (m *SignedPreKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *SignedPreKey) XXX_Merge(src proto.Message) + func (m *SignedPreKey) XXX_Size() int + func (m *SignedPreKey) XXX_Unmarshal(b []byte) error + type X3DHHeader struct + Id []byte + InstallationId string + Key []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*X3DHHeader) Descriptor() ([]byte, []int) + func (*X3DHHeader) ProtoMessage() + func (m *X3DHHeader) GetId() []byte + func (m *X3DHHeader) GetInstallationId() string + func (m *X3DHHeader) GetKey() []byte + func (m *X3DHHeader) Reset() + func (m *X3DHHeader) String() string + func (m *X3DHHeader) XXX_DiscardUnknown() + func (m *X3DHHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *X3DHHeader) XXX_Merge(src proto.Message) + func (m *X3DHHeader) XXX_Size() int + func (m *X3DHHeader) XXX_Unmarshal(b []byte) error