Overview
Crypto engines manage private key lifecycle operations:- Key Generation - RSA and ECDSA key pair creation
- Key Storage - Secure storage with HSM or cloud KMS
- Signing Operations - Digital signatures via
crypto.Signerinterface - Key Import/Export - Migrate keys between engines
CryptoEngine interface from github.com/lamassuiot/lamassuiot/core/v3/pkg/engines/cryptoengines.
Available Engines
- Software
- AWS KMS
- PKCS#11
- Vault KV2
Software Crypto Engine
Pure Go implementation using standard library crypto. Keys stored in memory or filesystem.Import Path:- Security Level: SL1
- RSA: 2048, 3072, 4096 bits
- ECDSA: P-256, P-384, P-521 curves
- PKCS#8 private key encoding
- No external dependencies
engines/crypto/software/software.go:41Engine Selection Guide
| Use Case | Recommended Engine | Security Level |
|---|---|---|
| Development/Testing | Software | SL1 |
| Cloud Production (AWS) | AWS KMS | SL2 |
| On-Premises Production | PKCS#11 (HSM) | SL2 |
| Hybrid Cloud | Vault KV2 | SL1 |
| Air-Gapped Environments | PKCS#11 (HSM) | SL2 |
Multi-Engine Configuration
You can register multiple crypto engines and select them per CA:Common Operations
Key Generation
Key Import
Signing
Troubleshooting
PKCS#11: Could not configure driver
PKCS#11: Could not configure driver
Cause: Module path incorrect or HSM not initialized.Solution:
AWS KMS: Access Denied
AWS KMS: Access Denied
Cause: IAM policy missing required permissions.Solution:
Vault: Could not login
Vault: Could not login
Cause: Invalid AppRole credentials or role not configured.Solution:
Next Steps
Storage Engines
Configure PostgreSQL for CA and device storage
Event Bus
Set up AMQP or AWS SNS/SQS for events
