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.
- Generate an
AES-256
key (kty="oct"
). - 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
Path
API. - UTF-8 is explicitly specified to avoid platform defaults.
- Directory creation relies on
Files.createDirectories(Path, FileAttribute[])
viaExampleUtil.ensureTempDir(Path)
.
Thread-safety: this class is stateless and immutable.
- Since:
- 2.1.0
- Author:
- ANKATech – Security Engineering
-
Method Summary
-
Method Details
-
main
-