Key Management
Generating Keys
The CLI supports two signature algorithms: EdDSA (Ed25519) - Recommended:my-key.pem- Private key (keep secret!)my-key.pub.pem- Public key (share for verification)
Key Storage Best Practices
Development:- Use HSM or KMS (AWS KMS, Azure Key Vault, GCP KMS)
- Rotate keys every 90 days
- Never commit keys to version control
Signing Workflows
Developer Credential Signing
--payload: Input credential JSON--key: Private key file--out: Where to save JWS token (algorithm auto-detected from key)--kid: Key ID (appears in JWT header)--issuer: Issuer DID (appears inissclaim)--subject: Subject DID (appears insubclaim)
Agent Credential Signing
--subject flag because the subject DID differs from the credential’s agentId.
Self-Signing Credentials
Self-signing allows developers to sign their own credentials where the issuer and subject are the same DID. This is useful for:- Development and testing - Quick iteration without external issuer
- Self-hosted agents - Agents that manage their own identity
- Decentralized scenarios - No central authority required
- Issuer DID (
--issuer) and subject DID (--subject) are identical - The credential’s
issuerDidandsubjectDidfields should match - Self-signed credentials are cryptographically valid but may have different trust implications
- Verifiers can check if
iss === subto detect self-signed credentials
Custom Claims
Add custom JWT claims:--issuer: Override default issuer--audience: Addaudclaim for specific verifier--kid: Custom key identifier
Skip Schema Validation
For debugging only:Verification Workflows
Basic Verification
- JWT format valid
- Signature mathematically valid
- Claims valid (not expired, etc.)
- Schema validation against credential type
Constrained Verification
Verify with specific expectations:- Issuer matches expected DID
- Audience matches expected DID
- Rejects credentials from untrusted issuers
Verification from File or String
From file:Algorithm Selection
When to use EdDSA:
- Default choice for most use cases
- Faster signing and verification
- Smaller signatures
- Modern, recommended by cryptographers
When to use ES256:
- Enterprise compliance requirements
- NIST/FIPS mandated environments
- Legacy system compatibility
- Regulatory requirements (some jurisdictions)
| Operation | EdDSA | ES256 |
|---|---|---|
| Key generation | 0.5ms | 2ms |
| Signing | 0.3ms | 1.5ms |
| Verification | 0.8ms | 2ms |
| Signature size | 64 bytes | 64 bytes |
Key Rotation
When rotating keys:Error Handling
Common Signing Errors
Error: “Schema validation failed”Common Verification Errors
Error: “Signature invalid”Production Checklist
Before deploying to production:- Generate production keys in secure environment
- Store private keys in HSM/KMS
- Set up key rotation schedule (90 days)
- Document key IDs and DID mappings
- Test verification with all expected verifiers
- Set appropriate expiration dates (6-12 months)
- Configure monitoring for signature failures
- Establish key recovery procedures
Next Steps
Managing Fingerprints
Agent manifest and fingerprint workflows
Command Reference
Complete CLI documentation
Security Best Practices
Production security guidance