atproto-identity
Comprehensive Rust library for AT Protocol identity management with DID resolution, handle resolution, and cryptographic key operations.
Overview
atproto-identity provides full functionality for DID resolution, handle resolution, and identity document management across multiple DID methods. This library supports complete AT Protocol identity workflows including DNS/HTTP resolution, DID document caching, cryptographic operations, and structured error handling.
Features
- Multi-method DID resolution: Support for
did:plcanddid:webmethods - Handle resolution: DNS TXT record and HTTP
.well-knownendpoint resolution - Cryptographic operations: P-256, P-384, and K-256 elliptic curve support
- Identity validation: Input validation for handles and DIDs
- Document storage: LRU cache-based DID document storage
- Configuration management: Environment variable and DNS configuration
- CLI tools: Command-line utilities for identity operations (requires
clapfeature)
Binaries
All CLI tools require the clap feature and use consistent command-line argument processing:
- atproto-identity-resolve: Resolve AT Protocol handles and DIDs to canonical identifiers
- atproto-identity-key: Generate and manage cryptographic keys (P-256, P-384, K-256)
- atproto-identity-sign: Create cryptographic signatures of JSON data
- atproto-identity-validate: Validate cryptographic signatures
Library Usage
Handle Resolution
use ;
let http_client = new;
let dns_resolver = create_resolver;
let did = resolve_subject.await?;
Key Operations
use ;
// Generate a new key
let private_key = generate_key?;
// Identify existing key
let key_data = identify_key?;
// Validate signature
validate?;
Command Line Usage
All CLI tools require the clap feature:
# Build with CLI support
# Resolve a handle to DID
# Generate a new P-256 key
# Sign JSON data
# Verify a signature
License
MIT License