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

A struct representing a short auth string verification object where the shared secret has been established.

This object can be used to generate the short auth string and calculate and verify a MAC that protects information about the keys being verified.

Implementations

Generate SasBytes using HKDF with the shared secret as the input key material.

The info string should be agreed upon beforehand, both parties need to use the same info string.

Generate the given number of bytes using HKDF with the shared secret as the input key material.

The info string should be agreed upon beforehand, both parties need to use the same info string.

The number of bytes we can generate is limited, we can generate up to 32 * 255 bytes. The function will not fail if the given count is smaller than the limit.

Calculate a MAC for the given input using the info string as additional data.

This should be used to calculate a MAC of the ed25519 identity key of an Account

The MAC is returned as a base64 encoded string.

Calculate a MAC for the given input using the info string as additional data, the MAC is returned as an invalid base64 encoded string.

Warning: This method should never be used unless you require libolm compatibility. Libolm used to incorrectly encode their MAC because the input buffer was reused as the output buffer. This method replicates the buggy behaviour.

Verify a MAC that was previously created using the EstablishedSas::calculate_mac() method.

Users should calculate a MAC and send it to the other side, they should then verify each other’s MAC using this method.

Get the public key that was created by us, that was used to establish the shared secret.

Get the public key that was created by the other party, that was used to establish the shared secret.

Trait Implementations

Formats the value using the given formatter. Read more

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.