pub struct AidDocument {
pub context: Vec<String>,
pub id: String,
pub controller: String,
pub verification_method: Vec<VerificationMethod>,
pub authentication: Vec<String>,
pub service: Option<Vec<AidService>>,
pub trust_level: Option<String>,
pub version: Option<u32>,
pub created: Option<DateTime<Utc>>,
pub updated: Option<DateTime<Utc>>,
pub proof: Option<AidProof>,
}Expand description
A complete IDProva Agent Identity Document (W3C DID Document).
Fields§
§context: Vec<String>JSON-LD context.
id: StringThe DID identifier (e.g., “did:idprova:techblaze.com.au:kai”).
controller: StringThe controller DID (the human/entity who controls this agent).
verification_method: Vec<VerificationMethod>Verification methods (public keys).
authentication: Vec<String>Authentication method references.
service: Option<Vec<AidService>>Agent metadata service.
trust_level: Option<String>Trust level (L0-L4).
version: Option<u32>Document version.
created: Option<DateTime<Utc>>Creation timestamp.
updated: Option<DateTime<Utc>>Last update timestamp.
proof: Option<AidProof>Cryptographic proof (signature by the controller).
Implementations§
Source§impl AidDocument
impl AidDocument
Sourcepub fn to_canonical_json(&self) -> Result<Vec<u8>>
pub fn to_canonical_json(&self) -> Result<Vec<u8>>
Serialize the document to canonical JSON (for signing).
§Security: fix S4 (non-canonical JSON)
Uses RFC 8785 JSON Canonicalization Scheme (JCS) via json-canonicalization
to produce deterministic output with sorted object keys. This ensures that
signatures produced on one platform verify correctly on all others.
The proof field is excluded (it contains the signature itself).
Trait Implementations§
Source§impl Clone for AidDocument
impl Clone for AidDocument
Source§fn clone(&self) -> AidDocument
fn clone(&self) -> AidDocument
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more