Class ExampleScenario2
java.lang.Object
co.ankatech.ankasecure.sdk.examples.ExampleScenario2
Scenario 2 – RSA-2048 Streaming Sign / Verify
This walkthrough illustrates a detached-JWS workflow:
- Key-pair generation – classical RSA-2048.
- Streaming sign – the SDK uploads the file in chunks
and receives a detached JWS (General JSON) whose
payload
isnull
. - Streaming verify – the same detached signature is verified against the binary payload with constant memory.
Rule of thumb:
- Non-streaming → compact JWS / compact JWE
- Streaming → detached JWS / detached JWE
All artefacts are written under temp_files/.
Implementation notes (Java 21+):
- File handling leverages the
Path
API. - UTF-8 is explicitly specified for deterministic encoding.
- Directory creation uses
Files.createDirectories(Path, FileAttribute[])
.
Thread-safety: the class is stateless and immutable; all variables are confined to the current thread.
- Since:
- 2.1.0
- Author:
- ANKATech – Security Engineering
-
Method Summary
-
Method Details
-
main
-