Class ExampleScenario1
java.lang.Object
co.ankatech.ankasecure.sdk.examples.ExampleScenario1
Scenario 1 – End-to-end ML-KEM-512 Life-cycle (Streaming)
This scenario demonstrates an end-to-end post-quantum key
life-cycle using the streaming encryption / decryption
endpoints of ANKASecure.
In streaming mode the platform produces a detached
JWE (General JSON / “JWET”) where the ciphertext
and
tag
fields are null
and are instead delivered in the second
multipart section. The non-streaming API would return a single compact JWE
string.
- Generate a post-quantum ML-KEM-512 key-pair.
- Export its public metadata to JSON.
- Stream-encrypt a local file (detached JWE).
- Stream-decrypt the ciphertext.
- Validate round-trip integrity.
Prerequisite: the CLI configuration must contain a valid access token.
Implementation notes (Java 21+):
- All file handling relies on the
Path
API. - Encoding is explicitly set to
StandardCharsets.UTF_8
to avoid platform-dependent defaults. - Directory creation leverages
Files.createDirectories(Path, FileAttribute[])
.
Thread-safety: the class is stateless and immutable –
a new instance of AnkaSecureSdk
is created inside main
and
locally confined to that thread.
- Since:
- 2.1.0
- Author:
- ANKATech – Security Engineering
-
Method Summary
-
Method Details
-
main
-