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: DataEnvelopeThe InviteData (org public-key thumbprint + invite secret) sealed with its own
content-encryption key (CEK).
invite_key_sealed_invite_data_cek: SymmetricKeyEnvelopeThe 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: SecretProtectedKeyEnvelopeThe 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: EncStringThe 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
impl Invite
Sourcepub fn unseal_invite_key_with_organization_key<Ids: KeySlotIds>(
&self,
organization_key: Ids::Symmetric,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<Ids::Symmetric, InviteKeyBundleError>
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
Sourcepub fn unseal_invite_key_with_invite_secret<Ids: KeySlotIds>(
&self,
invite_secret: &InviteSecret,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<Ids::Symmetric, InviteKeyBundleError>
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
Sourcefn unseal_invite_data<Ids: KeySlotIds>(
&self,
invite_key: Ids::Symmetric,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<InviteDataV1, InviteKeyBundleError>
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
Sourcepub fn get_invite_secret<Ids: KeySlotIds>(
&self,
invite_key: Ids::Symmetric,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<InviteSecret, InviteKeyBundleError>
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
Sourcepub fn get_public_key_thumbprint<Ids: KeySlotIds>(
&self,
invite_key: Ids::Symmetric,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<CoseKeyThumbprint, InviteKeyBundleError>
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
Sourcepub fn supports_confirmation(&self) -> bool
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.
Sourcepub fn unseal_organization_key<Ids: KeySlotIds>(
&self,
invite_key: Ids::Symmetric,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<Ids::Symmetric, InviteKeyBundleError>
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.
Sourcepub fn enable_confirmation<Ids: KeySlotIds>(
&mut self,
organization_key: Ids::Symmetric,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<(), InviteKeyBundleError>
pub fn enable_confirmation<Ids: KeySlotIds>( &mut self, organization_key: Ids::Symmetric, ctx: &mut KeyStoreContext<'_, Ids>, ) -> Result<(), InviteKeyBundleError>
Enables confirmation
Sourcepub fn disable_confirmation(&mut self)
pub fn disable_confirmation(&mut self)
Disables confirmation
Sourcepub fn make_for_private_key<Ids: KeySlotIds>(
organization_key: Ids::Symmetric,
wrapped_organization_private_key: &EncString,
ctx: &mut KeyStoreContext<'_, Ids>,
) -> Result<(InviteSecret, Invite), InviteKeyBundleError>
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<'de> Deserialize<'de> for Invite
impl<'de> Deserialize<'de> for Invite
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>,
Auto Trait Implementations§
impl Freeze for Invite
impl RefUnwindSafe for Invite
impl Send for Invite
impl Sync for Invite
impl Unpin for Invite
impl UnsafeUnpin for Invite
impl UnwindSafe for Invite
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more§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