Module Olm.InboundGroupSession
type t={buf : char Ctypes.ptr;igs : C.Types.InboundGroupSession.t Ctypes_static.ptr;}
val clear : C.Types.InboundGroupSession.t Ctypes_static.ptr -> (int, [> `OlmError ]) Core.resultclear igsClear memory backing the given
igspointer.
val check_error : t -> Unsigned.size_t -> (int, [> OlmError.t ]) Core.resultcheck_error t retCheck whether return code
retis equal to `olm_error()` ( -1 ), returning the return value as an int if not, and the `last_error` from the inbound group sessiontif so.
val alloc : unit -> talloc ()Allocate an
C.Types.InboundGroupSession.tand return the pointers in at.
val create : string -> (t, [> OlmError.t ]) Core.resultcreate outbound_session_keyStart a new inbound group session, using an exported
outbound_session_key, (obtained withOutboundGroupSession.session_key).
val pickle : ?pass:string -> t -> (string, [> OlmError.t ]) Core.resultpickle ?pass tStores an inbound group session object
tas a base64 string. Encrypting it using the optionally supplied passphrasepass. Returns a base64 encoded string of the pickled inbound group session on success.
val from_pickle : ?pass:string -> string -> (t, [> OlmError.t | `ValueError of string ]) Core.resultfrom_pickle ?pass pickleLoads an inbound group session from a pickled base64-encoded string
pickleand returns at, decrypted with the optionally supplied passphrasepass. If the passphrase doesn't match the one used to encrypt the account then the error will be`BadAccountKey. If the base64 couldn't be decoded then the error will be`InvalidBase64.
val decrypt : ?ignore_unicode_errors:bool -> t -> string -> (string * int, [> OlmError.t | `ValueError of string | `UnicodeError ]) Core.resultdecrypt t ciphertextReturns a tuple of the plain-text decrypted from
ciphertextbytand the message index of the decrypted message or an error on failure. Invalid unicode characters are replaced withUutf.u_repunlessignore_unicode_errorsis set to true. Possible olm errors include:*
`InvalidBase64if the message is not valid base64 *`BadMessageVersionif the message was encrypted with an unsupported version of the protocol *`BadMessageFormatif the message headers could not be decoded *`BadMessageMacif the message could not be verified *`UnknownMessageIndexif we do not have a session key corresponding to the message's index (i.e., it was sent before the session key was shared with us)
val id : t -> (string, [> OlmError.t ]) Core.resultid tA base64 encoded identifier for the session
t.
val first_known_index : t -> intfirst_known_index tThe first message index we know how to decrypt for
t.
val export_session : t -> int -> (string, [> OlmError.t ]) Core.resultexport_session t message_indexExport the base64-encoded ratchet key for the session
t, at the givenmessage_index, in a format which can be used byimport_session. Error will be`UnknownMessageIndexif we do not have a session key formessage_index(i.e., it was sent before the session key was shared with us)
val import_session : string -> (t, [> OlmError.t ]) Core.resultimport_session exported_keyCreates an inbound group session with an
exported_keyfrom an (previously) existing inbound group session. If theexported_keyis not valid, the error will be`BadSessionKey.
val is_verified : t -> boolis_verified tCheck if the session has been verified as a valid session. (A session is verified either because the original session share was signed, or because we have subsequently successfully decrypted a message.)