Documentation ¶
Index ¶
- Variables
- type CryptoHelper
- func (helper *CryptoHelper) Close() error
- func (helper *CryptoHelper) Decrypt(ctx context.Context, evt *event.Event) (*event.Event, error)
- func (helper *CryptoHelper) Encrypt(ctx context.Context, roomID id.RoomID, evtType event.Type, content any) (encrypted *event.EncryptedEventContent, err error)
- func (helper *CryptoHelper) EncryptWithStateKey(ctx context.Context, roomID id.RoomID, evtType event.Type, stateKey *string, ...) (encrypted *event.EncryptedEventContent, err error)
- func (helper *CryptoHelper) HandleEncrypted(ctx context.Context, evt *event.Event)
- func (helper *CryptoHelper) Init(ctx context.Context) error
- func (helper *CryptoHelper) Machine() *crypto.OlmMachine
- func (helper *CryptoHelper) RequestSession(ctx context.Context, roomID id.RoomID, senderKey id.SenderKey, ...)
- func (helper *CryptoHelper) WaitForSession(ctx context.Context, roomID id.RoomID, senderKey id.SenderKey, ...) bool
Constants ¶
This section is empty.
Variables ¶
var NoSessionFound = crypto.NoSessionFound
Functions ¶
This section is empty.
Types ¶
type CryptoHelper ¶
type CryptoHelper struct { DecryptErrorCallback func(*event.Event, error) LoginAs *mautrix.ReqLogin ASEventProcessor crypto.ASEventProcessor CustomPostDecrypt func(context.Context, *event.Event) DBAccountID string // contains filtered or unexported fields }
func NewCryptoHelper ¶
NewCryptoHelper creates a struct that helps a mautrix client struct with Matrix e2ee operations.
The client and pickle key are always required. Additionally, you must either: - Provide a crypto.Store here and set a StateStore in the client, or - Provide a dbutil.Database here to automatically create missing stores. - Provide a string here to use it as a path to a SQLite database, and then automatically create missing stores.
The same database may be shared across multiple clients, but note that doing that will allow all clients access to decryption keys received by any one of the clients. For that reason, the pickle key must also be same for all clients using the same database.
func (*CryptoHelper) Close ¶
func (helper *CryptoHelper) Close() error
func (*CryptoHelper) EncryptWithStateKey ¶ added in v0.20.0
func (*CryptoHelper) HandleEncrypted ¶
func (helper *CryptoHelper) HandleEncrypted(ctx context.Context, evt *event.Event)
func (*CryptoHelper) Machine ¶ added in v0.15.1
func (helper *CryptoHelper) Machine() *crypto.OlmMachine