Skip to main content

Crate bitwarden_organization_crypto

Crate bitwarden_organization_crypto 

Source
Expand description

§Bitwarden Organization Crypto Crate

The bitwarden-organization-crypto crate surfaces APIs for safely manipulating organization-specific cryptography. Similar to the bitwarden-crypto crate, this is meant to be a basic dependency used by organization-related feature crates.

This is not a client crate and shall not depend on bitwarden-core as a result.

§Organization keys

  • OrganizationPrivateKey: the private key of the organization. The organization key unwraps it into the key store context.
  • OrganizationSharedKey: the organization key, shared with one member. The API calls it the key of the membership.
  • AccountRecovery: the user key of a member, held by the organization for account recovery. The API calls it the “reset password key”.

OrganizationSharedKey and AccountRecovery are versioned enums. Each version matches an Org Membership version. V1 encapsulates a key to a public key without sender authentication. V2 (planned) seals keys between identities, with sender authentication.

make shares a key only after the public key of the recipient passes a TrustProof:

  • TrustProof::ManuallyTrustedFingerprint: the fingerprint phrase of a public key that a person compared, with the id of the key owner that the phrase is derived from.
  • TrustProof::ManuallyTrustedThumbprint: the thumbprint of a public key from a trusted source.
  • TrustProof::CryptographicallyTrusted: a cryptographic proof that the public key belongs to the recipient. The only proof now is the matching private key in the key store context, for example the own key pair of the user, or the organization key pair that an admin unwraps.

Some V1 flows cannot verify the public key. These flows use make_untrusted, which V2 does not have.

Modules§

account_recovery
Account recovery: a member’s user key, held by the organization so that admins can recover the member’s account by resetting the member’s master password.
invite
Cryptographic organization invites
organization_private_key
The organization’s key pair, held in a key store context.
organization_shared_key
Organization shared key: the organization key shared with one member, so that the member can decrypt the organization’s data.
trust_proof
Trust proofs: how the caller knows that a key belongs to the intended recipient.
wasm
The wasm module holds the wasm bindings for InviteSecret, which crosses the WASM boundary as its base64url string form. Encoding/decoding is limited to the From<&InviteSecret> for String and FromStr implementations to simplify maintenance.