Class ExampleScenario3

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

public final class ExampleScenario3 extends Object

Scenario 3 – AES-256 Streaming Encrypt / Decrypt

This scenario demonstrates a symmetric workflow via the streaming APIs. In streaming mode the service returns a detached JWE (General JSON): the header portion is delivered separately from the raw ciphertext, keeping memory usage constant.

  1. Generate an AES-256 key (kty="oct").
  2. Stream-encrypt a plaintext file (detached JWE).
  3. Stream-decrypt the ciphertext.
  4. Validate that the plaintext round-trips.

All artefacts are written under temp_files/.

Implementation notes (Java 21+):

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.
      Parameters:
      args - ignored