Class ExampleScenario1

java.lang.Object
co.ankatech.ankasecure.sdk.examples.ExampleScenario1

public final class ExampleScenario1 extends Object
Scenario 1 — End-to-End ML-KEM-512 Encryption (Streaming).

This scenario walks through a complete post-quantum data-plane round-trip using the streaming endpoints of ANKASecure©. In streaming mode the service produces a detached JWE (General-JSON header + raw ciphertext stream) instead of a single compact JWE string.

  1. Resolve a pre-provisioned ML-KEM-512 key from the demo-cli playground (the SDK is data-plane-only — it does not create keys).
  2. Stream-encrypt a local file (detached JWE).
  3. Stream-decrypt the ciphertext.
  4. Validate round-trip integrity.

Prerequisite: a cli.properties for the cli-reference actor of the provisioned demo-cli playground, carrying the ankasecure.demo.kids catalogue (emitted by the demo-provisioning tool). Key lifecycle (generate/rotate/export) lives in cli-admin, not the SDK.

Implementation notes (Java 21+):

  • All file handling relies on the Path API.
  • UTF-8 is enforced explicitly to avoid platform-dependent defaults.
  • Temporary artefacts are written under temp_files/.

Thread-safety: the class is stateless and immutable; a fresh AuthenticatedSdk instance is created inside main(String[]).

Since:
3.0.0
Author:
ANKATech Solutions Inc.
See Also:
  • Method Details

    • main

      public static void main(String[] args)
      Runs the ML-KEM-512 streaming encryption scenario on a pre-provisioned key.

      Loads CLI properties, authenticates against ANKASecure©, resolves a pre-provisioned ML-KEM-512 playground key, and delegates to the scenario logic. On any unrecoverable error the JVM terminates via ExampleUtil.fatal(String, Throwable).

      Parameters:
      args - command-line arguments (ignored)