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 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.

  1. Generate a post-quantum 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: the CLI configuration must contain a valid access token.

Implementation notes (Java 21+):

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 Details

    • main

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