aeat.application.user_profile._bundle_encryption module¶
Passphrase encryption for portable profile-bundle exports.
- class EncryptedProfileBundleExport(**data)[source]¶
Bases:
BaseModelEncrypted transport envelope for a serialized profile-bundle payload.
The ciphertext wraps the exact
UserProfilePortableExportJSON bytes. The envelope schema is transport metadata only; after decryption, callers still validate the original bundle model and itsbundle_schema_version.- Parameters:
- encrypted_bundle_schema_version: int¶
- payload_model: str¶
- payload_schema_version: int¶
- kdf: str¶
- kdf_version: int¶
- memory_cost: int¶
- time_cost: int¶
- parallelism: int¶
- salt_b64: str¶
- ciphertext_b64: str¶
- exception EncryptedProfileBundleError[source]¶
Bases:
ValueErrorRaised when an encrypted profile-bundle envelope cannot be opened.
- encrypt_profile_bundle_for_passphrase(bundle, *, passphrase)[source]¶
Encrypt
bundleunderpassphraseand return a transport envelope.- Return type:
- Parameters:
bundle (UserProfilePortableExport)
passphrase (str)
- decrypt_profile_bundle_with_passphrase(envelope, *, passphrase)[source]¶
Decrypt
envelopeand validate the wrappedUserProfilePortableExport.Payload validation routes through
validate_bundle_payload(), so an out-of-range or non-upgradeablebundle_schema_versionpropagates asUnsupportedBundleSchemaVersionError(naming the version) rather than being flattened into the generic envelope error.- Return type:
- Parameters:
envelope (EncryptedProfileBundleExport)
passphrase (str)