OpenAgentID documentation
Source referencesRust module referenceopenagent-sdk

openagent-sdk · identity

Declared module signatures, types, configuration, and source documentation.

Source: openagent-sdk/sdks/rust/src/identity.rs. SHA-256: 60b1590df92837c9a3fe12731f27f1d5dc40c693a5d1d6115c27ffb6eb3f0d01.

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.

identity::ParsedDid

A parsed did:oas:<namespace>:<kind>:<identifier> triple.

The OpenAgent SDK accepts DIDs as strings everywhere — this struct only exists internally so the wrapper code doesn't have to re-split the string.

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ParsedDid {
/// The namespace component (e.g., `"l1fe"`, `"openagent"`).

pub namespace: String,
/// The entity kind (e.g., `"hmr"`, `"agent"`, `"tool"`).

pub kind: String,
/// The entity identifier.

pub identifier: String
}

Source line: 23.

identity::ParsedDid::parse

Parse a did:oas:... string.

Errors

Returns [OpenAgentError::Config] if the DID is malformed.

pub fn parse(did: &str) -> Result<Self>;

Source line: 38.

identity::ParsedDid::to_did

Render this triple back into the canonical DID string.

pub fn to_did(&self) -> String;

Source line: 59.

identity::AgentIdentityRecord

A signed identity document plus its keypair.

This is the OpenAgent SDK's analogue of [oas_sdk::identity::CreatedIdentity] and [oas_sdk::lineage::DerivedIdentity]. We collapse them into one type because consumers don't need to care which workflow produced the identity.

#[derive(Debug)]
pub struct AgentIdentityRecord {
/// The signed OAS Identity Document.

pub document: OasDocument,
/// The Ed25519 keypair the document is signed with.

pub keypair: OasKeyPair
}

Source line: 87.

identity::mint_human_root

Mint a fresh Human Root (HMR) identity.

Most apps don't call this directly — agents derive from a parent. This is exposed for tests and for the rare case of bootstrapping a new root.

Errors

Returns [OpenAgentError::Identity] if document construction or signing fails inside OAS.

pub fn mint_human_root(namespace: &str, identifier: &str) -> Result<AgentIdentityRecord>;

Source line: 121.

identity::derive_agent

Derive a child agent (or tool, skill, workflow) from a parent identity.

Performs HKDF-SHA256 key derivation, builds the child document with a lineage section, and signs the document. The returned record can be used directly or registered with an [oas_lineage::provider::InMemoryProvider] for chain verification.

Errors

Returns [OpenAgentError::Identity] if any step inside [oas_sdk::lineage] fails.

pub fn derive_agent(
    parent_keypair: &OasKeyPair,
    parent_doc: &OasDocument,
    namespace: &str,
    kind: &str,
    identifier: &str,
    derivation_path: &str,
) -> Result<AgentIdentityRecord>;

Source line: 138.

identity::verify_lineage_chain

Verify a document's lineage chain back to a human root.

Provider must already contain every parent document on the chain (the OpenAgent SDK does not perform DID resolution; that lives in AEGIS).

Errors

Returns [OpenAgentError::Identity] if any hop fails verification.

pub fn verify_lineage_chain(document: &OasDocument, provider: &dyn DocumentProvider) -> Result<()>;

Source line: 167.

On this page