Expand description
This module contains the definition for the key identifiers used by the rest of the crates. Any code that needs to interact with the [KeyStore] should use these types.
- SymmetricKeyId is used to identify symmetric keys.
- PrivateKeyId is used to identify private keys.
- KeyIds is a helper type that combines both symmetric and private key identifiers. This is usually used in the type bounds of [KeyStore], KeyStoreContext, PrimitiveEncryptable, CompositeEncryptable, and Decryptable.
Modules§
- account_
cryptographic_ state - User account cryptographic state
- crypto
- Mobile specific crypto operations
- crypto_
client 🔒 - master_
password 🔒 - security_
state 🔒 - Security state is a signed object that attests to a user’s (or later an organization’s) security state. The security goal is to prevent downgrades of specific features within the user’s account by the server / a networked attacker with TLS introspection access.
- user_
decryption 🔒 - v2_
upgrade_ 🔒token - V2 Upgrade Token is created during V1→V2 key rotation and holds both user keys wrapped by each other. This allows V1 devices to retrieve the V2 key (to complete the upgrade), and V2 devices to retrieve the V1 key (e.g. to rotate local device unlock methods still encrypted with V1).
- wasm_
unlock_ 🔒state - The WASM sdk currently does not hold persistent SDK instances and instead re-createds SDK instances frequently. The unlock-state is lost, since the user-key is only held in the SDK. This file implements setting the user-key to WASM client-managed ephemeral state, so that SDK-re-creations have access to the user-key.
Structs§
- Crypto
Client - A client for the crypto operations.
- KeyIds
- Master
Password Authentication Data - Represents the data required to authenticate with the master password.
- Master
Password Unlock Data - Represents the data required to unlock with the master password.
- Security
State - The security state is a signed object attesting to the security state of a user.
- Signed
Security State - A signed and serialized
SecurityStateobject. - User
Decryption Data - Represents data required to decrypt user’s vault. Currently, this is only used for master password unlock.
- User
KeyState - Represents the decrypted symmetric user-key of a user. This is held in ephemeral state of the client.
- V2Upgrade
Token - Holds both V1 and V2 user keys, each wrapped by the other.
Enums§
- Master
Password Error - Error for master password related operations.
- Private
KeyId - Signing
KeyId - Symmetric
KeyId - V2Upgrade
Token Error - Errors that can occur when working with V2UpgradeToken
Constants§
- MINIMUM_
ENFORCE_ ICON_ URI_ HASH_ VERSION - Icon URI hashes are enforced starting with this security state version.
- UNIFFI_
META_ 🔒CONST_ BITWARDEN_ CORE_ RECORD_ USERKEYSTATE
Functions§
- create_
test_ crypto_ with_ user_ and_ org_ key - This is a helper function to create a test KeyStore with a single user key and an organization key using the provided organization uuid. While this function is not marked as #[cfg(test)], it should only be used for testing purposes. It’s only public so that other crates can make use of it in their own tests.
- create_
test_ crypto_ with_ user_ key - This is a helper function to create a test KeyStore with a single user key. While this function is not marked as #[cfg(test)], it should only be used for testing purposes. It’s only public so that other crates can make use of it in their own tests.