atproto-identity
AT Protocol identity management for DID resolution, handle resolution, and cryptographic operations.
Overview
Core identity functionality for AT Protocol applications including multi-method DID resolution (plc, web, key), DNS/HTTP handle resolution, and P-256/P-384/K-256 key operations.
Features
- Multi-method DID resolution: Support for
did:plc,did:web, anddid:keymethods - Handle resolution: DNS TXT record and HTTP
.well-knownendpoint resolution with conflict detection - Cryptographic operations: P-256, P-384, and K-256 elliptic curve key generation, signing, and validation
- Identity validation: Input validation for handles and DIDs following AT Protocol specifications
- Document storage: LRU cache-based DID document storage with pluggable backends
- Configuration management: Environment variable handling and DNS nameserver configuration
CLI Tools
The following command-line tools are available when built with the clap and hickory-dns features:
atproto-identity-resolve: Resolve AT Protocol handles and DIDs to canonical identifiers with optional DID document outputatproto-identity-key: Generate cryptographic keys for P-256, P-384, and K-256 curvesatproto-identity-sign: Create cryptographic signatures of JSON data using private keysatproto-identity-validate: Validate cryptographic signatures against public keys
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