atlas_c2pa_lib/
lib.rs

1//! # Atlas C2PA Library
2//!
3//! `atlas-c2pa-lib` is a Rust library for creating, signing, and verifying machine learning
4//! assets (models and datasets) with C2PA (Content Provenance and Authenticity) specifications.
5//!
6//! The library provides tools to generate cryptographic claims about ML asset provenance,
7//! track ML asset lineage, and create C2PA-compliant manifests.
8//!
9//! ## Key Components
10//!
11//! - **Assertions**: Claims about ML models and datasets
12//! - **Ingredients**: Tracking datasets and components used to create models
13//! - **Manifests**: Complete C2PA manifests for ML assets
14//! - **Asset Types**: Support for various ML frameworks (TensorFlow, PyTorch, ONNX, etc.)
15//!
16//! ## Example: Creating a Model Manifest
17//!
18//! ```rust
19//! use atlas_c2pa_lib::ml::types::{ModelInfo, MLFramework, ModelFormat};
20//! use atlas_c2pa_lib::ml::manifest::MLManifestBuilder;
21//! use time::OffsetDateTime;
22//!
23//! // Define model information
24//! let model_info = ModelInfo {
25//!     name: "bert-base".to_string(),
26//!     version: "1.0.0".to_string(),
27//!     framework: MLFramework::PyTorch,
28//!     format: ModelFormat::TorchScript,
29//! };
30//!
31//! // Create a manifest builder
32//! let builder = MLManifestBuilder::new(
33//!     model_info.clone(),
34//!     "0123456789abcdef0123456789abcdef".to_string(), // Model hash
35//! );
36//!
37//! // Build the manifest
38//! let manifest = builder.build().unwrap();
39//! ```
40pub mod assertion;
41pub mod asset_type;
42pub mod cbor;
43pub mod claim;
44pub mod cose;
45pub mod cross_reference;
46pub mod datetime_wrapper;
47pub mod ingredient;
48pub mod manifest;
49pub mod ml;