Class ExampleScenarioPqcHandshake
This class demonstrates a complete client-side flow for establishing a
post-quantum hybrid channel via an initial PQC handshake (ML-1024), followed by
authenticated requests with payload encryption/decryption using the AES key
negotiated during the handshake. The server is assumed to be a Spring Boot
application implementing the required /api/pqc-handshake/init
endpoint and an interceptor that recognizes the X-PQC-Transport
and
X-PQC-Session
headers.
The typical flow is:
- Generate a ML-1024 key pair (e.g. ML-KEM-1024) on the client side.
- Call
/api/pqc-handshake/init
, sending the client's ML-1024 public key in Base64. - The server returns an AES-256 key in Base64 (in the
ciphertextBase64
field) plus a uniquesessionId
. - The client decodes the returned AES key from Base64 and stores it
alongside the
sessionId
for subsequent encryption/decryption. - All further requests add:
X-PQC-Transport: true
X-PQC-Session: <sessionId>
Internally, the server performs an ephemeral approach with the provided ML-1024 public key, but from the client's perspective, the server simply returns the final AES key in Base64 for convenience. The client does not need to implement a KeyAgreement step; it only decodes the AES key.
This class follows the style of ExampleScenario1
, including property
loading, secure credential handling, and example usage of generating keys on
the server via an encrypted (PQC) channel.
- Version:
- 1.0
- Author:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Main method that executes the PQC handshake scenario: Load properties (similarly toExampleScenario1
). Generate a ML-1024 key pair and perform the handshake. Authenticate using existing credential logic (encrypted credentials). Use the PQC channel to generate a new key on the server (test call).
-
Constructor Details
-
ExampleScenarioPqcHandshake
public ExampleScenarioPqcHandshake()
-
-
Method Details
-
main
Main method that executes the PQC handshake scenario:- Load properties (similarly to
ExampleScenario1
). - Generate a ML-1024 key pair and perform the handshake.
- Authenticate using existing credential logic (encrypted credentials).
- Use the PQC channel to generate a new key on the server (test call).
- Parameters:
args
- command-line arguments (none used).
- Load properties (similarly to
-