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 Life-cycle (Streaming)

This scenario walks through a complete post-quantum key life-cycle 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. Generate an ML-KEM-512 key-pair.
  2. Export its public metadata to JSON.
  3. Stream-encrypt a local file (detached JWE).
  4. Stream-decrypt the ciphertext.
  5. Validate round-trip integrity.

Prerequisite: a valid access-token must be present in the CLI configuration.

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 AnkaSecureSdk instance is created inside main.

Since:
2.1.0
Author:
ANKATech – Security Engineering
  • Method Details

    • main

      public static void main(String[] args)
      Entry-point.