core_crypto/e2e_identity/
device_status.rs

1use wire_e2e_identity::prelude::IdentityStatus;
2
3/// Indicates the standalone status of a device Credential in a MLS group at a moment T.
4/// This does not represent the states where a device is not using MLS or is not using end-to-end identity
5#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, serde::Serialize, serde::Deserialize)]
6#[repr(u8)]
7pub enum DeviceStatus {
8    /// All is fine
9    Valid = 1,
10    /// The Credential's certificate is expired
11    Expired = 2,
12    /// The Credential's certificate is revoked
13    Revoked = 3,
14}
15
16impl From<IdentityStatus> for DeviceStatus {
17    fn from(status: IdentityStatus) -> Self {
18        match status {
19            IdentityStatus::Valid => Self::Valid,
20            IdentityStatus::Expired => Self::Expired,
21            IdentityStatus::Revoked => Self::Revoked,
22        }
23    }
24}