SignalProtocol.Session (libsignal_protocol v0.1.1)
View SourceHandles Signal Protocol sessions for secure messaging.
This module provides a high-level interface for managing Signal Protocol sessions, including session creation, message encryption, and decryption.
Summary
Functions
Creates a new session with the given local and remote identity keys.
Creates a new session and processes a pre-key bundle in one step.
Decrypts a message using the given session.
Encrypts a message using the given session.
Processes a pre-key bundle to establish a session.
Receives a message through a session, handling decryption.
Sends a message through a session, handling encryption.
Functions
Creates a new session with the given local and remote identity keys.
Parameters
local_identity_key
- The local user's identity keyremote_identity_key
- The remote user's identity key
Returns {:ok, session}
on success, where session
is a reference to
the session state.
Creates a new session and processes a pre-key bundle in one step.
Parameters
local_identity_key
- The local user's identity keyremote_identity_key
- The remote user's identity keybundle
- The pre-key bundle to process
Returns {:ok, session}
on success.
Decrypts a message using the given session.
Parameters
session
- The session referenceciphertext
- The encrypted message to decrypt
Returns {:ok, plaintext}
on success.
Encrypts a message using the given session.
Parameters
session
- The session referencemessage
- The message to encrypt
Returns {:ok, ciphertext}
on success.
Processes a pre-key bundle to establish a session.
Parameters
session
- The session referencebundle
- The pre-key bundle to process
Returns :ok
on success.
Receives a message through a session, handling decryption.
Parameters
session
- The session referenceciphertext
- The encrypted message to receive
Returns {:ok, plaintext}
on success.
Sends a message through a session, handling encryption.
Parameters
session
- The session referencemessage
- The message to send
Returns {:ok, ciphertext}
on success.