Documentation ¶
Overview ¶
Package groups is responsible for setting up group SenderKey encrypted sessions. Once a session has been established, GroupCipher can be used to encrypt/decrypt messages in that session.
The built sessions are unidirectional: they can be used either for sending or for receiving, but not both. Sessions are constructed per (groupId + senderId + deviceId) tuple. Remote logical users are identified by their senderId, and each logical recipientId can have multiple physical devices.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GroupCipher ¶
type GroupCipher struct {
// contains filtered or unexported fields
}
GroupCipher is the main entry point for group encrypt/decrypt operations. Once a session has been established, this can be used for all encrypt/decrypt operations within that session.
func NewGroupCipher ¶
func NewGroupCipher(builder *SessionBuilder, senderKeyID *protocol.SenderKeyName, senderKeyStore store.SenderKey) *GroupCipher
NewGroupCipher will return a new group message cipher that can be used for encrypt/decrypt operations.
func (*GroupCipher) Decrypt ¶
func (c *GroupCipher) Decrypt(senderKeyMessage *protocol.SenderKeyMessage) ([]byte, error)
Decrypt decrypts the given message using an existing session that is stored in the senderKey store.
func (*GroupCipher) Encrypt ¶
func (c *GroupCipher) Encrypt(plaintext []byte) (protocol.CiphertextMessage, error)
Encrypt will take the given message in bytes and return encrypted bytes.
type SessionBuilder ¶
type SessionBuilder struct {
// contains filtered or unexported fields
}
SessionBuilder is a structure for building group sessions.
func NewGroupSessionBuilder ¶
func NewGroupSessionBuilder(senderKeyStore store.SenderKey, serializer *serialize.Serializer) *SessionBuilder
NewGroupSessionBuilder will return a new group session builder.
func (*SessionBuilder) Create ¶
func (b *SessionBuilder) Create(senderKeyName *protocol.SenderKeyName) (*protocol.SenderKeyDistributionMessage, error)
Create will create a new group session for the given name.
func (*SessionBuilder) Process ¶
func (b *SessionBuilder) Process(senderKeyName *protocol.SenderKeyName, msg *protocol.SenderKeyDistributionMessage)
Process will process an incoming group message and set up the corresponding session for it.
Directories ¶
Path | Synopsis |
---|---|
Package ratchet provides the methods necessary to establish a ratchet session for group messaging.
|
Package ratchet provides the methods necessary to establish a ratchet session for group messaging. |
state
|
|
record
Package record provides the state and record of a group session.
|
Package record provides the state and record of a group session. |
store
Package store provides the storage interfaces for storing group sender key records.
|
Package store provides the storage interfaces for storing group sender key records. |