Skip to main content

Invite

Struct Invite 

Source
pub struct Invite {
    sealed_invite_data: DataEnvelope,
    invite_key_sealed_invite_data_cek: SymmetricKeyEnvelope,
    invite_secret_sealed_invite_key: SecretProtectedKeyEnvelope,
    invite_key_sealed_organization_key: Option<SymmetricKeyEnvelope>,
    organization_key_sealed_invite_key: EncString,
}
Expand description

Cryptographic invite for an organization, built around an XAES-256-GCM invite key that acts as the hub tying everything together. See the module-level docs for the overall diagram.

Fields§

§sealed_invite_data: DataEnvelope

The InviteData (org public-key thumbprint + invite secret) sealed with its own content-encryption key (CEK).

§invite_key_sealed_invite_data_cek: SymmetricKeyEnvelope

The invite-data content-encryption key sealed with the invite key, so a holder of the invite key can recover the CEK and open Self::sealed_invite_data.

§invite_secret_sealed_invite_key: SecretProtectedKeyEnvelope

The invite key sealed with the high-entropy invite secret, letting an invitee (who holds only the invite secret from the link) recover the invite key.

§invite_key_sealed_organization_key: Option<SymmetricKeyEnvelope>

The organization key sealed with the invite key, letting a redeeming invitee recover the organization key once they hold the invite key. This is optional: its presence is what “confirmation” means. When confirmation is enabled the invitee can self-confirm by recovering the organization key; when disabled, this field is absent and an admin must confirm the invitee out of band.

§organization_key_sealed_invite_key: EncString

The invite key sealed with the organization key, letting anyone holding the organization key recover the invite key (and thus the invite data).

Implementations§

Source§

impl Invite

Source

pub fn unseal_invite_key_with_organization_key<Ids: KeySlotIds>( &self, organization_key: Ids::Symmetric, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<Ids::Symmetric, InviteKeyBundleError>

Recovers the invite key using the organization key

Source

pub fn unseal_invite_key_with_invite_secret<Ids: KeySlotIds>( &self, invite_secret: &InviteSecret, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<Ids::Symmetric, InviteKeyBundleError>

Recovers the invite key from the invite secret

Source

fn unseal_invite_data<Ids: KeySlotIds>( &self, invite_key: Ids::Symmetric, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<InviteDataV1, InviteKeyBundleError>

Unseals the InviteDataV1 using an invite key

Source

pub fn get_invite_secret<Ids: KeySlotIds>( &self, invite_key: Ids::Symmetric, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<InviteSecret, InviteKeyBundleError>

Recovers the InviteSecret using an invite key

Source

pub fn get_public_key_thumbprint<Ids: KeySlotIds>( &self, invite_key: Ids::Symmetric, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<CoseKeyThumbprint, InviteKeyBundleError>

Recovers the organization public-key thumbprint bound into the invite using an invite key

Source

pub fn supports_confirmation(&self) -> bool

Whether confirmation is enabled on this invite, i.e. whether the organization key can be recovered from the invite key.

Source

pub fn unseal_organization_key<Ids: KeySlotIds>( &self, invite_key: Ids::Symmetric, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<Ids::Symmetric, InviteKeyBundleError>

Unseals the organization key using an invite key, storing it in the key store context and returning its id.

Source

pub fn enable_confirmation<Ids: KeySlotIds>( &mut self, organization_key: Ids::Symmetric, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<(), InviteKeyBundleError>

Enables confirmation

Source

pub fn disable_confirmation(&mut self)

Disables confirmation

Source

pub fn make_for_private_key<Ids: KeySlotIds>( organization_key: Ids::Symmetric, wrapped_organization_private_key: &EncString, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<(InviteSecret, Invite), InviteKeyBundleError>

Generates a brand new invite around a new invite key. The invite is sealed for the provided organization key and bound to the organization’s public-key thumbprint (see Invite).

wrapped_organization_private_key is the organization’s private key wrapped with organization_key; the public-key thumbprint bound into the invite is derived from it.

Returns the raw InviteSecret (which MUST NOT be sent to the server) together with the server-safe Invite.

Trait Implementations§

Source§

impl Clone for Invite

Source§

fn clone(&self) -> Invite

Returns a duplicate 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 Invite

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Invite

Source§

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 From<&Invite> for String

Source§

fn from(invite: &Invite) -> Self

Converts to this type from the input type.
Source§

impl FromStr for Invite

Source§

type Err = InviteKeyBundleError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Serialize for Invite

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

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

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> DynClone for T
where T: Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

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

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

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

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

impl<T> Instrument for T

§

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

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

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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>,

Source§

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<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,