Class ExampleScenario4
This scenario demonstrates how to migrate classical RSA-encrypted data to a post-quantum ML-KEM-encrypted format without exposing plaintext. All cryptographic operations use the streaming API, meaning the service exchanges a two-part detached JWE (General-JSON header + raw ciphertext stream).
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-reencrypt2-source
(RSA-3072) and target cli-reencrypt2-target (ML-KEM-768).
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
RSA-3072source andML-KEM-768target kids. - Stream-encrypt a file under the source (detached JWE).
- Re-encrypt the ciphertext on the server (RSA → KEM).
- Stream-decrypt with the KEM target key.
- Validate round-trip integrity.
Temporary artefacts are placed under temp_files/.
Implementation notes (Java 21+):
- All file operations rely on the
PathAPI. - Encoding is explicitly set to UTF-8 for deterministic behaviour.
- Directory creation delegates to
ExampleUtil.ensureTempDir(Path).
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 RSA-3072 to ML-KEM-768 streaming re-encryption scenario.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)
-