Class ExampleScenario5

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

public final class ExampleScenario5 extends Object

Scenario 5 – ML-KEM-512 Bulk Helpers (Compact JWE)

This scenario demonstrates the non-streaming helper methods that work with RFC 7516 Compact JWE tokens:

  1. Generate an ML-KEM-512 key-pair.
  2. Export the key’s public metadata to JSON.
  3. Encrypt a file via AnkaSecureSdk.encryptFile(String, Path, Path) (compact token written to disk).
  4. Decrypt via AnkaSecureSdk.decryptFile(Path, Path).
  5. Print rich metadata for both operations.
  6. Validate round-trip integrity.

Implementation notes (Java 21+):

  • All filesystem interactions use the Path API.
  • UTF-8 is enforced explicitly for deterministic encoding.
  • Temporary artefacts are written under temp_files/.

Thread-safety: this class is stateless and immutable.

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

    • main

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