Class ExampleScenario3
java.lang.Object
co.ankatech.ankasecure.sdk.examples.ExampleScenario3
Scenario 3 — AES-256 Streaming Encrypt / Decrypt.
This scenario demonstrates a symmetric workflow via the streaming APIs. In streaming mode the service returns a detached JWE (General JSON): the header portion is delivered separately from the raw ciphertext, keeping memory usage constant.
- Resolve a pre-provisioned
AES-GCM-256key from the demo-cli playground (the SDK is data-plane-only — it does not create keys). - Stream-encrypt a plaintext file (detached JWE).
- Stream-decrypt the ciphertext.
- Validate that the plaintext round-trips.
All artefacts are written under temp_files/.
Implementation notes (Java 21+):
- All filesystem operations use the
PathAPI. - UTF-8 is enforced explicitly to avoid platform defaults.
- Directory creation relies on
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 AES-256 streaming encrypt/decrypt 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)
-