Class ExampleScenario8
This scenario performs a non-streaming PQC-to-PQC migration of ciphertext from an ML-KEM-768 key to a stronger ML-KEM-1024 key, entirely on the server side (no plaintext exposure):
The SDK is data-plane-only: it does not create keys. This scenario operates
on the pre-provisioned granted cross-kid pair of the
demo-cli playground — source cli-reencrypt3-source
(ML-KEM-768) and target cli-reencrypt3-target (ML-KEM-1024).
The cli-reference actor holds the cross-kid REENCRYPT grant on this pair
plus the atomic encrypt/decrypt grants on each endpoint.
- Resolve the granted
ML-KEM-768source andML-KEM-1024target kids. - Encrypt a file under the source (auto-detected Compact JWE).
- Re-encrypt the ciphertext on the server (ML-KEM-768 → ML-KEM-1024).
- Decrypt the new KEM ciphertext under the target.
- Validate round-trip integrity.
Implementation notes (Java 21+):
- Filesystem operations rely on the
PathAPI. - UTF-8 encoding is enforced explicitly for deterministic behaviour.
- Temporary artefacts are written under temp_files/.
Thread-safety: this class is stateless and immutable.
- Since:
- 3.0.0
- Author:
- ANKATech Solutions Inc.
- See Also:
-
Method Summary
-
Method Details
-
main
Runs the ML-KEM-768 to ML-KEM-1024 re-encryption scenario on the granted pair.Loads CLI properties, authenticates against ANKASecure©, and delegates to the scenario logic. On any unrecoverable error the JVM terminates via
ExampleUtil.fatal(String, Throwable).- Parameters:
args- command-line arguments (ignored)
-