Skip to main content

encrypt_import

Function encrypt_import 

Source
pub fn encrypt_import(
    ctx: &mut KeyStoreContext<'_, KeySlotIds>,
    cipher: ImportingCipher,
    organization_id: Option<OrganizationId>,
    user_id: UserId,
) -> Result<EncryptionContext, ExportError>
Expand description

Encrypts a parsed/imported cipher for the user’s vault, or for an organization when organization_id is set. Shared by the importers (import_kdbx) and by CXF import; lives here alongside the ImportingCipher interchange model and the From<ImportingCipher> for CipherView bridge.

user_id identifies the user performing the import and is recorded on the returned [EncryptionContext] alongside the id of the key the cipher was wrapped under.