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

Private cross signing identity.

This object holds the private and public ed25519 key triplet that is used for cross signing.

The object might be completely empty or have only some of the key pairs available.

It can be used to sign devices or other identities.

Implementations§

source§

impl PrivateCrossSigningIdentity

source

pub fn user_id(&self) -> &UserId

Get the user id that this identity belongs to.

source

pub async fn is_empty(&self) -> bool

Is the identity empty.

An empty identity doesn’t contain any private keys.

It is usual for the identity not to contain the master key since the master key is only needed to sign the subkeys.

An empty identity indicates that either no identity was created for this use or that another device created it and hasn’t shared it yet with us.

source

pub async fn master_key_id(&self) -> Option<OwnedDeviceKeyId>

Get the key ID of the master key.

source

pub async fn can_sign_devices(&self) -> bool

Can we sign our own devices, i.e. do we have a self signing key.

source

pub async fn can_sign_users(&self) -> bool

Can we sign other users, i.e. do we have a user signing key.

source

pub async fn has_master_key(&self) -> bool

Do we have the master key.

source

pub async fn status(&self) -> CrossSigningStatus

Get the status of our private cross signing keys, i.e. if we have the master key and the subkeys.

source

pub async fn master_public_key(&self) -> Option<MasterPubkey>

Get the public part of the master key, if we have one.

source

pub async fn self_signing_public_key(&self) -> Option<SelfSigningPubkey>

Get the public part of the self-signing key, if we have one.

source

pub async fn user_signing_public_key(&self) -> Option<UserSigningPubkey>

Get the public part of the user-signing key, if we have one.

source

pub async fn export_secret(&self, secret_name: &SecretName) -> Option<String>

Export the seed of the private cross signing key

The exported seed will be encoded as unpadded base64.

§Arguments
  • secret_name - The type of the cross signing key that should be exported.
source

pub async fn import_secrets_unchecked( &self, master_key: Option<&str>, self_signing_key: Option<&str>, user_signing_key: Option<&str> ) -> Result<(), SecretImportError>

Import the private parts of the cross signing keys into this identity.

The private parts should be unexpanded Ed25519 keys encoded as a base64 string.

Note: This method won’t check if the public keys match the public keys present on the server.

source

pub fn empty(user_id: &UserId) -> Self

Create a new empty identity.

source

pub fn mark_as_shared(&self)

Mark the identity as shared.

source

pub fn shared(&self) -> bool

Has the identity been shared.

A shared identity here means that the public keys of the identity have been uploaded to the server.

source

pub async fn pickle(&self) -> PickledCrossSigningIdentity

Store the cross signing identity as a pickle.

§Arguments
  • pickle_key - The key that should be used to encrypt the signing object, must be 32 bytes long.
§Panics

This will panic if the provided pickle key isn’t 32 bytes long.

source

pub async fn from_pickle( pickle: PickledCrossSigningIdentity ) -> Result<Self, SigningError>

Restore the private cross signing identity from a pickle.

§Panic

Panics if the pickle_key isn’t 32 bytes long.

Trait Implementations§

source§

impl Clone for PrivateCrossSigningIdentity

source§

fn clone(&self) -> PrivateCrossSigningIdentity

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PrivateCrossSigningIdentity

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
source§

fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
source§

fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<>
source§

fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

source§

const WITNESS: W = W::MAKE

A constant of the type witness
source§

impl<T> Identity for T
where T: ?Sized,

§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> AsyncTraitDeps for T

source§

impl<T> SendOutsideWasm for T
where T: Send,

source§

impl<T> SyncOutsideWasm for T
where T: Sync,