Struct matrix_sdk_crypto::types::MasterPubkey
source · pub struct MasterPubkey(/* private fields */);
Expand description
Wrapper for a cross signing key marking it as the master key.
Master keys are used to sign other cross signing keys, the self signing and user signing keys of an user will be signed by their master key.
Implementations§
source§impl MasterPubkey
impl MasterPubkey
sourcepub fn keys(&self) -> &SigningKeys<OwnedDeviceKeyId>
pub fn keys(&self) -> &SigningKeys<OwnedDeviceKeyId>
Get the keys map of containing the master keys.
sourcepub fn signatures(&self) -> &Signatures
pub fn signatures(&self) -> &Signatures
Get the signatures map of this cross signing key.
sourcepub fn get_key(&self, key_id: &DeviceKeyId) -> Option<&SigningKey>
pub fn get_key(&self, key_id: &DeviceKeyId) -> Option<&SigningKey>
Get the master key with the given key id.
§Arguments
key_id
- The id of the key that should be fetched.
sourcepub fn get_first_key(&self) -> Option<Ed25519PublicKey>
pub fn get_first_key(&self) -> Option<Ed25519PublicKey>
Get the first available master key.
There’s usually only a single master key so this will usually fetch the only key.
Trait Implementations§
source§impl AsMut<CrossSigningKey> for MasterPubkey
impl AsMut<CrossSigningKey> for MasterPubkey
source§fn as_mut(&mut self) -> &mut CrossSigningKey
fn as_mut(&mut self) -> &mut CrossSigningKey
source§impl AsRef<CrossSigningKey> for MasterPubkey
impl AsRef<CrossSigningKey> for MasterPubkey
source§fn as_ref(&self) -> &CrossSigningKey
fn as_ref(&self) -> &CrossSigningKey
source§impl Clone for MasterPubkey
impl Clone for MasterPubkey
source§fn clone(&self) -> MasterPubkey
fn clone(&self) -> MasterPubkey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MasterPubkey
impl Debug for MasterPubkey
source§impl<'de> Deserialize<'de> for MasterPubkey
impl<'de> Deserialize<'de> for MasterPubkey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<'a> IntoIterator for &'a MasterPubkey
impl<'a> IntoIterator for &'a MasterPubkey
§type Item = (&'a OwnedKeyId<DeviceKeyAlgorithm, DeviceId>, &'a SigningKey)
type Item = (&'a OwnedKeyId<DeviceKeyAlgorithm, DeviceId>, &'a SigningKey)
§type IntoIter = Iter<'a, OwnedKeyId<DeviceKeyAlgorithm, DeviceId>, SigningKey>
type IntoIter = Iter<'a, OwnedKeyId<DeviceKeyAlgorithm, DeviceId>, SigningKey>
source§impl PartialEq for MasterPubkey
impl PartialEq for MasterPubkey
source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
The PartialEq
implementation compares the user ID, the usage and the
key material, ignoring signatures.
The usage could be safely ignored since the type guarantees it has the correct usage by construction – it is impossible to construct a value of a particular key type with an incorrect usage. However, we check it anyway, to codify the notion that the same key material with a different usage results in a logically different key.
The signatures are provided by other devices and don’t alter the identity of the key itself.
source§impl Serialize for MasterPubkey
impl Serialize for MasterPubkey
source§impl TryFrom<CrossSigningKey> for MasterPubkey
impl TryFrom<CrossSigningKey> for MasterPubkey
impl Eq for MasterPubkey
Auto Trait Implementations§
impl Freeze for MasterPubkey
impl RefUnwindSafe for MasterPubkey
impl Send for MasterPubkey
impl Sync for MasterPubkey
impl Unpin for MasterPubkey
impl UnwindSafe for MasterPubkey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more