cadrumo.adapters.persistence.storage.custody._kdf_records module¶
The Argon2id parameter grid and wrapped-DEK shape, as plain wire rules.
One declaration of the custody v1 KDF grid and of the canonical base64 rule.
The pydantic records in records annotate with these aliases and call
canonical_b64(); the supervised key-derivation worker, which is started
for every wrap and unwrap and must not import pydantic, validates its request
with kdf_parameters_from_wire() and wrapped_dek_from_wire().
Standard library and cryptography constants only.
Every refusal is a ValueError, which the worker already turns into
its failure frame, exactly as it did for the pydantic ValidationError.
- canonical_b64(value, *, field_name, expected_bytes)[source]¶
Return
valueif it is the canonical base64 of exactlyexpected_bytesbytes.
- class KdfParameterValues(algorithm, version, memory_mib, iterations, parallelism, salt_b64, output_bytes)[source]¶
Bases:
objectA validated KDF parameter set, as the worker consumes it.
- Parameters:
- class WrappedDekValues(nonce_b64, ciphertext_b64, tag_b64)[source]¶
Bases:
objectA validated wrapped-DEK record, as the worker consumes it.
- kdf_parameters_from_wire(value)[source]¶
Validate a KDF parameter record received as JSON-shaped data.
- Return type:
- Parameters:
value (object)