QuantumAPI

Encryption Keys

2026-02-20 2026-02-20 v0.1.x-beta

1. What is it?

Encryption Keys are the cryptographic keys used for all encrypt/decrypt, sign/verify, and wrap/unwrap operations in QuantumAPI. They support NIST post-quantum cryptography standards (ML-KEM, ML-DSA, SLH-DSA) alongside classical algorithms (AES-256-GCM). Keys are stored encrypted at rest using envelope encryption and QRNG-generated nonces.

2. What is it for?

Data encryption at rest and in transit

Use ML-KEM or AES-256-GCM keys to encrypt secrets, files, and application data before storage.

Digital signatures

Use ML-DSA or SLH-DSA keys to sign documents, JWT tokens, and API payloads for authenticity and non-repudiation.

Key wrapping / hierarchy

Wrap DEKs (Data Encryption Keys) with a KEK (Key Encryption Key) to implement envelope encryption and key hierarchies.

BYOK

Import your own keys to retain control of key material while benefiting from QuantumAPI's management and audit capabilities.

3. Key concepts

TermDefinition
AlgorithmThe cryptographic algorithm the key is associated with (ML-KEM-768, ML-DSA-65, AES-256-GCM, etc.).
Key typeEncryption (KEM) keys for confidentiality vs. Signing keys (DSA) for authenticity.
Key stateActive: usable for all operations. Deprecated: decryption/verify only. Pending deletion: scheduled for destruction after grace period.
Default keyThe key automatically selected for new encrypt/sign operations when no keyId is specified.
RotationGenerating a new key version. The old version is deprecated (kept for decryption) while the new version becomes active.
Purge protectionPrevents immediate deletion. When enabled, a deleted key enters a grace period before final destruction.
BYOKBring Your Own Key — import external key material into QuantumAPI's key store.
JWK / JWKSJSON Web Key / JSON Web Key Set. Standard format for exporting public keys for interoperability.
Grace periodThe number of days between scheduling a key for deletion and its permanent destruction.

4. How to use it

Creating a key

1

Open Encryption Keys

Go to QuantumVault → Keys → Encryption Keys and click New Key.
2

Choose the algorithm

Select the algorithm based on the use case: ML-KEM-768 for encryption, ML-DSA-65 for signing, AES-256-GCM for symmetric encryption.
3

Set as default (optional)

Toggle "Set as default" to make this key selected automatically in encrypt/sign operations.
4

Enable purge protection (optional)

Enable to require a grace period before final deletion. Recommended for production keys.
5

Save the key

The key is generated server-side using QRNG entropy. The private key material never leaves the server in plaintext.

Rotating a key

Open the key detail page and click Rotate. A new key version is created and becomes Active. The previous version moves to Deprecated status and remains available for decryption-only operations.

Scheduling deletion

Click Delete on the key detail page. If purge protection is enabled, the key enters Pending Deletion state for the configured grace period. During this time it cannot be used for new operations but can be restored.

Importing a key (BYOK)

Click Import Key, choose the format (PEM, JWK, or raw bytes), and paste or upload the key material. QuantumAPI wraps the imported key using the tenant KEK before storage.

Exporting the public key

For asymmetric keys, click Export Public Key. Supported formats: PEM, DER, JWK. Use the JWKS endpoint for public key distribution to external services.

Export public key as JWK
GET /api/v1/keys/{id}/public?format=JWK
Authorization: Bearer <token>

5. Field reference

FieldTypeRequiredDescription
NamestringYesHuman-readable identifier. Unique within the tenant.
AlgorithmenumYesML-KEM-512 | ML-KEM-768 | ML-KEM-1024 | ML-DSA-44 | ML-DSA-65 | ML-DSA-87 | SLH-DSA-128s | AES-256-GCM
DefaultbooleanNoIf true, selected automatically when no keyId is provided.
StateActive | Deprecated | PendingDeletionRead-onlyCurrent lifecycle state of the key.
Purge protectionbooleanNoRequires grace period before final deletion.
Grace period (days)integerNoDays between deletion scheduling and destruction (1–90).
Scheduled deletionISO 8601 datetimeRead-onlyWhen the key will be permanently destroyed.
Created atISO 8601 datetimeRead-onlyKey creation timestamp.
Rotated atISO 8601 datetimeRead-onlyLast rotation timestamp.

6. Relationships

Encrypt / Decrypt

Encryption Keys are referenced by keyId in all encrypt, decrypt, sign, and verify operations.

Transit Engine

Transit Engine uses named encryption keys internally. The same keys can be used in both direct and transit modes.

QuantumVault — Secrets

Every vault secret is encrypted at rest with the tenant's default encryption key.

API Keys

API Keys with keys:manage scope can create, rotate, and delete encryption keys.

7. FAQ

What is the difference between ML-KEM and ML-DSA?

ML-KEM (Key Encapsulation Mechanism) is used to establish shared secrets for encryption. ML-DSA (Digital Signature Algorithm) is used to sign and verify messages. Choose ML-KEM for encrypting data and ML-DSA for signing.

Can I use a quantum-safe key for signing?

Yes. ML-DSA-44, ML-DSA-65, ML-DSA-87, and SLH-DSA-128s are all quantum-safe signature algorithms. ML-DSA-65 is the default choice for most use cases.

How does key rotation affect existing encrypted data?

Existing ciphertext remains valid — the deprecated key version is retained and used for decryption. Only new encrypt operations use the new key version. Re-encrypting existing data with the new key is done via the Transit Engine's re-wrap operation.

What happens to a key in pending-deletion state?

The key cannot be used for any new cryptographic operations. It can be restored (cancelling the deletion) during the grace period. Once the grace period expires, the key is permanently destroyed and all data encrypted with it becomes unrecoverable.

8. API / CLI reference

MethodEndpointDescription
GET/api/v1/keysList all encryption keys.
POST/api/v1/keysCreate a new encryption key.
GET/api/v1/keys/{id}Get key details.
PUT/api/v1/keys/{id}Update key name or default flag.
POST/api/v1/keys/{id}/rotateRotate the key (create new version).
DELETE/api/v1/keys/{id}Schedule key deletion.
GET/api/v1/keys/{id}/publicExport the public key (PEM, DER, JWK, RAW).
CLI examples
qapi keys list
qapi keys create --name my-key --algorithm ML-KEM-768
qapi keys rotate <key-id>
qapi keys export-public <key-id> --format JWK
qapi — QuantumAPI CLI Documentation