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

The session key, can be used to create a InboundGroupSession.

Uses the session-sharing format described in the Olm spec.

+—+––+––––+––––+––––+––––+——+———–+ | V | i | R(i,0) | R(i,1) | R(i,2) | R(i,3) | Kpub | Signature | +—+––+––––+––––+––––+––––+——+———–+ 0 1 5 37 69 101 133 165 229 bytes

The version byte, V, is “\x02”. This is followed by the ratchet index, iii, which is encoded as a big-endian 32-bit integer; the 128 bytes of the ratchet; and the public part of the Ed25519 keypair.

The data is then signed using the Ed25519 key, and the 64-byte signature is appended.

Implementations

Serialize the SessionKey to a byte vector.

Deserialize the SessionKey from a byte slice.

Serialize the SessionKey to a base64 encoded string.

This method will first use the SessionKey::to_bytes() to convert the session key to a byte vector and then encode the byte vector to a string using unpadded base64 as the encoding.

Deserialize the SessionKey from base64 encoded string.

Trait Implementations

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. 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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more