arsenal-sdk · identity_loader
Declared module signatures, types, configuration, and source documentation.
Source: arsenal/crates/arsenal-sdk/src/identity_loader.rs. SHA-256: 882083d9db10928df481928cbebf1f27555436a15f8e30f00f5977c265cdefcb.
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_loader::AgentIdentityLoader
Loaded agent identity with signing capability
pub struct AgentIdentityLoader {
}Source line: 15.
identity_loader::AgentIdentityLoader::generate
Create a new agent identity with a fresh key pair
did is the agent's OAS DID, issued by OAS genesis. This loader mints
key material, not identity: a DID must already exist for the agent whose
keys these are.
Errors
Returns an error if key generation fails, or if did is not of entity
kind agent.
pub fn generate(
did: OasDid,
tenant_id: TenantId,
name: impl Into<String>,
) -> ArsenalResult<Self>;Source line: 43.
identity_loader::AgentIdentityLoader::from_seed_file
Load from a seed file
The file should contain 32 bytes of seed material.
Errors
Returns an error if the file cannot be read or the seed is invalid
pub async fn from_seed_file(
path: impl AsRef<Path>,
did: OasDid,
tenant_id: TenantId,
name: impl Into<String>,
) -> ArsenalResult<Self>;Source line: 79.
identity_loader::AgentIdentityLoader::from_env
Load from environment variable
The environment variable should contain hex-encoded 32-byte seed.
Errors
Returns an error if the environment variable is not set or invalid
pub fn from_env(
env_var: &str,
did: OasDid,
tenant_id: TenantId,
name: impl Into<String>,
) -> ArsenalResult<Self>;Source line: 140.
identity_loader::AgentIdentityLoader::identity
Get the agent identity
#[must_use]
pub fn identity(&self) -> &AgentIdentity;Source line: 200.
identity_loader::AgentIdentityLoader::fingerprint
Get the public key fingerprint
#[must_use]
pub fn fingerprint(&self) -> KeyFingerprint;Source line: 206.
identity_loader::AgentIdentityLoader::public_key_bytes
Get the public key bytes
#[must_use]
pub fn public_key_bytes(&self) -> [u8; 32];Source line: 212.
identity_loader::AgentIdentityLoader::encryption_public_key_bytes
Get the encryption public key bytes (X25519)
#[must_use]
pub fn encryption_public_key_bytes(&self) -> [u8; 32];Source line: 218.
identity_loader::AgentIdentityLoader::encryption_key_pair
Get the encryption key pair (X25519)
#[must_use]
pub fn encryption_key_pair(&self) -> &EncryptionKeyPair;Source line: 224.
identity_loader::AgentIdentityLoader::sign
Sign a message
#[must_use]
pub fn sign(&self, message: &[u8]) -> [u8; 64];Source line: 230.
identity_loader::AgentIdentityLoader::export_seed
Export the seed for backup (handle with extreme care!)
This returns the private key material.
#[must_use]
pub fn export_seed(&self) -> [u8; 32];Source line: 238.
identity_loader::AgentIdentityLoader::save_seed
Save the seed to a file
Errors
Returns an error if the file cannot be written
pub async fn save_seed(&self, path: impl AsRef<Path>) -> ArsenalResult<()>;Source line: 246.