pub struct MlsDeviceIdentity { /* private fields */ }Expand description
One device’s MLS participation identity: the owned OpenMLS provider (CapsuleMlsProvider)
(crypto + rand + serializable storage), the device’s MLS Ed25519 leaf signer, and the
device’s hybrid DSK identity key used to attest the leaf binding.
This is the unit that founds an album (OpenMlsAuthority::create_album)
or joins one (OpenMlsAuthority::join_via_welcome);
a would-be joiner uses it to publish a key_package first.
Implementations§
Source§impl MlsDeviceIdentity
impl MlsDeviceIdentity
Sourcepub fn generate(
user_id: Uuid,
device_id: Uuid,
) -> Result<Self, OpenMlsAuthorityError>
pub fn generate( user_id: Uuid, device_id: Uuid, ) -> Result<Self, OpenMlsAuthorityError>
Create a device identity with a freshly-generated DSK (software Ed25519 + ML-DSA-65).
Sourcepub fn with_dsk(
user_id: Uuid,
device_id: Uuid,
dsk: HybridSigningKey,
) -> Result<Self, OpenMlsAuthorityError>
pub fn with_dsk( user_id: Uuid, device_id: Uuid, dsk: HybridSigningKey, ) -> Result<Self, OpenMlsAuthorityError>
Create a device identity around a caller-supplied DSK — the device identity key that is (or
will be) published in the user’s DeviceDirectory. The MLS leaf signer is minted fresh
and stored in the provider so the group can author commits with it.
Sourcepub fn key_package(&self) -> Result<KeyPackage, OpenMlsAuthorityError>
pub fn key_package(&self) -> Result<KeyPackage, OpenMlsAuthorityError>
Publish a [KeyPackage] for this device so an admin can add it to an album. The bundle
(with its private init/encryption keys) is stored in the provider for later Welcome
processing; the returned public [KeyPackage] is what the admin consumes.
Sourcepub fn directory_entry(&self, added_at: &str) -> DeviceEntry
pub fn directory_entry(&self, added_at: &str) -> DeviceEntry
This device’s DeviceEntry (its DSK public half) for inclusion in a directory.
Sourcepub fn signed_directory(
&self,
ik: &HybridSigningKey,
directory_version: u64,
updated_at: &str,
) -> DeviceDirectory
pub fn signed_directory( &self, ik: &HybridSigningKey, directory_version: u64, updated_at: &str, ) -> DeviceDirectory
A single-device DeviceDirectory for this device, signed by the user IK ik — the trust
anchor verify_leaf_binding (and verify_asset) resolve the device’s DSK through.
Auto Trait Implementations§
impl !Freeze for MlsDeviceIdentity
impl RefUnwindSafe for MlsDeviceIdentity
impl Send for MlsDeviceIdentity
impl Sync for MlsDeviceIdentity
impl Unpin for MlsDeviceIdentity
impl UnsafeUnpin for MlsDeviceIdentity
impl UnwindSafe for MlsDeviceIdentity
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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