OpenAgentID documentation
Source referencesRust module referenceopenagent-claude-agent

openagent-claude-agent · identity

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

Source: openagent-sdk/integrations/claude-agent-sdk/rust/src/identity.rs. SHA-256: 735ea2a719fe37faba2ad65743fcb6490dd942db130f310b7ffa7208bff4ae8d.

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::OpenAgentIdentity

A signing key + DID, structurally compatible with the OAS identity surface. Implementations must NOT expose the secret key directly — signing operations go through the [OpenAgentIdentity::sign] method.

#[async_trait]
pub trait OpenAgentIdentity: Send + Sync {
    /// The fully-qualified DID, e.g. `did:oas:test:agent:foo`.
    fn did(&self) -> &str;

    /// Entity kind: `hmr`, `mhr`, `agent`, `tool`, `skill`, ...
    fn kind(&self) -> &str;

    /// 32-byte Ed25519 public key. Returned by value (32 bytes is cheap)
    /// so adapters that wrap an external SDK don't need to cache.
    fn public_key(&self) -> [u8; 32];

    /// Optional lineage chain (HMR -> ... -> this agent).
    fn lineage(&self) -> Vec<String> ;

    /// Sign a payload. Implementations must never log or expose the key.
    async fn sign(&self, payload: &[u8]) -> Result<Vec<u8>>;
}

Source line: 15.

identity::Identity

Default in-process identity used by tests and dev harnesses.

Signing is intentionally a deterministic stub — production deployments must replace this with an OAS-backed implementation that holds a real Ed25519 key.

#[derive(Debug, Clone)]
pub struct Identity {

}

Source line: 41.

identity::Identity::new

Construct a new identity.

pub fn new(did: impl Into<String>, kind: impl Into<String>, public_key: [u8; 32]) -> Self;

Source line: 50.

identity::Identity::with_lineage

Set the lineage chain (builder).

#[must_use]
pub fn with_lineage(mut self, lineage: Vec<String>) -> Self;

Source line: 61.

identity::OpenAgentSdkIdentity

Adapter that exposes an [openagent_sdk::OpenAgent] as an [OpenAgentIdentity].

This is the production wiring: hand the plugin an OpenAgent built via OpenAgentBuilder and it will pull DID, public key, and Ed25519 signing through the wrapped SDK.

pub struct OpenAgentSdkIdentity {

}

Source line: 105.

identity::OpenAgentSdkIdentity::new

Wrap an existing openagent_sdk::OpenAgent.

pub fn new(inner: openagent_sdk::OpenAgent) -> Self;

Source line: 111.

identity::OpenAgentSdkIdentity::inner

Borrow the underlying SDK agent (escape hatch for advanced users).

pub fn inner(&self) -> &openagent_sdk::OpenAgent;

Source line: 116.

On this page