Skip to main content

Crate appcore_dnt

Crate appcore_dnt 

Source
Expand description

DNT authenticated encrypted binary container.

DNT is payload-agnostic. The file extension is never trusted as format identity; callers inspect and verify the authenticated binary header.

Structs§

BytesCodec
Identity codec for arbitrary binary payloads.
CodecId
Payload codec identifier stored in the authenticated header.
ContentType
Logical payload content type stored in the authenticated header.
DntContext
DNT context bound to key resolution and authenticated header validation.
DntFlags
Validated DNT flags.
DntHeader
Structurally parsed DNT header.
DntOpenOptions
Options used when opening or verifying an envelope.
DntSealOptions
Options used when sealing a payload.
IdentityJsonCodec
Identity codec for caller-validated JSON bytes.
KeyId
Rotation-aware key identifier stored in the authenticated header.
OpenedDnt
Authenticated and decoded DNT content.
SecretKey
Symmetric 256-bit AEAD key material.
StaticDntKeyProvider
Deterministic in-memory provider for tests and development-only adapters.
VerifiedDnt
Result of cryptographic verification without returning plaintext.

Enums§

CodecError
Controlled codec failures.
DntAlgorithm
Authenticated encryption algorithm used by this envelope.
DntCompression
Payload storage transform recorded in the authenticated DNT header.
DntError
Controlled DNT failures.
DntKeyError
Controlled key-provider failures.

Constants§

DNT_CONTENT_BACKUP
AppCore backup content type.
DNT_CONTENT_JSON
Conventional JSON content type.
DNT_CONTENT_OCTET_STREAM
Conventional arbitrary bytes content type.
DNT_CONTENT_SECRET
AppCore secret material content type.
DNT_CONTENT_SNAPSHOT
AppCore snapshot content type.
DNT_CONTENT_SYNC_EVENT
AppCore sync event content type.
DNT_ENVELOPE_VERSION_V1
Current DNT envelope version.
DNT_FLAG_PAYLOAD_DEFLATE
Internal DNT flag: stored encoded payload uses zlib-wrapped DEFLATE.
DNT_INTERNAL_FLAG_MASK
Bits reserved for DNT envelope semantics.
DNT_MAGIC
DNT magic bytes. File extensions are conventions only.
DNT_MAX_ENCRYPTED_METADATA_BYTES
Maximum encrypted metadata accepted by the in-memory V1 envelope.
DNT_MAX_HEADER_BYTES
Maximum accepted header size.
DNT_USER_FLAG_COUNT
Number of user flag bits available to callers.
DNT_USER_FLAG_MASK
Bits available for caller/application semantics.
DNT_USER_FLAG_OFFSET
First user flag bit in the raw DNT flag field.

Traits§

DntCodec
Payload codec used before encryption and after authentication.
DntKeyProvider
Resolves DNT encryption keys by identity and authenticated context.

Functions§

dnt_compose_flags
Combines DNT-owned internal flags and caller-owned user flags.
dnt_user_flag
Creates a caller-owned user flag by relative index 0..16.
inspect_header
Structurally inspects a DNT header without resolving keys or decrypting.
migrate_envelope
Migrates an envelope by opening and resealing it with the current writer.
open
Opens, authenticates and decodes a complete DNT envelope.
open_owned
Opens an owned envelope, allowing in-place decryption of the file buffer.
read_verified
Reads, authenticates and opens one DNT file.
rekey
Opens and seals the same semantic payload under a new key identifier.
seal
Seals arbitrary bytes into a DNT envelope.
verify
Cryptographically verifies a DNT envelope and discards plaintext.
write_atomic
Seals, verifies and atomically replaces one DNT file.

Type Aliases§

DntResult
DNT-local result type.