oas-sdk · crate
Declared module signatures, types, configuration, and source documentation.
Source: oas/oas/oas-sdk/src/lib.rs. SHA-256: b03c0548ed311d0008bcdee9297c8dc60b2520f5090b17dc5abd3e87053e7608.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
anchor_policy
oas-sdk
Unified SDK for the Open Agent Specification (OAS).
This crate provides a single entry point for all OAS operations: identity creation, lineage derivation, attestation, and resolution. It re-exports the lower-level crates and adds high-level workflow functions.
Quick Start
use oas_sdk::identity::create_hmr;
use oas_sdk::lineage::derive_child;
// 1. Create a Human Root identity
let root = create_hmr("test", "alice", "2026-01-15T00:00:00Z").unwrap();
assert_eq!(root.document.id, "did:oas:test:hmr:alice");
// 2. Derive a child agent
let agent = derive_child(
&root.keypair,
&root.document,
"test", "agent", "analyzer",
"agent/analyzer",
"2026-01-15T00:00:00Z",
).unwrap();
assert_eq!(agent.document.id, "did:oas:test:agent:analyzer");
assert!(agent.document.lineage.is_some());Crate Organization
| Module | Purpose |
|---|---|
[identity] | Root identity creation (HMR, MHR) |
[lineage] | Child derivation, local chain verification, privileged authority contract |
[attestation] | Create, sign, and verify W3C VCs |
[config] | SDK-wide configuration |
[error] | Unified error type |
Sub-Crate Re-exports
For advanced usage, the individual crates are re-exported:
oas_sdk::crypto→ [oas_crypto]oas_sdk::did→ [oas_did]oas_sdk::document→ [oas_document]oas_sdk::lineage_crate→ [oas_lineage]oas_sdk::resolve→ [oas_resolve] (requiresresolvefeature)oas_sdk::attestation_crate→ [oas_attestation]
#[cfg(feature = "resolve")]
pub mod anchor_policy;Source line: 53.
attestation
pub mod attestation;Source line: 54.
config
pub mod config;Source line: 55.
error
pub mod error;Source line: 56.
identity
pub mod identity;Source line: 57.
lineage
pub mod lineage;Source line: 58.
pub use oas_attestation as attestation_crate;
pub use oas_attestation as attestation_crate;Source line: 61.
pub use oas_crypto as crypto;
pub use oas_crypto as crypto;Source line: 62.
pub use oas_did as did;
pub use oas_did as did;Source line: 63.
pub use oas_document as document;
pub use oas_document as document;Source line: 64.
pub use oas_lineage as lineage_crate;
pub use oas_lineage as lineage_crate;Source line: 65.
pub use oas_resolve as resolve;
#[cfg(feature = "resolve")]
pub use oas_resolve as resolve;Source line: 67.
pub use error::OasError;
pub use error::OasError;Source line: 69.