Struct matrix_sdk_crypto::ReadOnlyDevice
source · [−]pub struct ReadOnlyDevice { /* private fields */ }Expand description
A read-only version of a Device.
Implementations
sourceimpl ReadOnlyDevice
impl ReadOnlyDevice
sourcepub fn new(device_keys: DeviceKeys, trust_state: LocalTrust) -> Self
pub fn new(device_keys: DeviceKeys, trust_state: LocalTrust) -> Self
Create a new Device, this constructor skips signature verification of
the keys, TryFrom should be used for completely new devices we
receive.
sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Get the human readable name of the device.
sourcepub fn get_key(&self, algorithm: DeviceKeyAlgorithm) -> Option<&DeviceKey>
pub fn get_key(&self, algorithm: DeviceKeyAlgorithm) -> Option<&DeviceKey>
Get the key of the given key algorithm belonging to this device.
sourcepub fn curve25519_key(&self) -> Option<Curve25519PublicKey>
pub fn curve25519_key(&self) -> Option<Curve25519PublicKey>
Get the Curve25519 key of the given device.
sourcepub fn ed25519_key(&self) -> Option<Ed25519PublicKey>
pub fn ed25519_key(&self) -> Option<Ed25519PublicKey>
Get the Ed25519 key of the given device.
sourcepub fn keys(&self) -> &BTreeMap<OwnedDeviceKeyId, DeviceKey>
pub fn keys(&self) -> &BTreeMap<OwnedDeviceKeyId, DeviceKey>
Get a map containing all the device keys.
sourcepub fn signatures(&self) -> &Signatures
pub fn signatures(&self) -> &Signatures
Get a map containing all the device signatures.
sourcepub fn local_trust_state(&self) -> LocalTrust
pub fn local_trust_state(&self) -> LocalTrust
Get the trust state of the device.
sourcepub fn is_locally_trusted(&self) -> bool
pub fn is_locally_trusted(&self) -> bool
Is the device locally marked as trusted.
sourcepub fn is_blacklisted(&self) -> bool
pub fn is_blacklisted(&self) -> bool
Is the device locally marked as blacklisted.
Blacklisted devices won’t receive any group sessions.
sourcepub fn algorithms(&self) -> &[EventEncryptionAlgorithm]
pub fn algorithms(&self) -> &[EventEncryptionAlgorithm]
Get the list of algorithms this device supports.
sourcepub fn supports_olm(&self) -> bool
pub fn supports_olm(&self) -> bool
Does this device support any of our known Olm encryption algorithms.
sourcepub fn olm_session_config(&self) -> SessionConfig
pub fn olm_session_config(&self) -> SessionConfig
Get the optimal SessionConfig for this device.
sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Is the device deleted.
sourcepub async fn from_account(account: &ReadOnlyAccount) -> ReadOnlyDevice
pub async fn from_account(account: &ReadOnlyAccount) -> ReadOnlyDevice
Create a ReadOnlyDevice from an Account
We will have our own device in the store once we receive a keys/query response, but this is useful to create it before we receive such a response.
It also makes it easier to check that the server doesn’t lie about our own device.
Don’t use this after we received a keys/query response, other users/devices might add signatures to our own device, which can’t be replicated locally.
Trait Implementations
sourceimpl Clone for ReadOnlyDevice
impl Clone for ReadOnlyDevice
sourcefn clone(&self) -> ReadOnlyDevice
fn clone(&self) -> ReadOnlyDevice
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more