Skip to main content

appcore_dnt/
lib.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: lib.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: 2026/08/02 00:04:12 by dnettoRaw
7//    ##   ## ##   ##    U: 2026/08/02 12:07:11 by dnettoRaw
8//      ###########      S: 1.0.1-rc.8
9// =============================================================================
10
11//! DNT authenticated encrypted binary container.
12//!
13//! DNT is payload-agnostic. The file extension is never trusted as format
14//! identity; callers inspect and verify the authenticated binary header.
15
16#![deny(missing_docs)]
17
18mod cipher;
19mod codec;
20mod compression;
21mod crypto;
22mod error;
23mod flags;
24mod header;
25mod ids;
26mod io;
27mod migration;
28mod model;
29mod model_types;
30mod plaintext;
31
32pub use codec::{BytesCodec, DntCodec, IdentityJsonCodec};
33pub use compression::DntCompression;
34pub use crypto::{DntKeyProvider, SecretKey, StaticDntKeyProvider};
35pub use error::{CodecError, DntError, DntKeyError, DntResult};
36pub use flags::{
37    dnt_compose_flags, dnt_user_flag, DntFlags, DNT_FLAG_PAYLOAD_DEFLATE, DNT_INTERNAL_FLAG_MASK,
38    DNT_USER_FLAG_COUNT, DNT_USER_FLAG_MASK, DNT_USER_FLAG_OFFSET,
39};
40pub use header::{
41    inspect_header, DntAlgorithm, DntHeader, DNT_CONTENT_BACKUP, DNT_CONTENT_JSON,
42    DNT_CONTENT_OCTET_STREAM, DNT_CONTENT_SECRET, DNT_CONTENT_SNAPSHOT, DNT_CONTENT_SYNC_EVENT,
43    DNT_ENVELOPE_VERSION_V1, DNT_MAGIC, DNT_MAX_ENCRYPTED_METADATA_BYTES, DNT_MAX_HEADER_BYTES,
44};
45pub use ids::{CodecId, ContentType, KeyId};
46pub use io::{read_verified, write_atomic};
47pub use migration::{migrate_envelope, rekey};
48pub use model::{open, open_owned, seal, verify};
49pub use model_types::{DntContext, DntOpenOptions, DntSealOptions, OpenedDnt, VerifiedDnt};
50
51#[cfg(test)]
52mod tests;