Class ExampleScenario8

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

public final class ExampleScenario8 extends Object
Scenario 8 — ML-KEM-768 → ML-KEM-1024 Bulk Re-encryption (auto-detect / Compact JWE).

This scenario performs a non-streaming PQC-to-PQC migration of ciphertext from an ML-KEM-768 key to a stronger ML-KEM-1024 key, entirely on the server side (no plaintext exposure):

The SDK is data-plane-only: it does not create keys. This scenario operates on the pre-provisioned granted cross-kid pair of the demo-cli playground — source cli-reencrypt3-source (ML-KEM-768) and target cli-reencrypt3-target (ML-KEM-1024). The cli-reference actor holds the cross-kid REENCRYPT grant on this pair plus the atomic encrypt/decrypt grants on each endpoint.

  1. Resolve the granted ML-KEM-768 source and ML-KEM-1024 target kids.
  2. Encrypt a file under the source (auto-detected Compact JWE).
  3. Re-encrypt the ciphertext on the server (ML-KEM-768 → ML-KEM-1024).
  4. Decrypt the new KEM ciphertext under the target.
  5. Validate round-trip integrity.

Implementation notes (Java 21+):

  • Filesystem operations rely on the Path API.
  • UTF-8 encoding is enforced explicitly for deterministic behaviour.
  • Temporary artefacts are written under temp_files/.

Thread-safety: this class is stateless and immutable.

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

    • main

      public static void main(String[] args)
      Runs the ML-KEM-768 to ML-KEM-1024 re-encryption scenario on the granted pair.

      Loads CLI properties, authenticates against ANKASecure©, and delegates to the scenario logic. On any unrecoverable error the JVM terminates via ExampleUtil.fatal(String, Throwable).

      Parameters:
      args - command-line arguments (ignored)