cadrumo.adapters.persistence.storage.custody.sentinel_contract module

Canonical DEK-sentinel proof contract for current profile custody.

profile_custody_sentinel_aad(envelope)[source]

Derive the only AAD accepted for a current-format DEK sentinel.

Return type:

bytes

Parameters:

envelope (ProfileCustodyEnvelope)

profile_custody_sentinel_aad_for(*, profile_id, dek_epoch)[source]

Derive sentinel AAD from the immutable custody identity alone.

Return type:

bytes

Parameters:
  • profile_id (UUID)

  • dek_epoch (str)

profile_custody_sentinel_plaintext(*, profile_id, dek_epoch, data_format_version=1)[source]

Derive the non-caller-selectable sentinel plaintext for one DEK epoch.

Return type:

bytes

Parameters:
class ProfileCustodySentinelRecord(**data)[source]

Bases: BaseModel

Strict proof input consumed before a custody transaction can publish it.

Parameters:

data (Any)

schema_version: Literal[1]
product: Literal['cadrumo']
profile_id: UUID
dek_epoch: str
data_format_version: Literal[1]
purpose: Literal['profile-dek-sentinel/v1']
nonce_b64: str
ciphertext_b64: str
tag_b64: str
encrypted_blob()[source]

Return the format-neutral AEAD representation after strict validation.

Return type:

EncryptedBlob

canonical_json_bytes()[source]

Return the unique strict transport representation for a custody transaction.

Return type:

bytes

parse_profile_custody_sentinel_record(value)[source]

Parse one canonical sentinel record without creating or publishing it.

Return type:

ProfileCustodySentinelRecord

Parameters:

value (bytes)

verify_profile_custody_sentinel(*, dek, profile_id, dek_epoch, sentinel)[source]

Prove that the supplied DEK matches the immutable sentinel identity.

Return type:

None

Parameters: