pub struct DeviceCert {
pub campaign: Uuid,
pub device: PublicKey,
pub role: Role,
pub name: String,
pub issued_at: DateTime<Utc>,
pub issuer: PublicKey,
}Expand description
A statement that device belongs to campaign with role, signed by
issuer: a DM device of that campaign, or for the very first DM device
(set up with a one-time code) the device itself.
Fields§
§campaign: Uuid§device: PublicKey§role: Role§name: StringWhose device it is, for people: “Vex’s laptop”.
issued_at: DateTime<Utc>Whole seconds since 1970, so the signed encoding is a plain integer.
issuer: PublicKeyImplementations§
Source§impl DeviceCert
impl DeviceCert
Sourcepub fn issue(
issuer: &DeviceKey,
campaign: Uuid,
device: PublicKey,
role: Role,
name: impl Into<String>,
) -> Result<SignedCert, AuthError>
pub fn issue( issuer: &DeviceKey, campaign: Uuid, device: PublicKey, role: Role, name: impl Into<String>, ) -> Result<SignedCert, AuthError>
issuer vouches for device.
Sourcepub fn self_signed(
key: &DeviceKey,
campaign: Uuid,
role: Role,
name: impl Into<String>,
) -> Result<SignedCert, AuthError>
pub fn self_signed( key: &DeviceKey, campaign: Uuid, role: Role, name: impl Into<String>, ) -> Result<SignedCert, AuthError>
A device vouching for itself, which also proves it holds its key.
Trait Implementations§
Source§impl Clone for DeviceCert
impl Clone for DeviceCert
Source§fn clone(&self) -> DeviceCert
fn clone(&self) -> DeviceCert
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for DeviceCert
impl ComposeSchema for DeviceCert
Source§impl Debug for DeviceCert
impl Debug for DeviceCert
Source§impl<'de> Deserialize<'de> for DeviceCert
impl<'de> Deserialize<'de> for DeviceCert
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 PartialEq for DeviceCert
impl PartialEq for DeviceCert
Source§fn eq(&self, other: &DeviceCert) -> bool
fn eq(&self, other: &DeviceCert) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DeviceCert
impl Serialize for DeviceCert
Source§impl ToSchema for DeviceCert
impl ToSchema for DeviceCert
impl Eq for DeviceCert
impl StructuralPartialEq for DeviceCert
Auto Trait Implementations§
impl Freeze for DeviceCert
impl RefUnwindSafe for DeviceCert
impl Send for DeviceCert
impl Sync for DeviceCert
impl Unpin for DeviceCert
impl UnsafeUnpin for DeviceCert
impl UnwindSafe for DeviceCert
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.