baseid_pctf/lib.rs
1//! # baseid-pctf
2//!
3//! Pan-Canadian Trust Framework (PCTF) compliance utilities.
4//!
5//! Provides:
6//! - Identity assurance level evaluation (IAL 1-3) with evidence taxonomy
7//! - Consent lifecycle management (creation, expiry, revocation)
8//! - Hash-chained audit trail with privacy redaction
9//! - PCTF policy engine for credential operation validation
10//! - Bilingual (EN/FR) compliance self-assessment reporting
11//!
12//! ## PCTF Components Covered
13//!
14//! | Component | Module |
15//! |----------------------|--------------|
16//! | Verified Person | `assurance` |
17//! | Verified Organization| (N/A — issuer-side) |
18//! | Credential Management| `policy` |
19//! | Notice & Consent | `consent` |
20//! | Digital Integrity | `audit` |
21//!
22//! ## Quick Start
23//!
24//! ```rust
25//! use baseid_pctf::{AssuranceLevelEvaluator, ConsentManager, AuditLog};
26//! use baseid_pctf::assurance::{EvidenceBundle, Evidence, EvidenceType, VerificationMethod};
27//! use baseid_pctf::audit::AuditAction;
28//! use serde_json::json;
29//!
30//! // Evaluate identity assurance
31//! let bundle = EvidenceBundle {
32//! subject: "did:key:z6MkHolder".into(),
33//! evidence: vec![Evidence {
34//! evidence_type: EvidenceType::GovernmentPhotoId,
35//! verification: VerificationMethod::DatabaseCheck,
36//! issuer: "did:web:gov.ca".into(),
37//! timestamp: "2026-01-01T00:00:00Z".into(),
38//! }],
39//! };
40//! let result = AssuranceLevelEvaluator::evaluate_bundle(&bundle);
41//!
42//! // Log to audit trail
43//! let mut log = AuditLog::new();
44//! log.append("e-1", "2026-03-01T10:00:00Z", AuditAction::CredentialIssued,
45//! "did:web:gov.ca", json!({"type": "CanadianDigitalID"}));
46//! assert!(log.verify_chain());
47//! ```
48
49pub mod assurance;
50pub mod audit;
51pub mod consent;
52pub mod policy;
53pub mod report;
54
55pub use assurance::AssuranceLevelEvaluator;
56pub use audit::{AuditEntry, AuditLog};
57pub use consent::{ConsentManager, ConsentRecord, ConsentStatus};
58pub use policy::{PctfPolicy, PctfValidator, PolicyResult};
59pub use report::{PctfComplianceReport, ReportBuilder};