Struct matrix_sdk_crypto::types::CrossSigningKey
source · pub struct CrossSigningKey {
pub user_id: OwnedUserId,
pub usage: Vec<KeyUsage>,
pub keys: SigningKeys<OwnedDeviceKeyId>,
pub signatures: Signatures,
/* private fields */
}
Expand description
A cross signing key.
Fields§
§user_id: OwnedUserId
The ID of the user the key belongs to.
usage: Vec<KeyUsage>
What the key is used for.
keys: SigningKeys<OwnedDeviceKeyId>
The public key.
The object must have exactly one property.
signatures: Signatures
Signatures of the key.
Only optional for master key.
Implementations§
source§impl CrossSigningKey
impl CrossSigningKey
sourcepub fn new(
user_id: OwnedUserId,
usage: Vec<KeyUsage>,
keys: SigningKeys<OwnedDeviceKeyId>,
signatures: Signatures,
) -> Self
pub fn new( user_id: OwnedUserId, usage: Vec<KeyUsage>, keys: SigningKeys<OwnedDeviceKeyId>, signatures: Signatures, ) -> Self
Creates a new CrossSigningKey
with the given user ID, usage, keys and
signatures.
sourcepub fn get_first_key_and_id(&self) -> Option<(&DeviceKeyId, Ed25519PublicKey)>
pub fn get_first_key_and_id(&self) -> Option<(&DeviceKeyId, Ed25519PublicKey)>
Get the Ed25519 cross-signing key (and its ID).
Structurally, a cross-signing key could contain more than one actual
key. However, the spec forbids this (see
the keys
field description), so we just get the first one.
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
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl AsMut<CrossSigningKey> for SelfSigningPubkey
impl AsMut<CrossSigningKey> for SelfSigningPubkey
source§fn as_mut(&mut self) -> &mut CrossSigningKey
fn as_mut(&mut self) -> &mut CrossSigningKey
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl AsMut<CrossSigningKey> for UserSigningPubkey
impl AsMut<CrossSigningKey> for UserSigningPubkey
source§fn as_mut(&mut self) -> &mut CrossSigningKey
fn as_mut(&mut self) -> &mut CrossSigningKey
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl AsRef<CrossSigningKey> for MasterPubkey
impl AsRef<CrossSigningKey> for MasterPubkey
source§fn as_ref(&self) -> &CrossSigningKey
fn as_ref(&self) -> &CrossSigningKey
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<CrossSigningKey> for SelfSigningPubkey
impl AsRef<CrossSigningKey> for SelfSigningPubkey
source§fn as_ref(&self) -> &CrossSigningKey
fn as_ref(&self) -> &CrossSigningKey
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<CrossSigningKey> for UserSigningPubkey
impl AsRef<CrossSigningKey> for UserSigningPubkey
source§fn as_ref(&self) -> &CrossSigningKey
fn as_ref(&self) -> &CrossSigningKey
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for CrossSigningKey
impl Clone for CrossSigningKey
source§fn clone(&self) -> CrossSigningKey
fn clone(&self) -> CrossSigningKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CrossSigningKey
impl Debug for CrossSigningKey
source§impl<'de> Deserialize<'de> for CrossSigningKey
impl<'de> Deserialize<'de> for CrossSigningKey
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for CrossSigningKey
impl Serialize for CrossSigningKey
source§impl TryFrom<CrossSigningKey> for MasterPubkey
impl TryFrom<CrossSigningKey> for MasterPubkey
source§impl TryFrom<CrossSigningKey> for SelfSigningPubkey
impl TryFrom<CrossSigningKey> for SelfSigningPubkey
source§impl TryFrom<CrossSigningKey> for UserSigningPubkey
impl TryFrom<CrossSigningKey> for UserSigningPubkey
Auto Trait Implementations§
impl Freeze for CrossSigningKey
impl RefUnwindSafe for CrossSigningKey
impl Send for CrossSigningKey
impl Sync for CrossSigningKey
impl Unpin for CrossSigningKey
impl UnwindSafe for CrossSigningKey
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt for T
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>
Consume a handle, getting back the initial
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>
Converts
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>
Converts
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