Module Pk.Decryption
type t={buf : char Ctypes.ptr;pk_dec : C.Types.PkDecryption.t Ctypes_static.ptr;pubkey : string;}
val clear : C.Types.PkDecryption.t Ctypes_static.ptr -> (int, [> `OlmError ]) Core.resultclear pk_decClear memory backing the given
pk_decpointer.
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 pk decryption objecttif so.
val alloc : unit -> talloc ()Allocate an
C.Types.Pk.Decryption.tand return the pointers in at.
val create : unit -> (t, [> OlmError.t ]) Core.resultcreate ()Create a new PK decryption object, returning its pointers and public key in a
t
val pickle : ?pass:string -> t -> (string, [> OlmError.t ]) Core.resultpickle ?pass tStores a PK decryption object
tas a base64 string, encrypting it using the optionally supplied passphrasepass. Returns a base64 encoded string of the pickled pk decryption on success.
val from_pickle : ?pass:string -> string -> (t, [> OlmError.t | `ValueError of string ]) Core.resultfrom_pickle ?pass pickleLoads PK decryption object 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 -> Message.t -> (string, [> OlmError.t | `UnicodeError ]) Core.resultdecrypt t msgDecrypts a previously encrypted pk
msginto plaintext witht. Invalid unicode characters are replaced withUutf.u_repunlessignore_unicode_errorsis set to true.
val private_key : t -> (string, [> OlmError.t ]) Core.resultprivate_key tGet the private key from
t.