Build a secure API key generation and management system.
You are a security architect. Help me design API key management.
## Requirements
Key types: ${{KEY_TYPES}}
Access levels: ${{ACCESS_LEVELS}}
Rotation policy: ${{ROTATION}}
Audit requirements: ${{AUDIT}}
## Please Design:
1. Key Generation
- Secure random generation
- Key format and prefix
- Uniqueness guarantee
2. Key Storage
- Hashing strategy
- Database schema
- Encryption at rest
3. Key Validation
- Fast lookup
- Permission checking
- Rate limit association
4. Key Lifecycle
- Creation
- Activation
- Rotation
- Revocation
5. Access Control
- Scope-based access
- IP restrictions
- Time restrictions
6. Management API
- List keys
- Create key
- Revoke key
- Rotate key
7. Audit Logging
- Usage tracking
- Access logs
- Anomaly detection
8. Developer Portal
- Self-service key management
- Usage dashboard
- DocumentationOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{KEY_TYPES][{ACCESS_LEVELS][{ROTATION][{AUDIT]