pub struct Account { /* private fields */ }
Expand description

An Olm account manages all cryptographic keys used on a device.

Implementations

Create a new Account with new random identity keys.

Get the IdentityKeys of this Account

Get a reference to the account’s public Ed25519 key

Get a reference to the account’s public Curve25519 key

Get a reference to the account’s public Curve25519 key as an unpadded base64-encoded string.

Sign the given message using our Ed25519 fingerprint key.

Get the maximum number of one-time keys the client should keep on the server.

Note: this differs from the libolm method of the same name, the libolm method returned the maximum amount of one-time keys the Account could hold and only half of those should be uploaded.

Create a Session with the given identity key and one-time key.

Remove a one-time key that has previously been published but not yet used.

Note: This function is only rarely useful and you’ll know if you need it. Notably, you do not need to call it manually when using up a key via Account::create_inbound_session since the key is automatically removed in that case.

Create a Session from the given pre-key message and identity key

Generates the supplied number of one time keys.

Get the currently unpublished one-time keys.

The one-time keys should be published to a server and marked as published using the mark_keys_as_published() method.

Get the currently unpublished one-time keys in base64-encoded form.

The one-time keys should be published to a server and marked as published using the mark_keys_as_published() method.

Generate a single new fallback key.

The fallback key will be used by other users to establish a Session if all the one-time keys on the server have been used up.

Get the currently unpublished fallback key.

The fallback key should be published just like the one-time keys, after it has been successfully published it needs to be marked as published using the mark_keys_as_published() method as well.

The Account stores at most two private parts of the fallback key. This method lets us forget the previously used fallback key.

Mark all currently unpublished one-time and fallback keys as published.

Convert the account into a struct which implements serde::Serialize and serde::Deserialize.

Restore an Account from a previously saved AccountPickle.

Available on crate feature libolm-compat only.

Create an Account object by unpickling an account pickle in libolm legacy pickle format.

Such pickles are encrypted and need to first be decrypted using pickle_key.

Trait Implementations

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.