Crate atproto_identity

Source
Expand description

§AT Protocol Identity Management Library

Comprehensive Rust library for AT Protocol identity operations including DID resolution, handle resolution, and cryptographic key management. This is the core identity management library for building AT Protocol applications and services.

§Key Features

  • Multi-Method DID Resolution: Support for did:plc, did:web, and did:key methods
  • Handle Resolution: DNS and HTTP-based handle-to-DID resolution with conflict detection
  • Cryptographic Key Operations: P-256, P-384, and K-256 key generation, signing, and validation
  • DID Document Management: Parsing, validation, and caching of DID documents
  • Storage Abstraction: Pluggable storage with LRU cache implementation
  • Configuration Management: Environment-based configuration with validation
  • Error Handling: Structured error types with descriptive messages

§Architecture

The library is organized into focused modules that can be used independently or together:

  • resolve: Core identity resolution logic for handles and DIDs
  • plc: PLC directory client for did:plc resolution
  • web: Web DID client for did:web resolution and URL conversion
  • key: Cryptographic operations including signature validation and key identification
  • model: Data structures for DID documents and AT Protocol entities
  • validation: Input validation for handles and DIDs
  • storage: Storage abstraction for DID document caching
  • config: Configuration management and environment variable handling

§Command-Line Tools

When built with the clap feature, provides comprehensive CLI tools:

  • 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

Modules§

axum
Axum web framework integration for AT Protocol identity management.
config
Configuration management for AT Protocol identity operations.
errors
Structured Error Types
key
Cryptographic key operations for AT Protocol identity management.
model
Data structures for DID documents and AT Protocol entities.
plc
PLC Directory Client
resolve
Core Resolution Logic
storage
DID document storage abstraction for AT Protocol identity management.
storage_lru
LRU-based implementation of the DidDocumentStorage trait.
validation
Input validation for AT Protocol handles and DIDs.
web
Web DID Client