You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2026/10/01 13:58:40 UTC
(camel-quarkus-examples) branch camel-quarkus-main updated: Require JDK 21 as the minimum supported Java version
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch camel-quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git
The following commit(s) were added to refs/heads/camel-quarkus-main by this push:
new a6527b5b Require JDK 21 as the minimum supported Java version
a6527b5b is described below
commit a6527b5b0f3296f903b5388a84a1f6b34d67c14a
Author: James Netherton <ja...@users.noreply.github.com>
AuthorDate: Thu Oct 1 14:58:35 2026 +0100
Require JDK 21 as the minimum supported Java version
Co-authored-by: Claude Opus 5.5 <no...@anthropic.com>
---
.github/workflows/ci-build.yaml | 14 +-
AGENTS.md | 4 +-
amqp/pom.xml | 2 +-
artemis-elasticsearch/pom.xml | 2 +-
aws-lambda/README.adoc | 2 +-
aws-lambda/pom.xml | 2 +-
aws2-s3/pom.xml | 2 +-
cluster-leader-election/pom.xml | 2 +-
cxf-soap/pom.xml | 2 +-
cyberark-vault/pom.xml | 2 +-
data-extract-langchain4j/pom.xml | 2 +-
docs/modules/ROOT/attachments/examples.json | 11 +-
fhir/pom.xml | 2 +-
file-bindy-ftp/pom.xml | 2 +-
file-split-log-xml/pom.xml | 2 +-
health/pom.xml | 2 +-
http-log/pom.xml | 2 +-
http-pqc-j17/PQC-EXPLANATION.adoc | 487 ---------------------
http-pqc-j17/README.adoc | 228 ----------
http-pqc-j17/pom.xml | 303 -------------
.../main/java/org/acme/http/pqc/PqcCamelRoute.java | 45 --
.../certificates/HybridCertificateGenerator.java | 305 -------------
.../pqc/certificates/SecurityConfiguration.java | 52 ---
.../util/CertificateValidationException.java | 33 --
.../pqc/certificates/util/CertificatesUtil.java | 132 ------
.../java/org/acme/http/pqc/crypto/ChimeraOids.java | 175 --------
.../HybridPqcTrustManagerCustomizer.java | 98 -----
.../trustmanager/HybridPqcX509TrustManager.java | 291 ------------
.../src/main/resources/application.properties | 51 ---
.../org/acme/http/pqc/CertificatesUtilTest.java | 121 -----
.../java/org/acme/http/pqc/ForgedCertificates.java | 169 -------
.../src/test/java/org/acme/http/pqc/HttpPqcIT.java | 23 -
.../test/java/org/acme/http/pqc/HttpPqcTest.java | 151 -------
.../http/pqc/HybridPqcX509TrustManagerTest.java | 269 ------------
http-pqc-j21/eclipse-formatter-config.xml | 276 ------------
{http-pqc-j21 => http-pqc}/README.adoc | 26 +-
.../eclipse-formatter-config.xml | 0
{http-pqc-j21 => http-pqc}/pom.xml | 17 +-
.../main/java/org/acme/http/pqc/PqcCamelRoute.java | 0
.../pqc/certificates/CertificateGenerator.java | 2 +-
.../pqc/certificates/SecurityConfiguration.java | 0
.../src/main/resources/application.properties | 2 +-
.../java/org/acme/http/pqc/AbstractPqcTest.java | 0
.../test/java/org/acme/http/pqc/PqcOnlyTest.java | 0
.../java/org/acme/http/pqc/PqcWithFallbackIT.java | 0
.../org/acme/http/pqc/PqcWithFallbackTest.java | 0
.../org/acme/http/pqc/profiles/PqcOnlyProfile.java | 0
.../http/pqc/profiles/PqcWithFallbackProfile.java | 0
.../src/test/resources/application.properties | 0
jdbc-datasource/pom.xml | 2 +-
jms-jpa/pom.xml | 2 +-
jpa-idempotent-repository/pom.xml | 2 +-
jta-jpa/pom.xml | 2 +-
kafka/pom.xml | 2 +-
kamelet-chucknorris/pom.xml | 2 +-
langchain4j-ingest-rag/pom.xml | 2 +-
message-bridge/pom.xml | 2 +-
netty-custom-correlation/pom.xml | 2 +-
observability/pom.xml | 2 +-
openapi-contract-first/pom.xml | 2 +-
platform-http-security-keycloak/pom.xml | 2 +-
pom.xml | 3 +-
quarkus-rest-json/pom.xml | 2 +-
rest-json/pom.xml | 2 +-
rest-keycloak-soap-jms/pom.xml | 2 +-
saga/pom.xml | 2 +-
saga/saga-integration-tests/README.md | 2 +-
spring-redis/pom.xml | 2 +-
timer-log-main/pom.xml | 2 +-
timer-log/pom.xml | 2 +-
variables/pom.xml | 2 +-
vertx-websocket-chat/pom.xml | 2 +-
72 files changed, 65 insertions(+), 3295 deletions(-)
diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index ece718f3..c2283f03 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -61,11 +61,11 @@ jobs:
matrix: ${{ steps.set-itest-matrix.outputs.matrix }}
modules: ${{ steps.set-itest-matrix.outputs.modules }}
steps:
- - name: Set up JDK 17
+ - name: Set up JDK 21
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '21'
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Checkout Camel Quarkus
@@ -143,11 +143,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- - name: Set up JDK 17
+ - name: Set up JDK 21
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '21'
- name: Download Maven Repo
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
@@ -199,7 +199,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- jdk: ['21']
+ jdk: ['25']
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -238,11 +238,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- - name: Set up JDK 17
+ - name: Set up JDK 21
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '21'
- name: Download Maven Repo
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
diff --git a/AGENTS.md b/AGENTS.md
index dd487bfe..6c4cbaab 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -14,7 +14,7 @@ core (e.g. GitHub issues instead of JIRA).
## Project Info
- Build: Maven 3.9+ (use the provided `./mvnw` wrapper)
-- Java: 17+ (CI also exercises JDK 21)
+- Java: 21+ (CI also exercises JDK 25)
- BOMs: `quarkus-bom` + `quarkus-camel-bom` (extension versions are inherited,
never pinned per-dependency)
- Tests: `@QuarkusTest` (JVM) and `@QuarkusIntegrationTest` (packaged/native)
@@ -84,7 +84,7 @@ mvn license:check formatter:validate impsort:check
```
CI validates platform compatibility (`cq:examples-check-platform`), license and
-formatting, compilation, tests, and native builds (Linux/Windows, JDK 17/21).
+formatting, compilation, tests, and native builds (Linux/Windows, JDK 21/25).
## Conventions
diff --git a/amqp/pom.xml b/amqp/pom.xml
index 157ec5b7..5648f9bd 100644
--- a/amqp/pom.xml
+++ b/amqp/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/artemis-elasticsearch/pom.xml b/artemis-elasticsearch/pom.xml
index 384a6d91..d9cae159 100644
--- a/artemis-elasticsearch/pom.xml
+++ b/artemis-elasticsearch/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/aws-lambda/README.adoc b/aws-lambda/README.adoc
index e4163d2c..d2651150 100644
--- a/aws-lambda/README.adoc
+++ b/aws-lambda/README.adoc
@@ -80,7 +80,7 @@ https://quarkus.io/guides/amazon-lambda#extra-build-generated-files[Please click
3. Give the name for your function which should be unique
-4. Select Java 17 (Corretto) as Runtime
+4. Select Java 21 as Runtime
5. Under Permission feel free to create / use existing role to give the required permission for your lambda function
diff --git a/aws-lambda/pom.xml b/aws-lambda/pom.xml
index 281c40f3..ecaf5963 100644
--- a/aws-lambda/pom.xml
+++ b/aws-lambda/pom.xml
@@ -37,7 +37,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/aws2-s3/pom.xml b/aws2-s3/pom.xml
index f464416d..e48b0817 100644
--- a/aws2-s3/pom.xml
+++ b/aws2-s3/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/cluster-leader-election/pom.xml b/cluster-leader-election/pom.xml
index 67b52ece..b0853ab8 100644
--- a/cluster-leader-election/pom.xml
+++ b/cluster-leader-election/pom.xml
@@ -39,7 +39,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/cxf-soap/pom.xml b/cxf-soap/pom.xml
index ac5b3ed4..0287fdc5 100644
--- a/cxf-soap/pom.xml
+++ b/cxf-soap/pom.xml
@@ -39,7 +39,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
diff --git a/cyberark-vault/pom.xml b/cyberark-vault/pom.xml
index 6812c470..490d7b60 100644
--- a/cyberark-vault/pom.xml
+++ b/cyberark-vault/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<smallrye-certificate-generator-junit5.version>0.9.3</smallrye-certificate-generator-junit5.version>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
diff --git a/data-extract-langchain4j/pom.xml b/data-extract-langchain4j/pom.xml
index c9aa51c7..a47dd994 100644
--- a/data-extract-langchain4j/pom.xml
+++ b/data-extract-langchain4j/pom.xml
@@ -41,7 +41,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
diff --git a/docs/modules/ROOT/attachments/examples.json b/docs/modules/ROOT/attachments/examples.json
index e4b8ee09..0cca3ed3 100644
--- a/docs/modules/ROOT/attachments/examples.json
+++ b/docs/modules/ROOT/attachments/examples.json
@@ -50,14 +50,9 @@
"link": "https://github.com/apache/camel-quarkus-examples/tree/main/file-bindy-ftp"
},
{
- "title": "HTTP with Post-Quantum Cryptography (PQC) (Java 17)",
- "description": "Shows how to implement quantum-resistant authentication using hybrid certificates that combine RSA with post-quantum ML-DSA-65 signatures on Java 17 using application-level validation",
- "link": "https://github.com/apache/camel-quarkus-examples/tree/main/http-pqc-j17"
- },
- {
- "title": "HTTP with Post-Quantum Cryptography (PQC) (Java 21)",
- "description": "Shows how to implement quantum-resistant TLS using Java 21 with BouncyCastle JSSE provider for native PQC support with hybrid cipher suites",
- "link": "https://github.com/apache/camel-quarkus-examples/tree/main/http-pqc-j21"
+ "title": "HTTP with Post-Quantum Cryptography (PQC)",
+ "description": "Shows how to implement quantum-resistant TLS using the BouncyCastle JSSE provider for native PQC support with hybrid cipher suites",
+ "link": "https://github.com/apache/camel-quarkus-examples/tree/main/http-pqc"
},
{
"title": "HTTP with vanilla JAX-RS or with Camel `platform-http` component",
diff --git a/fhir/pom.xml b/fhir/pom.xml
index c4704823..cc9b6909 100644
--- a/fhir/pom.xml
+++ b/fhir/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
diff --git a/file-bindy-ftp/pom.xml b/file-bindy-ftp/pom.xml
index 7ae0b198..da9102c7 100644
--- a/file-bindy-ftp/pom.xml
+++ b/file-bindy-ftp/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
diff --git a/file-split-log-xml/pom.xml b/file-split-log-xml/pom.xml
index 1eec4f1e..47dc5717 100644
--- a/file-split-log-xml/pom.xml
+++ b/file-split-log-xml/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/health/pom.xml b/health/pom.xml
index 7fc5216b..e6f6ff0e 100644
--- a/health/pom.xml
+++ b/health/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/http-log/pom.xml b/http-log/pom.xml
index a621fc51..f04a4908 100644
--- a/http-log/pom.xml
+++ b/http-log/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/http-pqc-j17/PQC-EXPLANATION.adoc b/http-pqc-j17/PQC-EXPLANATION.adoc
deleted file mode 100644
index 06ed5f83..00000000
--- a/http-pqc-j17/PQC-EXPLANATION.adoc
+++ /dev/null
@@ -1,487 +0,0 @@
-= Post-Quantum Cryptography: Visual Explanation
-
-== The Quantum Computer Threat
-
-=== Traditional Encryption (RSA/ECC)
-
-[source,text]
-----
-┌─────────────────────────────────────────────────────────────┐
-│ Current World (Safe) Future with Quantum Computer │
-│ │
-│ RSA-2048 encryption Quantum Computer │
-│ ┌──────────────┐ ┌──────────────┐ │
-│ │ Lock (RSA) │ ──────> │ Shor's Algo │ │
-│ │ Takes 1000s │ │ Breaks in │ │
-│ │ of years to │ │ MINUTES! ⚠️ │ │
-│ │ break │ └──────────────┘ │
-│ └──────────────┘ │
-└─────────────────────────────────────────────────────────────┘
-----
-
-=== Post-Quantum Cryptography (PQC)
-
-[source,text]
-----
-┌─────────────────────────────────────────────────────────────┐
-│ PQC Solution Even with Quantum Computer │
-│ │
-│ ML-DSA (FIPS 204) Quantum Computer │
-│ ┌──────────────┐ ┌──────────────┐ │
-│ │ Lattice Lock │ ──────> │ Shor's Algo │ │
-│ │ Based on │ │ Doesn't work!│ │
-│ │ hard math │ │ Still takes │ │
-│ │ problems │ │ 1000s years ✓│ │
-│ └──────────────┘ └──────────────┘ │
-└─────────────────────────────────────────────────────────────┘
-----
-
-'''
-
-== Three Approaches in Our Implementation
-
-=== 1. CURRENT HTTPS (What Most Systems Use Today)
-
-[source,text]
-----
-┌──────────────┐ ┌──────────────┐
-│ Browser │ │ Server │
-│ (Client) │ │ │
-└──────┬───────┘ └──────┬───────┘
- │ │
- │ 1. "Hello, I want HTTPS connection" │
- ├──────────────────────────────────────────────>│
- │ │
- │ 2. "Here's my certificate" │
- │ ┌─────────────────────────┐ │
- │ │ Certificate: │ │
- │ │ - Public Key: RSA-2048 │ │
- │ │ - Signature: SHA256+RSA │ │
- │<────│ - Subject: localhost │───────────────│
- │ │ ⚠️ QUANTUM VULNERABLE │ │
- │ └─────────────────────────┘ │
- │ │
- │ 3. Verify RSA signature ✓ │
- │ (Works today, broken by quantum later) │
- │ │
- │ 4. Encrypted communication using RSA │
- │<─────────────────────────────────────────────>│
- │ ⚠️ Future quantum computer can break this │
- │ │
-----
-
-**Problem:** When quantum computers arrive, they can:
-
-* Break the RSA encryption
-* Forge RSA signatures
-* Read all your "encrypted" data
-
-'''
-
-=== 2. ALTERNATIVE APPROACH: Application-Layer PQC (NOT this example)
-
-This is a **workaround approach** when you can't modify TLS behavior - demonstrate PQC **inside** the application:
-
-[source,text]
-----
-┌──────────────┐ ┌──────────────┐
-│ Browser │ │ Server │
-│ (curl) │ │ (Quarkus) │
-└──────┬───────┘ └──────┬───────┘
- │ │
- │ LAYER 1: HTTPS (Still uses RSA) │
- │ ════════════════════════════════════════ │
- │ 1. TLS Handshake with RSA certificate │
- ├──────────────────────────────────────────────>│
- │ ┌─────────────────────────┐ │
- │ │ TLS Certificate: │ │
- │ │ - RSA-2048 (classical) │ │
- │<────│ ⚠️ Quantum vulnerable │───────────────│
- │ └─────────────────────────┘ │
- │ │
- │ 2. Encrypted tunnel established │
- │<═════════════════════════════════════════════>│
- │ ⚠️ TLS handshake is quantum-vulnerable │
- │ │
- │ LAYER 2: PQC at Application Level │
- │ ════════════════════════════════════════ │
- │ 3. GET /pqc/sign │
- ├──────────────────────────────────────────────>│
- │ │
- │ ┌──────────┴───────────┐
- │ │ PqcSignatureService │
- │ │ - Generate ML-DSA-65 │
- │ │ keypair │
- │ │ - Sign message │
- │ │ - Verify signature │
- │ │ ✓ Algorithm is safe │
- │ └──────────┬───────────┘
- │ 4. Returns PQC signature demo │
- │<──────────────────────────────────────────────│
-----
-
-**Why we DON'T use this approach:**
-
-* ⚠️ **TLS handshake is still quantum-vulnerable** - attacker can intercept the initial connection
-* ℹ️ **Only demonstrates PQC algorithms** - doesn't actually protect the authentication
-* ✅ **Good for learning/demos** - shows how PQC algorithms work
-* ❌ **Not good for real security** - TLS layer remains vulnerable
-
-**This example uses Approach #3 instead** ⬇️
-
-'''
-
-=== 3. OUR IMPLEMENTATION: Chimera Hybrid Certificates at TLS Layer
-
-**This example implements this approach!** It validates hybrid PQC certificates during the TLS handshake:
-
-[source,text]
-----
-┌──────────────┐ ┌──────────────┐
-│ Browser │ │ Server │
-│ (Client) │ │ │
-└──────┬───────┘ └──────┬───────┘
- │ │
- │ 1. "Hello, I want HTTPS connection" │
- ├──────────────────────────────────────────────>│
- │ │
- │ 2. "Here's my HYBRID certificate" │
- │ ┌─────────────────────────────────────┐ │
- │ │ Chimera Hybrid Certificate: │ │
- │ │ ──────────────────────────────── │ │
- │ │ PRIMARY (Classical): │ │
- │ │ - Public Key: RSA-2048 │ │
- │ │ - Signature: SHA256withRSA │ │
- │ │ ✓ Works with old systems │ │
- │ │ │ │
- │ │ ALTERNATIVE (PQC) - Extensions: │ │
- │<────│ - altPublicKey: ML-DSA-65 │───│
- │ │ - altSignature: ML-DSA-65 │ │
- │ │ ✓ QUANTUM SAFE │ │
- │ │ │ │
- │ │ BOTH signatures present! │ │
- │ └─────────────────────────────────────┘ │
- │ │
- │ 3. Verify RSA signature ✓ │
- │ (Works with old browsers) │
- │ │
- │ 4. Verify ML-DSA-65 signature ✓ │
- │ (PQC-aware clients check this too) │
- │ │
- │ 5. Encrypted communication │
- │<─────────────────────────────────────────────>│
- │ ✓ Protected by BOTH classical & PQC │
- │ │
-----
-
-==== How Chimera Works
-
-[source,text]
-----
-┌─────────────────────────────────────────────────────────────┐
-│ CHIMERA HYBRID CERTIFICATE │
-│ │
-│ ┌────────────────────┐ ┌────────────────────┐ │
-│ │ PRIMARY LAYER │ │ ALTERNATIVE LAYER │ │
-│ │ (Classical RSA) │ │ (PQC ML-DSA) │ │
-│ └─────────┬──────────┘ └─────────┬──────────┘ │
-│ │ │ │
-│ │ Subject: CN=localhost │ │
-│ │ Issuer: CN=PQC Hybrid CA │ │
-│ │ Serial: 1234567890 │ │
-│ │ │ │
-│ ┌─────────▼──────────┐ ┌─────────▼──────────┐ │
-│ │ RSA-2048 │ │ CA Extension OID │ │
-│ │ Public Key │ │ 2.5.29.72: the │ │
-│ │ (Standard field) │ │ CA's ML-DSA-65 │ │
-│ └────────────────────┘ │ Public Key │ │
-│ └────────────────────┘ │
-│ ┌────────────────────┐ ┌────────────────────┐ │
-│ │ SHA256withRSA │ │ Extension OID │ │
-│ │ Signature │ │ 2.5.29.74: │ │
-│ │ [RSA signature │ │ ML-DSA-65 │ │
-│ │ bytes] by the CA │ │ Signature bytes │ │
-│ └────────────────────┘ │ by the CA │ │
-│ └────────────────────┘ │
-│ │
-│ Verification: BOTH signatures must be valid! │
-│ - Old systems: Check RSA only ✓ │
-│ - PQC systems: Check RSA ✓ AND ML-DSA ✓ │
-│ │
-│ Both are made by the CA, and the ML-DSA one is verified │
-│ with the CA's key from the CA certificate. Forging RSA │
-│ alone is therefore not enough to mint a certificate. │
-└─────────────────────────────────────────────────────────────┘
-----
-
-'''
-
-== Certificate Comparison
-
-=== Traditional Certificate (RSA only)
-
-[source,text]
-----
-┌─────────────────────────────────┐
-│ X.509 Certificate │
-├─────────────────────────────────┤
-│ Version: 3 │
-│ Serial: 0x123456 │
-│ Issuer: CN=My CA │
-│ Subject: CN=localhost │
-│ ┌─────────────────────────────┐ │
-│ │ Public Key: │ │
-│ │ Algorithm: RSA │ │
-│ │ Size: 2048 bits │ │
-│ │ Key: [MIIBIjANBg...] │ │
-│ └─────────────────────────────┘ │
-│ ┌─────────────────────────────┐ │
-│ │ Signature: │ │
-│ │ Algorithm: SHA256withRSA │ │
-│ │ Value: [3045022100...] │ │
-│ └─────────────────────────────┘ │
-│ │
-│ ⚠️ QUANTUM VULNERABLE │
-└─────────────────────────────────┘
-----
-
-=== Chimera Hybrid Certificate (RSA + ML-DSA-65)
-
-[source,text]
-----
-┌─────────────────────────────────────────────────────┐
-│ X.509 Certificate (Chimera Format) │
-├─────────────────────────────────────────────────────┤
-│ Version: 3 │
-│ Serial: 0x123456 │
-│ Issuer: CN=PQC Hybrid CA │
-│ Subject: CN=localhost │
-│ ┌─────────────────────────────┐ │
-│ │ Public Key (PRIMARY): │ │
-│ │ Algorithm: RSA │ ✓ Classical │
-│ │ Size: 2048 bits │ │
-│ │ Key: [MIIBIjANBg...] │ │
-│ └─────────────────────────────┘ │
-│ ┌─────────────────────────────┐ │
-│ │ Extensions: │ │
-│ │ ┌─────────────────────────┐ │ │
-│ │ │ OID 2.5.29.73: │ │ │
-│ │ │ altSignatureAlgorithm │ │ │
-│ │ │ Algorithm: ML-DSA-65 │ │ │
-│ │ └─────────────────────────┘ │ │
-│ │ ┌─────────────────────────┐ │ │
-│ │ │ OID 2.5.29.74: │ │ │
-│ │ │ altSignatureValue │ │ │
-│ │ │ Signature: [D1L1...] │ │ ✓ Post-Quantum │
-│ │ │ Size: 3309 bytes │ │ │
-│ │ │ Made by the CA's │ │ │
-│ │ │ ML-DSA-65 key over │ │ │
-│ │ │ the whole cert body │ │ │
-│ │ └─────────────────────────┘ │ │
-│ └─────────────────────────────┘ │
-│ │
-│ The CA certificate carries OID 2.5.29.72 │
-│ (subjectAltPublicKeyInfo) holding the CA's │
-│ ML-DSA-65 public key, which verifies the above. │
-│ ┌─────────────────────────────┐ │
-│ │ Signature (PRIMARY): │ │
-│ │ Algorithm: SHA256withRSA │ ✓ Classical │
-│ │ Value: [3045022100...] │ │
-│ └─────────────────────────────┘ │
-│ │
-│ ✓ HYBRID: Protected against classical AND quantum! │
-└─────────────────────────────────────────────────────┘
-----
-
-'''
-
-== Our Implementation: TLS-Layer Hybrid Certificate Validation
-
-[source,text]
-----
-┌────────────────────────────────────────────────────────────────┐
-│ HTTP PQC Example - TLS-Layer Validation │
-└────────────────────────────────────────────────────────────────┘
-
-HYBRID CERTIFICATE VALIDATION (Chimera at TLS Layer)
-────────────────────────────────────────────────────
-Endpoint: https://localhost:8443/pqc/secure
-
-┌─────────────┐ ┌─────────────────────────┐
-│ Client │─────>│ TLS Handshake │
-│ Request │ │ (with client cert) │
-└─────────────┘ └─────────┬───────────────┘
- │
- ┌─────────▼───────────┐
- │ Client sends hybrid │
- │ PQC certificate │
- └─────────┬───────────┘
- │
- ┌──────────────┴──────────────┐
- │ HybridPqcX509TrustManager │
- └──────────────┬──────────────┘
- │
- ┌─────────▼─────────┐
- │ Extract signatures│
- │ from certificate │
- └─────────┬─────────┘
- │
- ┌──────────────┴──────────────┐
- ▼ ▼
- ┌───────────────┐ ┌────────────────┐
- │ Validate chain│ │ Validate │
- │ to anchor ✓ │ │ ML-DSA-65 ✓ │
- └───────┬───────┘ └────────┬───────┘
- │ │
- └──────────────┬──────────────┘
- │
- ┌─────────▼─────────┐
- │ BOTH valid? │
- │ YES → Allow │
- │ NO → Reject TLS │
- └─────────┬─────────┘
- │
- ▼
- ┌──────────────────┐
- │ /pqc/secure │
- │ route executes │
- └──────┬───────────┘
- │
- ▼
- Result: ✓ Validated!
- "✓ Hybrid PQC certificate
- validated at TLS layer!"
-
- (Dual protection - works
- now + quantum-safe!)
-----
-
-'''
-
-== Why We Use Approach #3 (Chimera) Instead of Approach #2
-
-[cols="1,2,2",options="header"]
-|===
-|Aspect
-|Approach #2: App-Layer PQC
-|Approach #3: Chimera at TLS Layer ✅
-
-|**TLS Handshake**
-|⚠️ Quantum-vulnerable (RSA only)
-|✅ Validates both RSA + ML-DSA-65
-
-|**Authentication**
-|❌ No PQC authentication
-|✅ Rejects invalid certificates
-
-|**Protection Level**
-|⚠️ Demo only, TLS is vulnerable
-|⚠️ Authentication is hybrid, but the key exchange is still classical
-
-|**When to use**
-|Learning, experimenting
-|Migrating certificates ahead of a PQC-capable TLS stack
-
-|**Code complexity**
-|Simple (app endpoints)
-|Moderate (custom TrustManager)
-|===
-
-**Key Difference:**
-
-* **Approach #2** is like having a regular lock on your door (RSA TLS) but demonstrating fancy new locks inside your house (PQC demos)
-* **Approach #3** is like installing a dual-lock system ON YOUR DOOR (Chimera certificates validated at TLS handshake)
-
-Approach #3 strengthens authentication because:
-
-. Invalid certificates are **rejected during TLS handshake** before any data is exchanged
-. A certificate must chain to a trust anchor, be within its validity period, **and** carry a valid ML-DSA-65 signature to establish the connection
-. Works with the existing TLS infrastructure (backward compatible)
-
-It does **not** make the connection quantum-safe: the key exchange that protects the session is still classical, so a recorded session can be decrypted by a future quantum computer. Only the certificate authentication gains post-quantum protection. Use `http-pqc-j21` for quantum-safe transport.
-
-'''
-
-== Why Chimera is the Best Migration Path
-
-[source,text]
-----
-┌─────────────────────────────────────────────────────────────┐
-│ MIGRATION TIMELINE │
-└─────────────────────────────────────────────────────────────┘
-
-TODAY (2026) FUTURE (Quantum Computers)
-════════════ ══════════════════════════
-
-Old Browser: PQC-Aware Browser:
-┌────────────┐ ┌────────────┐
-│ Only knows │ │ Checks RSA │
-│ RSA │ │ AND │
-└──────┬─────┘ │ ML-DSA │
- │ └──────┬─────┘
- │ Chimera │
- │ Certificate │
- ▼ ▼
-┌──────────────┐ ┌──────────────┐
-│ Verifies RSA │ │ Verifies RSA │
-│ signature ✓ │ │ signature ✓ │
-│ │ │ │
-│ Ignores │ │ ALSO checks │
-│ ML-DSA │ │ ML-DSA ✓ │
-│ (unknown │ │ │
-│ extension) │ │ Double │
-│ │ │ protected! │
-│ ✓ Works! │ │ ✓ Quantum │
-│ │ │ safe! │
-└──────────────┘ └──────────────┘
-
-ADVANTAGE: One certificate works for everyone!
-----
-
-'''
-
-== Summary: What We've Built
-
-[cols="2,3,1",options="header"]
-|===
-|Component
-|What It Does
-|Quantum Safe?
-
-|**HTTPS Transport**
-|Encrypts connection (Java 17 limitation)
-|⚠️ No (classical crypto)
-
-|**HybridCertificateGenerator**
-|Generates Chimera dual certificates (RSA + ML-DSA-65)
-|✅ Yes
-
-|**HybridPqcX509TrustManager**
-|Delegates chain, trust anchor, expiry and endpoint identification checks to the platform trust manager, then adds the ML-DSA-65 signature check
-|✅ Yes
-
-|**HybridPqcTrustManagerCustomizer**
-|Registers the custom TrustManager with the Vert.x HTTP server, passing it the platform trust manager to delegate to
-|N/A
-
-|**SecurityConfiguration**
-|Registers the BouncyCastle provider and generates the keystores at startup
-|N/A
-
-|**/pqc/secure endpoint**
-|Accessible only with valid hybrid PQC certificates
-|✅ Yes
-|===
-
-**Think of it like this:**
-
-* The **transport tunnel** (HTTPS/TLS) still uses classical encryption (Java 17 limitation)
-* But the **authentication** requires a second, post-quantum signature from the CA, so forging RSA is not enough to be let in
-* The **Chimera certificate** is like a dual-lock ID card: RSA works today, ML-DSA-65 protects against future quantum attacks
-* Only clients with valid hybrid certificates that chain to the trusted CA can access the secure endpoint
-
-**When Java 21+ becomes standard:**
-
-* The transport itself can be upgraded to a post-quantum key exchange (for example ML-KEM)
-* Chimera certificates continue to work, since the PQC data rides in X.509 extensions
-* The custom TrustManager is no longer needed once the TLS stack validates PQC signatures itself
diff --git a/http-pqc-j17/README.adoc b/http-pqc-j17/README.adoc
deleted file mode 100644
index 590606d2..00000000
--- a/http-pqc-j17/README.adoc
+++ /dev/null
@@ -1,228 +0,0 @@
-= HTTP with Post-Quantum Cryptography (PQC): A Camel Quarkus example (Java 17)
-:cq-example-description: An example that shows how to implement quantum-resistant authentication using hybrid certificates that combine RSA with post-quantum ML-DSA-65 signatures on Java 17 using application-level validation
-
-{cq-description}
-
-This example shows how to implement quantum-resistant TLS authentication on **Java 17** by combining classical RSA with post-quantum ML-DSA-65 signatures in X.509 certificates. Both signatures must be valid for authentication to succeed.
-
-IMPORTANT: This example uses **application-level PQC validation** because Java 17 doesn't support PQC in TLS natively. For full PQC TLS support with hybrid cipher suites, use Java 21+ with BouncyCastle JSSE provider.
-
-TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Camel Quarkus User guide] for prerequisites and other general information.
-
-== What is Post-Quantum Cryptography?
-
-Post-Quantum Cryptography (PQC) protects against "harvest now, decrypt later" attacks where adversaries capture encrypted data today to decrypt when quantum computers become available.
-
-=== Java 17 Approach
-
-Since **Java 17 doesn't support PQC algorithms natively in TLS**, this example demonstrates a workaround using:
-
-* **Chimera hybrid certificates**: Combines RSA-2048 + ML-DSA-65 (NIST FIPS 204)
-* **X.509 extensions**: Standard extension OIDs (2.5.29.72-74) for alternative signatures
-* **Application-level validation**: A custom X509ExtendedTrustManager adds an ML-DSA-65 signature check on top of the standard certificate validation performed during the TLS handshake
-* **BouncyCastle**: Provides the ML-DSA-65 post-quantum signature algorithm (JCA provider only)
-
-This approach validates PQC signatures at the application level rather than relying on Java's TLS stack. For native PQC TLS support (hybrid key exchange such as X25519MLKEM768), use Java 21+ with the BouncyCastle JSSE provider.
-
-IMPORTANT: Only the certificate authentication is hybrid here. The connection itself is still protected by classical cryptography, because Java 17 cannot negotiate a post-quantum key exchange. A recorded session remains vulnerable to "harvest now, decrypt later"; see the `http-pqc-j21` example for quantum-safe transport.
-
-NOTE: For detailed diagrams and architecture explanation, see link:PQC-EXPLANATION.adoc[PQC Visual Guide].
-
-== Certificate Generation
-
-A hybrid certificate authority and the certificates it issues are generated on every application startup. No manual steps required.
-
-The CA holds both an RSA and an ML-DSA-65 keypair, and signs every certificate it issues with both. It publishes its ML-DSA-65 public key in its own `subjectAltPublicKeyInfo` extension (OID 2.5.29.72), which is what relying parties use to verify the alternative signature on the certificates it issued.
-
-Generated files in `target/certs/`:
-
-* `server-hybrid-keystore.p12` - Server certificate and key, with the CA certificate in the chain
-* `server-hybrid-truststore.p12` - Trust anchor the server validates client certificates against, holding the CA certificate
-* `client-hybrid-keystore.p12` - Client certificate with PQC (for success test)
-* `client-hybrid-truststore.p12` - Trust anchor clients validate the server against, holding the CA certificate
-* `client-rsa-only-keystore.p12` - Client certificate issued by the same CA but without PQC (for failure test)
-* `ca-cert.pem` - CA certificate in PEM format, for clients that cannot read PKCS12 truststores (for example `curl --cacert`)
-* `client-hybrid-cert.pem` - Client certificate in PEM format (for curl testing)
-* `client-hybrid-key.pem` - Client private key in PEM format (for curl testing)
-
-The server certificate is issued for `CN=localhost` with subject alternative names `DNS:localhost` and `IP:127.0.0.1`, so clients can verify the server identity rather than having to disable verification.
-
-Because the CA certificate is the trust anchor, an attacker who could forge RSA signatures still could not mint a certificate this example accepts: they would also need the CA's ML-DSA-65 private key. That is the property the hybrid certificate is there to provide.
-
-== Prerequisites
-
-* **Java 17** (this example demonstrates Java 17-specific workarounds for PQC; for Java 21+, use native PQC TLS support instead)
-* Maven 3.9.9 or later
-* GraalVM (for native mode only)
-
-== Start in Development Mode
-
-[source,shell]
-----
-mvn clean compile quarkus:dev
-----
-
-The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your workspace. Any modifications in your project will automatically take effect in the running application.
-
-TIP: Please refer to the Development mode section of https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
-
-The application starts on HTTPS port 8443 with mutual TLS (mTLS) enabled. All endpoints require a valid hybrid client certificate with RSA + ML-DSA-65.
-
-Main endpoint:
-
-* `/pqc/secure` - Requires hybrid client certificate validated at TLS layer
-
-NOTE: With `client-auth=required`, the TLS handshake rejects connections without valid hybrid PQC certificates before any application code executes.
-
-=== Manual Testing with Client Certificates
-
-PEM files are automatically generated during application startup in `target/certs/`:
-
-* `client-hybrid-cert.pem` - Hybrid certificate (RSA + ML-DSA-65)
-* `client-hybrid-key.pem` - Private key for hybrid certificate
-* `ca-cert.pem` - CA certificate, used by curl to verify the server
-
-Test with hybrid certificate (should succeed):
-
-[source,shell]
-----
-curl --cert target/certs/client-hybrid-cert.pem \
- --key target/certs/client-hybrid-key.pem \
- --cacert target/certs/ca-cert.pem \
- https://localhost:8443/pqc/secure
-
-✓ Hybrid PQC certificate validated at TLS layer!
-
-Your certificate chained to a configured trust anchor and carried a valid
-ML-DSA-65 alternative signature. Both were checked during the TLS handshake.
-...
-----
-
-Test with the RSA-only certificate. It is issued by the same CA, so it passes chain validation; the handshake fails purely because it carries no ML-DSA-65 alternative signature:
-
-[source,shell]
-----
-curl --cert-type P12 \
- --cert target/certs/client-rsa-only-keystore.p12:changeit \
- --cacert target/certs/ca-cert.pem \
- https://localhost:8443/pqc/secure
-----
-
-curl reports a TLS alert such as `certificate unknown` or `bad certificate`; the exact wording depends on the TLS library it was built against. The application log records the reason the certificate was refused.
-
-== Package and Run the Application
-
-Once you are done with developing you may want to package and run the application.
-
-TIP: Find more details about the JVM mode and Native mode in the Package and run section of https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_the_application[Camel Quarkus User guide]
-
-=== JVM Mode
-
-[source,shell]
-----
-mvn clean package
-java -jar target/quarkus-app/quarkus-run.jar
-...
-[io.quarkus] (main) camel-quarkus-examples-http-pqc started in 1.5s. Listening on: https://0.0.0.0:8443
-----
-
-=== Native Mode
-
-IMPORTANT: Native mode requires having GraalVM and other tools installed. Please check the Prerequisites section of https://camel.apache.org/camel-quarkus/latest/first-steps.html#_prerequisites[Camel Quarkus User guide].
-
-To prepare a native executable using GraalVM, run the following command:
-
-[source,shell]
-----
-mvn clean package -Dnative
-./target/*-runner
-...
-[io.quarkus] (main) camel-quarkus-examples-http-pqc started in 0.015s. Listening on: https://0.0.0.0:8443
-...
-----
-
-== Testing
-
-Run the tests to verify hybrid certificate functionality:
-
-[source,shell]
-----
-mvn clean test
-----
-
-The test suite validates:
-
-* Hybrid keystores are generated automatically
-* `/pqc/secure` rejects requests without client certificates
-* `/pqc/secure` accepts hybrid certificates (RSA + ML-DSA-65)
-* `/pqc/secure` rejects an RSA-only certificate issued by the same CA, where the missing ML-DSA-65 signature is the only fault
-* `/pqc/secure` rejects a self-signed hybrid certificate that no trust anchor vouches for, even though its PQC extensions are valid
-* `/pqc/secure` rejects an expired hybrid certificate
-* The ML-DSA-65 signature check rejects a certificate carrying PQC extensions copied from another certificate
-* The ML-DSA-65 signature check rejects a certificate issued by a different CA, and one whose issuer publishes no PQC public key
-* The trust manager rejects untrusted server certificates as well as client ones, and advertises the configured trust anchors
-
-For native mode testing:
-
-[source,shell]
-----
-mvn clean verify -Dnative
-----
-
-== How It Works (Java 17 Application-Level Validation)
-
-This example works around Java 17's lack of native PQC support by implementing custom certificate validation at the application level, integrated into the TLS handshake via a custom `X509ExtendedTrustManager`.
-
-=== Certificate Structure
-
-Traditional X.509 certificates are extended with three additional fields (Chimera format):
-
-* **OID 2.5.29.72** - Alternative public key (ML-DSA-65)
-* **OID 2.5.29.73** - Alternative signature algorithm identifier
-* **OID 2.5.29.74** - Alternative signature value (ML-DSA-65 signature)
-
-Both RSA and ML-DSA-65 signatures must validate for authentication to succeed.
-
-=== Validation Flow (Application-Level, Not TLS-Native)
-
-1. Client connects with TLS client certificate
-2. Java's TLS stack invokes our custom `HybridPqcX509TrustManager` during handshake
-3. The trust manager delegates to the platform trust manager that Quarkus built from the configured truststore, which performs the standard X.509 checks: chain building, trust anchor lookup and validity period
-4. Only if those pass, `CertificatesUtil.validateHybridCertificate()` adds the post-quantum checks for each certificate in the chain:
- - ML-DSA-65 algorithm OID (2.5.29.73) is present and names ML-DSA-65
- - ML-DSA-65 signature (2.5.29.74) is present
- - The issuer's ML-DSA-65 public key (2.5.29.72) is located, either from the next certificate in the chain or from the trust anchors, matching on the authority key identifier rather than the issuer name alone
- - The signature is verified by BouncyCastle over the whole certificate body, using that issuer key
-5. If all checks pass, TLS handshake continues
-6. If any check fails, TLS handshake is rejected
-
-The verification key deliberately comes from the *issuer*, not from the certificate being checked. Verifying an alternative signature against a key carried by the same certificate authenticates nothing, since whoever produced the certificate chose both. Finding that issuer by distinguished name alone is not enough either: a CA that has rolled its key appears in the truststore twice under one name with two different ML-DSA-65 keys, so the authority key identifier is what tells them apart.
-
-IMPORTANT: The ordering in steps 3 and 4 is the point of this example. Registering a custom trust manager *replaces* the platform one rather than adding to it, because JSSE consults only the trust manager it is given. A custom trust manager that performs its own checks without delegating therefore accepts any certificate that satisfies those checks — including a self-signed one that no trust anchor vouches for. Delegating first, then layering the PQC check on top, is what keeps chain, an [...]
-
-NOTE: `HybridPqcX509TrustManager` extends `X509ExtendedTrustManager`, not `X509TrustManager`. Only the extended interface receives the `Socket` or `SSLEngine` for the connection, and that context is what the platform needs to perform endpoint identification — hostname verification, for a client checking a server. A wrapper implementing the plain interface loses it. JSSE compensates by wrapping such a trust manager in one of its own that performs the check afterwards, so a stack built aro [...]
-
-NOTE: The PQC part of the validation happens at the application level, not within Java's TLS implementation. Java 17's TLS stack only understands the standard RSA certificate; our custom code validates the PQC extensions.
-
-== Important Notes
-
-* **Java 17 Only**: This example is specifically designed for Java 17, which lacks native PQC support in its TLS stack. It demonstrates application-level validation as a workaround. Do not use this approach if you can upgrade to Java 21+.
-
-* **Development Only**: The CA and the certificates it issues are regenerated on every startup, and the CA is self-signed. For production, use persistent certificates from a real CA, and keep the CA's ML-DSA-65 private key protected as carefully as its RSA one — the post-quantum guarantee rests on it.
-
-* **No revocation checking**: This example performs no CRL or OCSP checks. A production deployment needs them.
-
-* **BouncyCastle**: Uses standardized ML-DSA-65 naming per NIST FIPS 204 (effective August 2024). This example uses the JCA provider only, not JSSE. Note that ML-DSA (standardized) and Dilithium (pre-standard) are NOT interoperable.
-
-== Additional Resources
-
-* link:PQC-EXPLANATION.adoc[Visual Guide] - Detailed diagrams and architecture
-* https://csrc.nist.gov/pubs/fips/204/final[NIST FIPS 204 - ML-DSA Standard]
-* https://datatracker.ietf.org/doc/html/draft-ounsworth-pq-composite-sigs[IETF Composite Signatures - Chimera format specification]
-* https://www.bouncycastle.org/[BouncyCastle - PQC provider documentation]
-* https://www.rfc-editor.org/rfc/rfc9881.html[RFC 9881 - Algorithm Identifiers for ML-DSA in X.509]
-* https://www.rfc-editor.org/rfc/rfc9882.html[RFC 9882 - Use of ML-DSA in CMS]
-
-== Feedback and Contributions
-
-For issues or contributions, please submit to the https://github.com/apache/camel-quarkus-examples[Camel Quarkus Examples] repository.
diff --git a/http-pqc-j17/pom.xml b/http-pqc-j17/pom.xml
deleted file mode 100644
index 74095054..00000000
--- a/http-pqc-j17/pom.xml
+++ /dev/null
@@ -1,303 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>camel-quarkus-examples-http-pqc-j17</artifactId>
- <groupId>org.apache.camel.quarkus.examples</groupId>
- <version>4.0.0-SNAPSHOT</version>
-
- <name>Camel Quarkus :: Examples :: HTTP PQC</name>
- <description>Camel Quarkus Example :: HTTP with Post-Quantum Cryptography</description>
-
- <properties>
- <quarkus.platform.version>3.40.1</quarkus.platform.version>
- <camel-quarkus.platform.version>4.0.0-SNAPSHOT</camel-quarkus.platform.version>
-
- <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
- <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
- <camel-quarkus.platform.group-id>org.apache.camel.quarkus</camel-quarkus.platform.group-id>
- <camel-quarkus.platform.artifact-id>camel-quarkus-bom</camel-quarkus.platform.artifact-id>
-
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
-
- <formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
- <impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
- <license-maven-plugin.version>5.1.2</license-maven-plugin.version>
- <maven-compiler-plugin.version>3.16.0</maven-compiler-plugin.version>
- <maven-jar-plugin.version>3.5.1</maven-jar-plugin.version>
- <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
- <maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <!-- Import BOM -->
- <dependency>
- <groupId>${quarkus.platform.group-id}</groupId>
- <artifactId>${quarkus.platform.artifact-id}</artifactId>
- <version>${quarkus.platform.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>${camel-quarkus.platform.group-id}</groupId>
- <artifactId>${camel-quarkus.platform.artifact-id}</artifactId>
- <version>${camel-quarkus.platform.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-log</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-platform-http</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-support-bouncycastle</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-microprofile-health</artifactId>
- </dependency>
-
- <!-- Test -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.rest-assured</groupId>
- <artifactId>rest-assured</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.awaitility</groupId>
- <artifactId>awaitility</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
-
- <plugin>
- <groupId>net.revelc.code.formatter</groupId>
- <artifactId>formatter-maven-plugin</artifactId>
- <version>${formatter-maven-plugin.version}</version>
- <configuration>
- <configFile>${maven.multiModuleProjectDirectory}/eclipse-formatter-config.xml</configFile>
- <lineEnding>LF</lineEnding>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>net.revelc.code</groupId>
- <artifactId>impsort-maven-plugin</artifactId>
- <version>${impsort-maven-plugin.version}</version>
- <configuration>
- <groups>java.,javax.,org.w3c.,org.xml.,junit.</groups>
- <removeUnused>true</removeUnused>
- <staticAfter>true</staticAfter>
- <staticGroups>java.,javax.,org.w3c.,org.xml.,junit.</staticGroups>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${maven-compiler-plugin.version}</version>
- <configuration>
- <showDeprecation>true</showDeprecation>
- <showWarnings>true</showWarnings>
- <compilerArgs>
- <arg>-Xlint:unchecked</arg>
- </compilerArgs>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${maven-surefire-plugin.version}</version>
- <configuration>
- <failIfNoTests>false</failIfNoTests>
- <systemPropertyVariables>
- <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
- </systemPropertyVariables>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>${quarkus.platform.group-id}</groupId>
- <artifactId>quarkus-maven-plugin</artifactId>
- <version>${quarkus.platform.version}</version>
- <extensions>true</extensions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <version>${maven-surefire-plugin.version}</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>${maven-jar-plugin.version}</version>
- </plugin>
-
- <plugin>
- <groupId>com.mycila</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <version>${license-maven-plugin.version}</version>
- <configuration>
- <failIfUnknown>true</failIfUnknown>
- <header>${maven.multiModuleProjectDirectory}/header.txt</header>
- <excludes>
- <exclude>**/*.adoc</exclude>
- <exclude>**/*.txt</exclude>
- <exclude>**/LICENSE.txt</exclude>
- <exclude>**/LICENSE</exclude>
- <exclude>**/NOTICE.txt</exclude>
- <exclude>**/NOTICE</exclude>
- <exclude>**/README</exclude>
- <exclude>**/pom.xml.versionsBackup</exclude>
- <exclude>**/quarkus.log*</exclude>
- <exclude>**/*.p12</exclude>
- </excludes>
- <mapping>
- <java>SLASHSTAR_STYLE</java>
- <properties>CAMEL_PROPERTIES_STYLE</properties>
- <kt>SLASHSTAR_STYLE</kt>
- </mapping>
- <headerDefinitions>
- <headerDefinition>${maven.multiModuleProjectDirectory}/license-properties-headerdefinition.xml</headerDefinition>
- </headerDefinitions>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <groupId>${quarkus.platform.group-id}</groupId>
- <artifactId>quarkus-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>build</id>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>net.revelc.code.formatter</groupId>
- <artifactId>formatter-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>format</id>
- <goals>
- <goal>format</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>net.revelc.code</groupId>
- <artifactId>impsort-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>sort-imports</id>
- <goals>
- <goal>sort</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>com.mycila</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>license-format</id>
- <goals>
- <goal>format</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>native</id>
- <activation>
- <property>
- <name>native</name>
- </property>
- </activation>
- <properties>
- <quarkus.native.enabled>true</quarkus.native.enabled>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <quarkus.native.enabled>${quarkus.native.enabled}</quarkus.native.enabled>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/http-pqc-j17/src/main/java/org/acme/http/pqc/PqcCamelRoute.java b/http-pqc-j17/src/main/java/org/acme/http/pqc/PqcCamelRoute.java
deleted file mode 100644
index ae8fd795..00000000
--- a/http-pqc-j17/src/main/java/org/acme/http/pqc/PqcCamelRoute.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import org.apache.camel.builder.endpoint.EndpointRouteBuilder;
-
-@ApplicationScoped
-public class PqcCamelRoute extends EndpointRouteBuilder {
-
- @Override
- public void configure() throws Exception {
- // Secure endpoint with TLS-layer hybrid PQC certificate validation
- // Note: Certificate validation happens during TLS handshake via custom TrustManager
- // Invalid certificates are rejected before this route executes
- // With client-auth=required, only valid hybrid PQC certificates can reach this endpoint
- from(platformHttp("/pqc/secure"))
- .routeId("pqc-secure-route")
- .log("Processing request with validated hybrid PQC certificate")
- .setBody(constant(
- "✓ Hybrid PQC certificate validated at TLS layer!\n\n" +
- "Your certificate chained to a configured trust anchor and carried a valid\n" +
- "ML-DSA-65 alternative signature. Both were checked during the TLS handshake.\n\n" +
- "This demonstrates TLS-layer validation using a custom trust manager that\n" +
- "adds a post-quantum signature check on top of the standard X.509 checks.\n\n" +
- "Note: the connection itself is protected by classical cryptography. Java 17\n" +
- "cannot negotiate a post-quantum key exchange, so only the certificate\n" +
- "authentication is hybrid here. See http-pqc-j21 for quantum-safe transport.\n"))
- .to(log("pqc-secure").showExchangePattern(false).showBodyType(false));
- }
-}
diff --git a/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/HybridCertificateGenerator.java b/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/HybridCertificateGenerator.java
deleted file mode 100644
index bc32becc..00000000
--- a/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/HybridCertificateGenerator.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc.certificates;
-
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.math.BigInteger;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.KeyStore;
-import java.security.SecureRandom;
-import java.security.cert.X509Certificate;
-import java.util.Date;
-
-import org.acme.http.pqc.crypto.ChimeraOids;
-import org.bouncycastle.asn1.x500.X500Name;
-import org.bouncycastle.asn1.x509.BasicConstraints;
-import org.bouncycastle.asn1.x509.Extension;
-import org.bouncycastle.asn1.x509.GeneralName;
-import org.bouncycastle.asn1.x509.GeneralNames;
-import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
-import org.bouncycastle.cert.X509CertificateHolder;
-import org.bouncycastle.cert.X509v3CertificateBuilder;
-import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
-import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils;
-import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;
-import org.bouncycastle.openssl.jcajce.JcaPEMWriter;
-import org.bouncycastle.operator.ContentSigner;
-import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Generates a small Chimera hybrid certificate hierarchy: a certificate authority holding both an RSA
- * and an ML-DSA-65 keypair, which issues the server and client certificates.
- *
- * <p>
- * Every certificate the CA issues is signed twice. The RSA signature goes in the standard signature
- * field, and the ML-DSA-65 signature goes in the {@code altSignatureValue} extension, produced by
- * BouncyCastle's {@link X509v3CertificateBuilder#build(ContentSigner, boolean, ContentSigner)} which
- * computes it over the {@code TBSCertificate}. Do not hand-roll that signature over a single field
- * such as the subject DN: a signature that does not cover the body proves nothing about the rest of
- * the certificate.
- *
- * <p>
- * The CA publishes its ML-DSA-65 public key in its own {@code subjectAltPublicKeyInfo} extension,
- * which is what relying parties use to verify the alternative signature on the certificates it
- * issued. Because the CA certificate is the trust anchor, an attacker who can forge RSA signatures
- * still cannot mint a certificate that validates: they would also need the CA's ML-DSA-65 private
- * key. That is the property this example exists to demonstrate.
- *
- * <p>
- * Certificates are generated at application startup by {@link SecurityConfiguration}.
- */
-public class HybridCertificateGenerator {
-
- private static final Logger LOG = LoggerFactory.getLogger(HybridCertificateGenerator.class);
-
- // WARNING: This password is hardcoded for DEMONSTRATION purposes only.
- // In production, use environment variables, secrets management, or secure configuration.
- private static final String KEYSTORE_PASSWORD = "changeit";
- private static final String CERT_DIR = "target/certs";
- private static final String CA_DN = "CN=PQC Hybrid CA,O=Apache Camel Quarkus,C=US";
-
- /**
- * A certificate together with the keypairs that belong to its subject. For the CA, the ML-DSA-65
- * keypair is the one used to sign the certificates it issues.
- */
- public static class CertificateData {
- public final KeyPair rsaKeyPair;
- public final KeyPair mlDsaKeyPair;
- public final X509Certificate certificate;
-
- public CertificateData(KeyPair rsaKeyPair, KeyPair mlDsaKeyPair, X509Certificate certificate) {
- this.rsaKeyPair = rsaKeyPair;
- this.mlDsaKeyPair = mlDsaKeyPair;
- this.certificate = certificate;
- }
- }
-
- /**
- * Generates the CA, the certificates it issues, and the keystores and truststores holding them.
- */
- public static void generateKeystores() throws Exception {
- CertificateData ca = generateCertificateAuthority();
- LOG.info("Hybrid CA created: {}", ca.certificate.getSubjectX500Principal());
-
- // The server certificate carries subject alternative names for localhost and 127.0.0.1 so that
- // clients can verify the server identity instead of having to disable verification
- GeneralNames serverAltNames = new GeneralNames(new GeneralName[] {
- new GeneralName(GeneralName.dNSName, "localhost"),
- new GeneralName(GeneralName.iPAddress, "127.0.0.1") });
-
- CertificateData server = issueCertificate(ca, "localhost", true, serverAltNames);
- CertificateData clientHybrid = issueCertificate(ca, "client-hybrid", true, null);
-
- // Issued by the same CA, but without the ML-DSA-65 alternative signature. It therefore passes
- // chain validation and is rejected solely by the post-quantum check.
- CertificateData clientRsaOnly = issueCertificate(ca, "client-rsa-only", false, null);
-
- saveKeyStore(Paths.get(CERT_DIR, "server-hybrid-keystore.p12"), server, ca, "server");
- saveKeyStore(Paths.get(CERT_DIR, "client-hybrid-keystore.p12"), clientHybrid, ca, "client");
- saveKeyStore(Paths.get(CERT_DIR, "client-rsa-only-keystore.p12"), clientRsaOnly, ca, "client");
-
- // Both sides validate the peer's certificate chain against the CA, which is the trust anchor
- saveTrustStore(Paths.get(CERT_DIR, "server-hybrid-truststore.p12"), ca.certificate, "pqc-hybrid-ca");
- saveTrustStore(Paths.get(CERT_DIR, "client-hybrid-truststore.p12"), ca.certificate, "pqc-hybrid-ca");
-
- // PEM files for tools that cannot read PKCS12, such as curl
- savePem(Paths.get(CERT_DIR, "ca-cert.pem"), ca.certificate);
- savePem(Paths.get(CERT_DIR, "client-hybrid-cert.pem"), clientHybrid.certificate);
- savePem(Paths.get(CERT_DIR, "client-hybrid-key.pem"), clientHybrid.rsaKeyPair.getPrivate());
- }
-
- /**
- * Generates the self-signed hybrid certificate authority.
- *
- * <p>
- * The CA publishes its ML-DSA-65 public key in the {@code subjectAltPublicKeyInfo} extension so
- * that verifiers can check the alternative signature on the certificates it issues.
- *
- * @return CertificateData whose keypairs are the CA's signing keys
- */
- public static CertificateData generateCertificateAuthority() throws Exception {
- LOG.debug("Generating hybrid certificate authority");
-
- KeyPair rsaKeyPair = generateRsaKeyPair();
- KeyPair mlDsaKeyPair = generateMlDsaKeyPair();
- X500Name caName = new X500Name(CA_DN);
-
- X509v3CertificateBuilder certBuilder = certificateBuilder(caName, caName, rsaKeyPair.getPublic());
- certBuilder.addExtension(Extension.basicConstraints, true, new BasicConstraints(true));
-
- // The subject key identifier is how relying parties tell two CAs apart when they share a
- // distinguished name, which happens whenever a CA rolls its key
- certBuilder.addExtension(Extension.subjectKeyIdentifier, false,
- new JcaX509ExtensionUtils().createSubjectKeyIdentifier(rsaKeyPair.getPublic()));
-
- // Publish the CA's ML-DSA-65 public key: this is the key that verifies the alternative
- // signature on every certificate the CA issues
- certBuilder.addExtension(ChimeraOids.SUBJECT_ALT_PUBLIC_KEY_INFO, false,
- SubjectPublicKeyInfo.getInstance(mlDsaKeyPair.getPublic().getEncoded()));
-
- // Self-signed with both of its own keys
- X509CertificateHolder certHolder = certBuilder.build(
- rsaSigner(rsaKeyPair), false, mlDsaSigner(mlDsaKeyPair));
-
- return new CertificateData(rsaKeyPair, mlDsaKeyPair, toX509Certificate(certHolder));
- }
-
- /**
- * Issues a certificate signed by the given authority.
- *
- * @param issuer The CA whose RSA and ML-DSA-65 keys sign the certificate
- * @param commonName The CN for the certificate subject
- * @param includeAltSignature Whether to add the CA's ML-DSA-65 alternative signature. Passing
- * {@code false} produces a classical, RSA-only certificate.
- * @param subjectAltNames Subject alternative names to add, or {@code null} for none
- * @return CertificateData holding the subject's own RSA keypair
- */
- public static CertificateData issueCertificate(CertificateData issuer, String commonName,
- boolean includeAltSignature, GeneralNames subjectAltNames) throws Exception {
- LOG.debug("Issuing certificate for CN={}, includeAltSignature={}", commonName, includeAltSignature);
-
- KeyPair rsaKeyPair = generateRsaKeyPair();
-
- X500Name subject = new X500Name("CN=" + commonName + ",O=Apache Camel Quarkus,C=US");
- X500Name issuerName = X500Name.getInstance(issuer.certificate.getSubjectX500Principal().getEncoded());
-
- X509v3CertificateBuilder certBuilder = certificateBuilder(issuerName, subject, rsaKeyPair.getPublic());
- certBuilder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false));
-
- // The authority key identifier names the key that signed this certificate, so a verifier can
- // pick the right issuer instead of guessing from the distinguished name
- JcaX509ExtensionUtils extensionUtils = new JcaX509ExtensionUtils();
- certBuilder.addExtension(Extension.authorityKeyIdentifier, false,
- extensionUtils.createAuthorityKeyIdentifier(issuer.certificate));
- certBuilder.addExtension(Extension.subjectKeyIdentifier, false,
- extensionUtils.createSubjectKeyIdentifier(rsaKeyPair.getPublic()));
-
- if (subjectAltNames != null) {
- certBuilder.addExtension(Extension.subjectAlternativeName, false, subjectAltNames);
- }
-
- X509CertificateHolder certHolder;
- if (includeAltSignature) {
- // BouncyCastle adds the altSignatureAlgorithm and altSignatureValue extensions itself,
- // signing the TBSCertificate with the CA's ML-DSA-65 key so that the signature covers the
- // whole certificate body
- certHolder = certBuilder.build(
- rsaSigner(issuer.rsaKeyPair), false, mlDsaSigner(issuer.mlDsaKeyPair));
- } else {
- certHolder = certBuilder.build(rsaSigner(issuer.rsaKeyPair));
- }
-
- return new CertificateData(rsaKeyPair, null, toX509Certificate(certHolder));
- }
-
- private static X509v3CertificateBuilder certificateBuilder(X500Name issuer, X500Name subject,
- java.security.PublicKey subjectPublicKey) {
- Date notBefore = new Date();
- Date notAfter = new Date(System.currentTimeMillis() + 365L * 24 * 60 * 60 * 1000); // 1 year
-
- return new JcaX509v3CertificateBuilder(
- issuer,
- new BigInteger(64, new SecureRandom()),
- notBefore,
- notAfter,
- subject,
- subjectPublicKey);
- }
-
- private static KeyPair generateRsaKeyPair() throws Exception {
- KeyPairGenerator rsaKpg = KeyPairGenerator.getInstance("RSA");
- rsaKpg.initialize(2048, new SecureRandom());
- return rsaKpg.generateKeyPair();
- }
-
- private static KeyPair generateMlDsaKeyPair() throws Exception {
- // ML-DSA-65 - NIST FIPS 204. Java 17 has no built-in implementation, so BouncyCastle provides it
- return KeyPairGenerator.getInstance("ML-DSA-65", "BC").generateKeyPair();
- }
-
- private static ContentSigner rsaSigner(KeyPair keyPair) throws Exception {
- return new JcaContentSignerBuilder("SHA256withRSA").build(keyPair.getPrivate());
- }
-
- private static ContentSigner mlDsaSigner(KeyPair keyPair) throws Exception {
- return new JcaContentSignerBuilder("ML-DSA-65").setProvider("BC").build(keyPair.getPrivate());
- }
-
- private static X509Certificate toX509Certificate(X509CertificateHolder holder) throws Exception {
- return new JcaX509CertificateConverter().setProvider("BC").getCertificate(holder);
- }
-
- /**
- * Saves a private key with its certificate chain. The CA certificate is included in the chain so
- * that the peer receives the full path during the handshake.
- */
- private static void saveKeyStore(Path path, CertificateData certData, CertificateData ca, String alias)
- throws Exception {
- KeyStore keyStore = KeyStore.getInstance("PKCS12", "BC");
- keyStore.load(null, null);
- keyStore.setKeyEntry(alias,
- certData.rsaKeyPair.getPrivate(),
- KEYSTORE_PASSWORD.toCharArray(),
- new X509Certificate[] { certData.certificate, ca.certificate });
-
- store(keyStore, path);
- LOG.info("Keystore created: {}", path);
- }
-
- private static void saveTrustStore(Path path, X509Certificate cert, String alias) throws Exception {
- KeyStore trustStore = KeyStore.getInstance("PKCS12", "BC");
- trustStore.load(null, null);
- trustStore.setCertificateEntry(alias, cert);
-
- store(trustStore, path);
- LOG.info("Truststore created: {}", path);
- }
-
- /**
- * Saves a KeyStore to disk, overwriting any existing file.
- */
- public static void store(KeyStore keyStore, Path path) throws Exception {
- createParentDirectory(path);
- try (FileOutputStream fos = new FileOutputStream(path.toFile())) {
- keyStore.store(fos, KEYSTORE_PASSWORD.toCharArray());
- }
- }
-
- private static void savePem(Path path, Object object) throws Exception {
- createParentDirectory(path);
- try (FileWriter writer = new FileWriter(path.toFile());
- JcaPEMWriter pemWriter = new JcaPEMWriter(writer)) {
- pemWriter.writeObject(object);
- }
- LOG.info("PEM file created: {}", path);
- }
-
- private static void createParentDirectory(Path path) throws Exception {
- Path dirPath = path.getParent();
- if (!Files.exists(dirPath)) {
- Files.createDirectories(dirPath);
- LOG.info("Created directory: {}", dirPath);
- }
- }
-}
diff --git a/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/SecurityConfiguration.java b/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/SecurityConfiguration.java
deleted file mode 100644
index 2710681e..00000000
--- a/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/SecurityConfiguration.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc.certificates;
-
-import java.security.Security;
-
-import io.quarkus.runtime.StartupEvent;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.enterprise.event.Observes;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@ApplicationScoped
-public class SecurityConfiguration {
-
- private static final Logger LOG = LoggerFactory.getLogger(SecurityConfiguration.class);
-
- void onStart(@Observes StartupEvent ev) {
- // Register BouncyCastle as the first provider to ensure PQC algorithms are available
- Security.insertProviderAt(new BouncyCastleProvider(), 1);
- LOG.info("BouncyCastle provider registered at position 1 for PQC support");
-
- // Generate fresh hybrid PQC keystores on every startup
- generateKeystores();
- }
-
- private void generateKeystores() {
- try {
- LOG.info("Generating fresh hybrid PQC keystores...");
- HybridCertificateGenerator.generateKeystores();
- LOG.info("Hybrid PQC keystores generated successfully");
- } catch (Exception e) {
- LOG.error("Failed to generate hybrid PQC keystores", e);
- throw new RuntimeException("Keystore generation failed", e);
- }
- }
-}
diff --git a/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/util/CertificateValidationException.java b/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/util/CertificateValidationException.java
deleted file mode 100644
index c2015438..00000000
--- a/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/util/CertificateValidationException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc.certificates.util;
-
-import java.security.cert.CertificateException;
-
-/**
- * Exception thrown when hybrid PQC certificate validation fails.
- */
-public class CertificateValidationException extends CertificateException {
-
- public CertificateValidationException(String message) {
- super(message);
- }
-
- public CertificateValidationException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/util/CertificatesUtil.java b/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/util/CertificatesUtil.java
deleted file mode 100644
index 8fe018a3..00000000
--- a/http-pqc-j17/src/main/java/org/acme/http/pqc/certificates/util/CertificatesUtil.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc.certificates.util;
-
-import java.security.cert.X509Certificate;
-
-import org.acme.http.pqc.crypto.ChimeraOids;
-import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
-import org.bouncycastle.asn1.x509.Extension;
-import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
-import org.bouncycastle.cert.X509CertificateHolder;
-import org.bouncycastle.operator.ContentVerifierProvider;
-import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility class for validating the post-quantum half of a Chimera hybrid certificate.
- *
- * <p>
- * This covers <em>only</em> the ML-DSA-65 alternative signature. Chain building, trust anchors and
- * validity periods are the job of the platform trust manager, which
- * {@code org.acme.http.pqc.trustmanager.HybridPqcX509TrustManager} runs first.
- *
- * <p>
- * The alternative signature is verified with the <em>issuer's</em> ML-DSA-65 public key, taken from
- * the issuer's {@code subjectAltPublicKeyInfo} extension. Verifying it against a key carried by the
- * certificate under test would authenticate nothing, since whoever produced the certificate chose
- * that key.
- */
-public final class CertificatesUtil {
-
- private static final Logger LOG = LoggerFactory.getLogger(CertificatesUtil.class);
-
- private CertificatesUtil() {
- throw new AssertionError("Utility class cannot be instantiated");
- }
-
- /**
- * Verifies that a certificate carries a valid ML-DSA-65 alternative signature made by its issuer.
- *
- * @param cert The certificate to validate
- * @param issuer The certificate of the issuing authority, which must
- * publish its ML-DSA-65 public key in
- * {@code subjectAltPublicKeyInfo}
- * @throws CertificateValidationException if the PQC extensions are missing, name a different
- * algorithm, or the alternative signature does not verify
- */
- public static void validateHybridCertificate(X509Certificate cert, X509Certificate issuer)
- throws CertificateValidationException {
- LOG.debug("Validating hybrid certificate for subject: {} issued by: {}",
- cert.getSubjectX500Principal(), issuer.getSubjectX500Principal());
-
- try {
- X509CertificateHolder holder = new X509CertificateHolder(cert.getEncoded());
-
- // Verify the alternative signature algorithm extension exists and is ML-DSA-65
- Extension altSigAlg = holder.getExtension(ChimeraOids.ALT_SIGNATURE_ALGORITHM);
- if (altSigAlg == null) {
- throw new CertificateValidationException(
- "PQC signature algorithm extension missing (OID 2.5.29.73)");
- }
-
- AlgorithmIdentifier algId = AlgorithmIdentifier.getInstance(altSigAlg.getParsedValue());
- if (!ChimeraOids.ML_DSA_65.equals(algId.getAlgorithm())) {
- throw new CertificateValidationException(
- "Expected ML-DSA-65 algorithm OID, found: " + algId.getAlgorithm());
- }
-
- LOG.debug("ML-DSA-65 algorithm OID validated");
-
- if (holder.getExtension(ChimeraOids.ALT_SIGNATURE_VALUE) == null) {
- throw new CertificateValidationException(
- "PQC signature extension missing (OID 2.5.29.74)");
- }
-
- // The verification key comes from the issuer, not from the certificate being checked
- SubjectPublicKeyInfo mlDsaPublicKey = issuerAltPublicKey(issuer);
-
- // isAlternativeSignatureValid checks the signature against the DER-encoded TBSCertificate
- // with the altSignatureValue extension removed, so it covers the whole certificate body
- ContentVerifierProvider verifier = new JcaContentVerifierProviderBuilder()
- .setProvider("BC")
- .build(mlDsaPublicKey);
-
- if (!holder.isAlternativeSignatureValid(verifier)) {
- throw new CertificateValidationException("ML-DSA-65 signature validation failed");
- }
-
- LOG.debug("ML-DSA-65 signature verified - hybrid certificate valid");
-
- } catch (CertificateValidationException e) {
- LOG.warn("Certificate validation failed: {}", e.getMessage());
- throw e;
- } catch (Exception e) {
- String message = "Unexpected error during certificate validation: " + e.getMessage();
- LOG.error(message, e);
- throw new CertificateValidationException(message, e);
- }
- }
-
- /**
- * Extracts the issuer's ML-DSA-65 public key from its {@code subjectAltPublicKeyInfo} extension.
- */
- private static SubjectPublicKeyInfo issuerAltPublicKey(X509Certificate issuer) throws Exception {
- Extension altPublicKey = new X509CertificateHolder(issuer.getEncoded())
- .getExtension(ChimeraOids.SUBJECT_ALT_PUBLIC_KEY_INFO);
-
- if (altPublicKey == null) {
- throw new CertificateValidationException(
- "Issuer " + issuer.getSubjectX500Principal()
- + " publishes no PQC public key (OID 2.5.29.72), so the alternative signature "
- + "cannot be verified");
- }
-
- return SubjectPublicKeyInfo.getInstance(altPublicKey.getParsedValue());
- }
-}
diff --git a/http-pqc-j17/src/main/java/org/acme/http/pqc/crypto/ChimeraOids.java b/http-pqc-j17/src/main/java/org/acme/http/pqc/crypto/ChimeraOids.java
deleted file mode 100644
index 7f058fd0..00000000
--- a/http-pqc-j17/src/main/java/org/acme/http/pqc/crypto/ChimeraOids.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc.crypto;
-
-import org.bouncycastle.asn1.ASN1ObjectIdentifier;
-import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
-import org.bouncycastle.asn1.x509.Extension;
-
-/**
- * X.509 extension OIDs (Object Identifiers) for Chimera hybrid certificate format.
- *
- * <p>
- * OIDs are globally unique identifiers used in X.509 certificates to label specific
- * data fields and extensions. These OIDs enable standard X.509 certificates to carry
- * both classical (RSA) and post-quantum (ML-DSA-65) cryptographic signatures.
- *
- * <h2>Chimera Hybrid Certificate Structure:</h2>
- *
- * <pre>
- * Standard X.509 Certificate:
- * Subject: CN=localhost
- * Public Key: RSA-2048 ← Classical (readable by all TLS stacks)
- * Signature: SHA256withRSA ← Classical signature
- *
- * Extensions:
- * [2.5.29.72] altSubjectPublicKeyInfo: ← ML-DSA-65 public key
- * [2.5.29.73] altSignatureAlgorithm: ← Identifies ML-DSA-65 (2.16.840.1.101.3.4.3.18)
- * [2.5.29.74] altSignatureValue: ← ML-DSA-65 signature
- * </pre>
- *
- * <p>
- * <b>Why this matters:</b> Both signatures must be valid for the certificate to be accepted, so a
- * certificate remains tamper-evident even against an attacker who can forge RSA signatures. Standard
- * TLS stacks that do not understand these extensions still verify the RSA signature as usual, which
- * is what makes the format backward compatible.
- *
- * <p>
- * The constants below simply alias the equivalent BouncyCastle definitions; they exist to gather the
- * relevant references in one place rather than to redefine the OIDs.
- *
- * <h2>OID Hierarchy Explained:</h2>
- * <ul>
- * <li><b>2.5.29.x</b> - X.509 certificate extensions (standardized by ITU-T)
- * <ul>
- * <li>2.5.29.15 - keyUsage (common)</li>
- * <li>2.5.29.17 - subjectAltName (common)</li>
- * <li>2.5.29.72-74 - Chimera hybrid extensions (new for PQC)</li>
- * </ul>
- * </li>
- * <li><b>2.16.840.1.101.3.4.3.18</b> - ML-DSA-65 algorithm (NIST FIPS 204)
- * <ul>
- * <li>2.16.840.1.101.3 - NIST algorithms</li>
- * <li>4.3 - Signature algorithms</li>
- * <li>18 - ML-DSA-65 (Level 3 security)</li>
- * </ul>
- * </li>
- * </ul>
- *
- * @see <a href="https://www.rfc-editor.org/rfc/rfc5280">RFC 5280 - X.509 Certificate Standard</a>
- * @see <a href="https://csrc.nist.gov/pubs/fips/204/final">FIPS 204 - ML-DSA Standard</a>
- */
-public final class ChimeraOids {
-
- /**
- * OID 2.5.29.72 - Alternative Subject Public Key Info extension.
- * Contains the ML-DSA-65 public key in addition to the standard RSA public key.
- *
- * <p>
- * This allows a single certificate to carry two public keys:
- * <ul>
- * <li>Primary: RSA-2048 (in standard subjectPublicKeyInfo field)</li>
- * <li>Alternative: ML-DSA-65 (in this extension)</li>
- * </ul>
- *
- * <p>
- * <b>Official References:</b>
- * <ul>
- * <li><a href="https://datatracker.ietf.org/doc/html/draft-ounsworth-pq-composite-sigs-13#section-6.2">
- * IETF Draft: Composite Signatures - Section 6.2 (altSubjectPublicKeyInfo)</a></li>
- * <li><a href="https://oidref.com/2.5.29.72">OID Repository: 2.5.29.72</a></li>
- * <li><a href="https://www.rfc-editor.org/rfc/rfc5280#section-4.2">
- * RFC 5280 - X.509 Certificate Extensions</a></li>
- * </ul>
- */
- public static final ASN1ObjectIdentifier SUBJECT_ALT_PUBLIC_KEY_INFO = Extension.subjectAltPublicKeyInfo;
-
- /**
- * OID 2.5.29.73 - Alternative Signature Algorithm extension.
- * Identifies which algorithm was used for the alternative signature (ML-DSA-65).
- *
- * <p>
- * Contains the OID {@link #ML_DSA_65} to specify the PQC algorithm used.
- *
- * <p>
- * <b>Official References:</b>
- * <ul>
- * <li><a href="https://datatracker.ietf.org/doc/html/draft-ounsworth-pq-composite-sigs-13#section-6.1">
- * IETF Draft: Composite Signatures - Section 6.1 (altSignatureAlgorithm)</a></li>
- * <li><a href="https://oidref.com/2.5.29.73">OID Repository: 2.5.29.73</a></li>
- * </ul>
- */
- public static final ASN1ObjectIdentifier ALT_SIGNATURE_ALGORITHM = Extension.altSignatureAlgorithm;
-
- /**
- * OID 2.5.29.74 - Alternative Signature Value extension.
- * Contains the actual ML-DSA-65 digital signature bytes.
- *
- * <p>
- * This is the post-quantum signature over the certificate body (the DER-encoded
- * {@code TBSCertificate} with this extension removed), computed with the ML-DSA-65 private key.
- * Because it covers the whole body, it detects tampering with any field of the certificate.
- *
- * <p>
- * <b>Official References:</b>
- * <ul>
- * <li><a href="https://datatracker.ietf.org/doc/html/draft-ounsworth-pq-composite-sigs-13#section-6.3">
- * IETF Draft: Composite Signatures - Section 6.3 (altSignatureValue)</a></li>
- * <li><a href="https://oidref.com/2.5.29.74">OID Repository: 2.5.29.74</a></li>
- * </ul>
- */
- public static final ASN1ObjectIdentifier ALT_SIGNATURE_VALUE = Extension.altSignatureValue;
-
- /**
- * OID 2.16.840.1.101.3.4.3.18 - ML-DSA-65 algorithm identifier (NIST FIPS 204).
- *
- * <p>
- * ML-DSA-65 (Module-Lattice-Based Digital Signature Algorithm, parameter set 65)
- * is a NIST Level 3 post-quantum signature algorithm resistant to attacks from
- * quantum computers. ML-DSA was standardized from CRYSTALS-Dilithium.
- *
- * <p>
- * <b>Security level:</b> NIST Level 3, equivalent to AES-192 (192-bit security)
- * <br>
- * <b>Signature size:</b> ~3,309 bytes (much larger than RSA-2048's ~256 bytes)
- * <br>
- * <b>Public key size:</b> ~1,952 bytes
- *
- * <p>
- * <b>NOTE:</b> ML-DSA (standardized) and Dilithium (pre-standard) are NOT interoperable.
- * This OID represents the final NIST FIPS 204 standardized version.
- *
- * <p>
- * <b>Official References:</b>
- * <ul>
- * <li><a href="https://csrc.nist.gov/pubs/fips/204/final">
- * NIST FIPS 204 - Module-Lattice-Based Digital Signature Standard (ML-DSA)</a></li>
- * <li><a href="https://datatracker.ietf.org/doc/rfc9881/">
- * RFC 9881 - Algorithm Identifiers for ML-DSA in X.509</a></li>
- * <li><a href="https://oidref.com/2.16.840.1.101.3.4.3.18">
- * OID Repository: 2.16.840.1.101.3.4.3.18</a></li>
- * <li><a href=
- * "https://github.com/bcgit/bc-java/blob/main/core/src/main/java/org/bouncycastle/asn1/nist/NISTObjectIdentifiers.java">
- * BouncyCastle Source: NIST ML-DSA OID definitions</a></li>
- * </ul>
- */
- public static final ASN1ObjectIdentifier ML_DSA_65 = NISTObjectIdentifiers.id_ml_dsa_65;
-
- private ChimeraOids() {
- throw new AssertionError("Constants class cannot be instantiated");
- }
-}
diff --git a/http-pqc-j17/src/main/java/org/acme/http/pqc/trustmanager/HybridPqcTrustManagerCustomizer.java b/http-pqc-j17/src/main/java/org/acme/http/pqc/trustmanager/HybridPqcTrustManagerCustomizer.java
deleted file mode 100644
index 343b7111..00000000
--- a/http-pqc-j17/src/main/java/org/acme/http/pqc/trustmanager/HybridPqcTrustManagerCustomizer.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc.trustmanager;
-
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.X509ExtendedTrustManager;
-
-import io.quarkus.vertx.http.HttpServerOptionsCustomizer;
-import io.vertx.core.Vertx;
-import io.vertx.core.http.HttpServerOptions;
-import io.vertx.core.net.TrustOptions;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Quarkus CDI bean that customizes the Vert.x HTTP server to use a custom TrustManager.
- *
- * <p>
- * Setting trust options replaces whatever the server would otherwise have used, so the trust manager
- * Quarkus built from {@code quarkus.http.ssl.certificate.trust-store-file} is taken out of the
- * handshake. To keep the standard chain and expiry checks, that trust manager is retrieved here and
- * passed to {@link HybridPqcX509TrustManager} as its delegate rather than being discarded.
- */
-@ApplicationScoped
-public class HybridPqcTrustManagerCustomizer implements HttpServerOptionsCustomizer {
-
- private static final Logger LOG = LoggerFactory.getLogger(HybridPqcTrustManagerCustomizer.class);
-
- @Inject
- Vertx vertx;
-
- @Override
- public void customizeHttpsServer(HttpServerOptions options) {
- LOG.info("Registering custom hybrid PQC TrustManager for TLS-layer validation...");
-
- X509ExtendedTrustManager platformTrustManager = platformTrustManager(options);
- X509ExtendedTrustManager customTrustManager = new HybridPqcX509TrustManager(platformTrustManager);
-
- // Wrap the trust manager into Vert.x TrustOptions and register it with the HTTP server
- options.setTrustOptions(TrustOptions.wrap(customTrustManager));
-
- LOG.info("Custom hybrid PQC TrustManager registered successfully");
- LOG.info(" Client certificates must chain to a configured trust anchor and carry a valid ML-DSA-65 signature");
- }
-
- /**
- * Returns the trust manager Quarkus built from the configured truststore, which performs the
- * standard chain, trust anchor and validity-period checks.
- *
- * <p>
- * An {@link X509ExtendedTrustManager} is required rather than a plain
- * {@link javax.net.ssl.X509TrustManager}, because only the extended interface can be handed the
- * {@code Socket} or {@code SSLEngine} that endpoint identification needs. Every JDK provider has
- * returned the extended form since Java 7, so failing here means something unusual is in play and
- * is better than quietly wrapping a trust manager that cannot verify hostnames.
- */
- private X509ExtendedTrustManager platformTrustManager(HttpServerOptions options) {
- TrustOptions trustOptions = options.getTrustOptions();
- if (trustOptions == null) {
- // Without a truststore there is nothing to validate certificate chains against. Failing
- // here is deliberate: continuing would leave the PQC check as the only barrier, and that
- // check cannot establish trust on its own.
- throw new IllegalStateException(
- "No truststore configured. Set quarkus.http.ssl.certificate.trust-store-file so that "
- + "client certificate chains can be validated against a trust anchor.");
- }
-
- try {
- TrustManagerFactory trustManagerFactory = trustOptions.getTrustManagerFactory(vertx);
- for (TrustManager trustManager : trustManagerFactory.getTrustManagers()) {
- if (trustManager instanceof X509ExtendedTrustManager) {
- return (X509ExtendedTrustManager) trustManager;
- }
- }
- } catch (Exception e) {
- throw new IllegalStateException("Could not obtain a trust manager from the configured truststore", e);
- }
-
- throw new IllegalStateException("The configured truststore yielded no X509ExtendedTrustManager");
- }
-}
diff --git a/http-pqc-j17/src/main/java/org/acme/http/pqc/trustmanager/HybridPqcX509TrustManager.java b/http-pqc-j17/src/main/java/org/acme/http/pqc/trustmanager/HybridPqcX509TrustManager.java
deleted file mode 100644
index 64f75a76..00000000
--- a/http-pqc-j17/src/main/java/org/acme/http/pqc/trustmanager/HybridPqcX509TrustManager.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc.trustmanager;
-
-import java.net.Socket;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.Arrays;
-import java.util.Objects;
-
-import javax.net.ssl.SSLEngine;
-import javax.net.ssl.X509ExtendedTrustManager;
-import javax.security.auth.x500.X500Principal;
-
-import org.acme.http.pqc.certificates.util.CertificateValidationException;
-import org.acme.http.pqc.certificates.util.CertificatesUtil;
-import org.bouncycastle.asn1.ASN1OctetString;
-import org.bouncycastle.asn1.x509.AuthorityKeyIdentifier;
-import org.bouncycastle.asn1.x509.Extension;
-import org.bouncycastle.asn1.x509.SubjectKeyIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Custom {@link X509ExtendedTrustManager} that adds hybrid PQC validation on top of the standard
- * checks.
- *
- * <p>
- * The important part of this class is what it does <em>not</em> do itself. Chain building, trust
- * anchor lookup and validity-period checking are delegated to the platform trust manager that
- * Quarkus builds from the configured truststore; only once that has passed is the ML-DSA-65
- * alternative signature verified on top. Getting this ordering wrong is the classic way to write a
- * trust manager that accepts anything: a custom check on its own replaces the platform checks rather
- * than adding to them, because the JSSE handshake asks this class and nothing else.
- *
- * <p>
- * The effect is that a client certificate must chain to a trust anchor, be inside its validity
- * period, <em>and</em> carry a valid ML-DSA-65 alternative signature made by its issuer. A
- * self-signed certificate carrying well-formed PQC extensions is rejected, because no anchor vouches
- * for it, and a certificate issued by the trusted CA without an alternative signature is rejected
- * too.
- *
- * <p>
- * {@link X509ExtendedTrustManager} is extended rather than {@link javax.net.ssl.X509TrustManager}
- * implemented, so that the {@code Socket} and {@code SSLEngine} overloads are delegated as well.
- * Those carry the connection context the platform needs for endpoint identification, which is how
- * hostname verification happens on the client side. A plain {@code X509TrustManager} only gets the
- * two-argument methods, so a wrapper that implements it silently drops hostname verification for any
- * TLS stack that does not apply the JSSE wrapper that would otherwise compensate.
- *
- * <p>
- * Note that this example has no revocation checking (no CRL or OCSP), which a production deployment
- * would need.
- */
-public class HybridPqcX509TrustManager extends X509ExtendedTrustManager {
-
- private static final Logger LOG = LoggerFactory.getLogger(HybridPqcX509TrustManager.class);
-
- private final X509ExtendedTrustManager delegate;
-
- /**
- * @param delegate the platform trust manager to perform chain, anchor, expiry and endpoint
- * identification checks
- */
- public HybridPqcX509TrustManager(X509ExtendedTrustManager delegate) {
- this.delegate = Objects.requireNonNull(delegate, "delegate trust manager is required");
- }
-
- @Override
- public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
- requireChain(chain, "Client");
-
- // Standard X.509 validation first: chain, trust anchor, validity period
- delegate.checkClientTrusted(chain, authType);
-
- validateHybridChain(chain, "Client");
- }
-
- @Override
- public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket)
- throws CertificateException {
- requireChain(chain, "Client");
- delegate.checkClientTrusted(chain, authType, socket);
- validateHybridChain(chain, "Client");
- }
-
- @Override
- public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine)
- throws CertificateException {
- requireChain(chain, "Client");
- delegate.checkClientTrusted(chain, authType, engine);
- validateHybridChain(chain, "Client");
- }
-
- @Override
- public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
- requireChain(chain, "Server");
-
- // Standard X.509 validation first: chain, trust anchor, validity period
- delegate.checkServerTrusted(chain, authType);
-
- validateHybridChain(chain, "Server");
- }
-
- /**
- * The {@code Socket} and {@code SSLEngine} overloads are what let the delegate perform endpoint
- * identification, so they must be passed through rather than being redirected to the two-argument
- * method.
- */
- @Override
- public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket)
- throws CertificateException {
- requireChain(chain, "Server");
- delegate.checkServerTrusted(chain, authType, socket);
- validateHybridChain(chain, "Server");
- }
-
- @Override
- public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine)
- throws CertificateException {
- requireChain(chain, "Server");
- delegate.checkServerTrusted(chain, authType, engine);
- validateHybridChain(chain, "Server");
- }
-
- @Override
- public X509Certificate[] getAcceptedIssuers() {
- // Delegate, so that the certificate authorities advertised during the handshake are the ones
- // in the configured truststore. Returning an empty array here tells peers nothing about which
- // issuers are acceptable.
- return delegate.getAcceptedIssuers();
- }
-
- private static void requireChain(X509Certificate[] chain, String peer) throws CertificateException {
- if (chain == null || chain.length == 0) {
- throw new CertificateException(peer + " certificate chain is empty");
- }
- }
-
- /**
- * Verifies the ML-DSA-65 alternative signature on every certificate in the chain, each against the
- * ML-DSA-65 public key published by its issuer.
- */
- private void validateHybridChain(X509Certificate[] chain, String peer) throws CertificateException {
- for (X509Certificate cert : chain) {
- LOG.debug("Validating {} certificate hybrid PQC extensions: {}", peer, cert.getSubjectX500Principal());
-
- X509Certificate issuer = findIssuer(cert, chain);
- if (issuer == null) {
- throw new CertificateException("Could not find the issuer of " + cert.getSubjectX500Principal()
- + ", so its ML-DSA-65 signature cannot be verified");
- }
-
- try {
- CertificatesUtil.validateHybridCertificate(cert, issuer);
- } catch (CertificateValidationException e) {
- LOG.error("Hybrid PQC certificate validation failed: {}", e.getMessage());
- throw new CertificateException("Validation failed: " + e.getMessage(), e);
- }
- }
-
- LOG.debug("{} certificate chain validated successfully (RSA chain + ML-DSA-65)", peer);
- }
-
- /**
- * Finds the certificate that issued {@code cert}, looking in the chain the peer presented and then
- * among the configured trust anchors. Peers may send only their own certificate and leave the anchor
- * to the relying party, or send the anchor along with it, so both need checking.
- *
- * <p>
- * Candidates matching on key identifier are preferred to candidates matching on the issuer name
- * alone, because the name is the weaker claim and anything the peer sends can carry one. The chain
- * has already been validated by the delegate at this point, so a certificate found in it is one the
- * platform trust manager accepted as part of a path to an anchor — but not necessarily one it built
- * the path <em>through</em>, since it ignores any certificate that does not belong there.
- */
- private X509Certificate findIssuer(X509Certificate cert, X509Certificate[] chain) {
- X509Certificate[] anchors = delegate.getAcceptedIssuers();
-
- // Key identifiers first, so that a candidate which merely shares the issuer name cannot
- // displace the one the platform actually built the path through
- X509Certificate issuer = findIssuerAmong(cert, chain, anchors, true);
- if (issuer != null) {
- return issuer;
- }
-
- // A self-issued certificate is its own issuer. Trust anchors carry no authority key
- // identifier to match on, so without this the name fallback below would settle for any
- // same-DN sibling, and a rolled-over CA has one of those in the truststore by definition
- if (isSelfIssued(cert)) {
- return cert;
- }
-
- return findIssuerAmong(cert, chain, anchors, false);
- }
-
- private static X509Certificate findIssuerAmong(X509Certificate cert, X509Certificate[] chain,
- X509Certificate[] anchors, boolean requireKeyIdentifier) {
- for (X509Certificate candidate : chain) {
- if (candidate != cert && isIssuerOf(candidate, cert, requireKeyIdentifier)) {
- return candidate;
- }
- }
-
- for (X509Certificate anchor : anchors) {
- if (isIssuerOf(anchor, cert, requireKeyIdentifier)) {
- return anchor;
- }
- }
-
- return null;
- }
-
- /**
- * Decides whether {@code candidate} is the issuer of {@code cert}. Both the authority key
- * identifier and the issuer name must match when {@code requireKeyIdentifier} is set; otherwise the
- * name alone is enough.
- *
- * <p>
- * Matching on the name alone is not enough on its own. Distinguished names are not unique over time
- * or across a federation: a CA that has rolled its key is present in the truststore twice under one
- * DN with two different ML-DSA-65 keys, and cross-certified CAs share a DN by design. Picking the
- * wrong one makes this class reject a certificate the platform trust manager just accepted. Matching
- * the authority key identifier against the candidate's subject key identifier, as the platform does
- * when it builds the path, keeps the two in step. The name-only pass exists for certificates that
- * predate the extensions, RFC 5280 requiring neither of them on a self-signed anchor.
- */
- private static boolean isIssuerOf(X509Certificate candidate, X509Certificate cert,
- boolean requireKeyIdentifier) {
- X500Principal issuerName = cert.getIssuerX500Principal();
- if (!candidate.getSubjectX500Principal().equals(issuerName)) {
- return false;
- }
-
- if (!requireKeyIdentifier) {
- return true;
- }
-
- try {
- byte[] authorityKeyId = authorityKeyIdentifier(cert);
- byte[] subjectKeyId = subjectKeyIdentifier(candidate);
-
- return authorityKeyId != null && subjectKeyId != null && Arrays.equals(authorityKeyId, subjectKeyId);
- } catch (IllegalArgumentException e) {
- // Anything a peer sends can be malformed. A key identifier that cannot be read is treated
- // as one that is not there, leaving the issuer name as the only thing left to match on
- LOG.debug("Ignoring unparseable key identifier extension: {}", e.getMessage());
- return false;
- }
- }
-
- private static boolean isSelfIssued(X509Certificate cert) {
- return cert.getSubjectX500Principal().equals(cert.getIssuerX500Principal());
- }
-
- private static byte[] authorityKeyIdentifier(X509Certificate cert) {
- byte[] encoded = cert.getExtensionValue(Extension.authorityKeyIdentifier.getId());
- return encoded == null
- ? null
- : AuthorityKeyIdentifier.getInstance(unwrap(encoded)).getKeyIdentifier();
- }
-
- private static byte[] subjectKeyIdentifier(X509Certificate cert) {
- byte[] encoded = cert.getExtensionValue(Extension.subjectKeyIdentifier.getId());
- return encoded == null
- ? null
- : SubjectKeyIdentifier.getInstance(unwrap(encoded)).getKeyIdentifier();
- }
-
- /**
- * {@link X509Certificate#getExtensionValue(String)} returns the extension wrapped in a DER octet
- * string, which has to be unwrapped before the value inside can be parsed.
- */
- private static byte[] unwrap(byte[] encoded) {
- return ASN1OctetString.getInstance(encoded).getOctets();
- }
-}
diff --git a/http-pqc-j17/src/main/resources/application.properties b/http-pqc-j17/src/main/resources/application.properties
deleted file mode 100644
index cf7f5efd..00000000
--- a/http-pqc-j17/src/main/resources/application.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-#
-# Quarkus
-#
-quarkus.banner.enabled = false
-quarkus.log.file.enabled = true
-
-# HTTPS Configuration with Hybrid PQC Certificates
-quarkus.http.ssl-port = 8443
-quarkus.http.insecure-requests = disabled
-
-# Server uses hybrid certificate (RSA + ML-DSA-65)
-quarkus.http.ssl.certificate.key-store-file = target/certs/server-hybrid-keystore.p12
-quarkus.http.ssl.certificate.key-store-password = changeit
-quarkus.http.ssl.certificate.key-store-file-type = PKCS12
-
-# Require client certificates (validated by custom TrustManager)
-# Certificates must be valid hybrid PQC certificates (RSA + ML-DSA-65)
-quarkus.http.ssl.client-auth = required
-
-# Trust anchors for client certificate validation. HybridPqcTrustManagerCustomizer passes the trust
-# manager built from this truststore to the custom TrustManager as its delegate, so these anchors are
-# what client certificate chains are validated against.
-quarkus.http.ssl.certificate.trust-store-file = target/certs/server-hybrid-truststore.p12
-quarkus.http.ssl.certificate.trust-store-password = changeit
-quarkus.http.ssl.certificate.trust-store-file-type = PKCS12
-
-#
-# Quarkus - Camel
-#
-quarkus.camel.health.enabled = true
-
-#
-# Camel
-#
-camel.context.name = quarkus-camel-example-http-pqc
diff --git a/http-pqc-j17/src/test/java/org/acme/http/pqc/CertificatesUtilTest.java b/http-pqc-j17/src/test/java/org/acme/http/pqc/CertificatesUtilTest.java
deleted file mode 100644
index c617dbe9..00000000
--- a/http-pqc-j17/src/test/java/org/acme/http/pqc/CertificatesUtilTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc;
-
-import java.security.Security;
-import java.security.cert.X509Certificate;
-
-import org.acme.http.pqc.certificates.HybridCertificateGenerator;
-import org.acme.http.pqc.certificates.HybridCertificateGenerator.CertificateData;
-import org.acme.http.pqc.certificates.util.CertificateValidationException;
-import org.acme.http.pqc.certificates.util.CertificatesUtil;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-/**
- * Tests the ML-DSA-65 half of the validation in isolation.
- *
- * <p>
- * Some of these cases cannot be reached through the TLS handshake: the standard chain validation that
- * {@code HybridPqcX509TrustManager} runs first rejects an untrusted certificate before the PQC check
- * is consulted, so an end-to-end test would pass even if this check were broken.
- */
-public class CertificatesUtilTest {
-
- private static CertificateData ca;
- private static X509Certificate leaf;
-
- @BeforeAll
- public static void setUpClass() throws Exception {
- if (Security.getProvider("BC") == null) {
- Security.insertProviderAt(new BouncyCastleProvider(), 1);
- }
-
- ca = HybridCertificateGenerator.generateCertificateAuthority();
- leaf = HybridCertificateGenerator.issueCertificate(ca, "unit-test-leaf", true, null).certificate;
- }
-
- @Test
- public void certificateIssuedByTheCaIsAccepted() {
- assertDoesNotThrow(() -> CertificatesUtil.validateHybridCertificate(leaf, ca.certificate));
- }
-
- @Test
- public void selfSignedCaIsAcceptedAgainstItself() {
- assertDoesNotThrow(() -> CertificatesUtil.validateHybridCertificate(ca.certificate, ca.certificate));
- }
-
- @Test
- public void certificateWithoutAltSignatureIsRejected() throws Exception {
- X509Certificate rsaOnly = HybridCertificateGenerator
- .issueCertificate(ca, "unit-test-rsa-only", false, null).certificate;
-
- CertificateValidationException e = assertThrows(CertificateValidationException.class,
- () -> CertificatesUtil.validateHybridCertificate(rsaOnly, ca.certificate));
- assertTrue(e.getMessage().contains("2.5.29.73"), "Unexpected message: " + e.getMessage());
- }
-
- /**
- * The signature must be verified with the issuer's key, so a certificate issued by one CA must not
- * validate against another.
- */
- @Test
- public void certificateFromAnotherCaIsRejected() throws Exception {
- CertificateData otherCa = HybridCertificateGenerator.generateCertificateAuthority();
-
- CertificateValidationException e = assertThrows(CertificateValidationException.class,
- () -> CertificatesUtil.validateHybridCertificate(leaf, otherCa.certificate));
- assertEquals("ML-DSA-65 signature validation failed", e.getMessage());
- }
-
- /**
- * The alternative signature must cover the certificate body, so copying the PQC extensions onto a
- * different certificate must not produce one that validates. A signature computed over only the
- * subject DN would pass this, because the DN is copied along with the extensions.
- */
- @Test
- public void certificateWithLiftedExtensionsIsRejected() throws Exception {
- X509Certificate forged = ForgedCertificates.withLiftedExtensions(leaf).certificate;
-
- assertEquals(leaf.getSubjectX500Principal(), forged.getSubjectX500Principal(),
- "The forgery should reuse the victim's subject DN");
-
- CertificateValidationException e = assertThrows(CertificateValidationException.class,
- () -> CertificatesUtil.validateHybridCertificate(forged, ca.certificate));
- assertEquals("ML-DSA-65 signature validation failed", e.getMessage());
- }
-
- /**
- * Without the issuer's published ML-DSA-65 key there is nothing to verify against, so validation
- * must fail rather than skip the check.
- */
- @Test
- public void issuerWithoutPublishedAltKeyIsRejected() throws Exception {
- X509Certificate issuerWithoutAltKey = HybridCertificateGenerator
- .issueCertificate(ca, "unit-test-no-alt-key", true, null).certificate;
-
- CertificateValidationException e = assertThrows(CertificateValidationException.class,
- () -> CertificatesUtil.validateHybridCertificate(leaf, issuerWithoutAltKey));
- assertTrue(e.getMessage().contains("2.5.29.72"), "Unexpected message: " + e.getMessage());
- }
-}
diff --git a/http-pqc-j17/src/test/java/org/acme/http/pqc/ForgedCertificates.java b/http-pqc-j17/src/test/java/org/acme/http/pqc/ForgedCertificates.java
deleted file mode 100644
index a74feb43..00000000
--- a/http-pqc-j17/src/test/java/org/acme/http/pqc/ForgedCertificates.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc;
-
-import java.io.FileOutputStream;
-import java.math.BigInteger;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.KeyStore;
-import java.security.SecureRandom;
-import java.security.cert.X509Certificate;
-import java.util.Date;
-
-import org.acme.http.pqc.crypto.ChimeraOids;
-import org.bouncycastle.asn1.ASN1ObjectIdentifier;
-import org.bouncycastle.asn1.ASN1OctetString;
-import org.bouncycastle.asn1.ASN1Primitive;
-import org.bouncycastle.asn1.DEROctetString;
-import org.bouncycastle.asn1.x500.X500Name;
-import org.bouncycastle.asn1.x509.BasicConstraints;
-import org.bouncycastle.asn1.x509.Extension;
-import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
-import org.bouncycastle.cert.X509CertificateHolder;
-import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
-import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;
-import org.bouncycastle.operator.ContentSigner;
-import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
-
-/**
- * Builds certificates that a reader might expect to be accepted but that must be rejected.
- * Used by {@link HttpPqcTest} and {@link CertificatesUtilTest}.
- */
-public final class ForgedCertificates {
-
- private static final String PASSWORD = "changeit";
- private static final String CERT_DIR = "target/certs";
-
- private ForgedCertificates() {
- }
-
- /**
- * A certificate and the private key needed to present it during a TLS handshake.
- */
- public static class Forged {
- public final KeyPair rsaKeyPair;
- public final X509Certificate certificate;
-
- Forged(KeyPair rsaKeyPair, X509Certificate certificate) {
- this.rsaKeyPair = rsaKeyPair;
- this.certificate = certificate;
- }
- }
-
- /**
- * A self-signed hybrid certificate with a correct, freshly generated ML-DSA-65 alternative
- * signature. Everything about it is well formed; it simply is not in the server truststore.
- */
- public static Forged rogueHybrid() throws Exception {
- return forge(new X500Name("CN=attacker,O=Evil Corp,C=XX"), 0, null);
- }
-
- /**
- * A hybrid certificate whose validity period ended a year ago.
- */
- public static Forged expiredHybrid() throws Exception {
- return forge(new X500Name("CN=expired,O=Evil Corp,C=XX"), -730, null);
- }
-
- /**
- * A certificate built on a freshly generated RSA key, carrying the PQC extensions copied verbatim
- * off {@code victim} along with its subject DN. This is the forgery that succeeds when the
- * alternative signature covers only the subject DN instead of the certificate body: the forger
- * never holds the ML-DSA-65 private key that produced the copied signature.
- *
- * <p>
- * The result is self-signed, so at TLS level it is rejected for lacking a trust anchor. Use it
- * against {@code CertificatesUtil} directly to exercise the signature check itself.
- */
- public static Forged withLiftedExtensions(X509Certificate victim) throws Exception {
- // Rebuild the DN from its DER encoding so the bytes are identical to the victim's
- X500Name victimDn = X500Name.getInstance(victim.getSubjectX500Principal().getEncoded());
- return forge(victimDn, 0, victim);
- }
-
- /**
- * Writes a certificate and its key to a PKCS12 keystore that a client can present.
- */
- public static Path keystore(String alias, Forged forged) throws Exception {
- Path path = Paths.get(CERT_DIR, alias + "-keystore.p12");
- KeyStore keyStore = KeyStore.getInstance("PKCS12");
- keyStore.load(null, null);
- keyStore.setKeyEntry(alias, forged.rsaKeyPair.getPrivate(), PASSWORD.toCharArray(),
- new X509Certificate[] { forged.certificate });
- try (FileOutputStream fos = new FileOutputStream(path.toFile())) {
- keyStore.store(fos, PASSWORD.toCharArray());
- }
- return path;
- }
-
- private static Forged forge(X500Name name, int dayOffset, X509Certificate liftFrom) throws Exception {
- KeyPairGenerator rsaKpg = KeyPairGenerator.getInstance("RSA");
- rsaKpg.initialize(2048, new SecureRandom());
- KeyPair rsa = rsaKpg.generateKeyPair();
-
- long day = 24L * 60 * 60 * 1000;
- long start = System.currentTimeMillis() + dayOffset * day;
-
- JcaX509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(
- name,
- new BigInteger(64, new SecureRandom()),
- new Date(start),
- new Date(start + 365 * day),
- name,
- rsa.getPublic());
- builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(false));
-
- ContentSigner rsaSigner = new JcaContentSignerBuilder("SHA256withRSA").build(rsa.getPrivate());
- X509CertificateHolder holder;
-
- if (liftFrom != null) {
- // A certificate issued by a CA carries no subjectAltPublicKeyInfo of its own, so only copy
- // the extensions that are actually present
- copyExtensionIfPresent(builder, liftFrom, ChimeraOids.SUBJECT_ALT_PUBLIC_KEY_INFO);
- copyExtensionIfPresent(builder, liftFrom, ChimeraOids.ALT_SIGNATURE_ALGORITHM);
- copyExtensionIfPresent(builder, liftFrom, ChimeraOids.ALT_SIGNATURE_VALUE);
- holder = builder.build(rsaSigner);
- } else {
- KeyPair mlDsa = KeyPairGenerator.getInstance("ML-DSA-65", "BC").generateKeyPair();
- builder.addExtension(ChimeraOids.SUBJECT_ALT_PUBLIC_KEY_INFO, false,
- SubjectPublicKeyInfo.getInstance(mlDsa.getPublic().getEncoded()));
- ContentSigner mlDsaSigner = new JcaContentSignerBuilder("ML-DSA-65")
- .setProvider("BC")
- .build(mlDsa.getPrivate());
- holder = builder.build(rsaSigner, false, mlDsaSigner);
- }
-
- X509Certificate certificate = new JcaX509CertificateConverter()
- .setProvider("BC")
- .getCertificate(holder);
-
- return new Forged(rsa, certificate);
- }
-
- private static void copyExtensionIfPresent(JcaX509v3CertificateBuilder builder, X509Certificate from,
- ASN1ObjectIdentifier oid) throws Exception {
- byte[] wrapped = from.getExtensionValue(oid.getId());
- if (wrapped == null) {
- return;
- }
- byte[] inner = ((ASN1OctetString) ASN1Primitive.fromByteArray(wrapped)).getOctets();
- builder.addExtension(new Extension(oid, false, new DEROctetString(inner)));
- }
-}
diff --git a/http-pqc-j17/src/test/java/org/acme/http/pqc/HttpPqcIT.java b/http-pqc-j17/src/test/java/org/acme/http/pqc/HttpPqcIT.java
deleted file mode 100644
index 232ace0a..00000000
--- a/http-pqc-j17/src/test/java/org/acme/http/pqc/HttpPqcIT.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc;
-
-import io.quarkus.test.junit.QuarkusIntegrationTest;
-
-@QuarkusIntegrationTest
-public class HttpPqcIT extends HttpPqcTest {
-}
diff --git a/http-pqc-j17/src/test/java/org/acme/http/pqc/HttpPqcTest.java b/http-pqc-j17/src/test/java/org/acme/http/pqc/HttpPqcTest.java
deleted file mode 100644
index 35c60127..00000000
--- a/http-pqc-j17/src/test/java/org/acme/http/pqc/HttpPqcTest.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc;
-
-import java.io.IOException;
-import java.nio.file.Path;
-import java.security.Security;
-
-import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.RestAssured;
-import io.restassured.config.RestAssuredConfig;
-import io.restassured.config.SSLConfig;
-import io.restassured.specification.RequestSpecification;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.eclipse.microprofile.config.ConfigProvider;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.hamcrest.Matchers.containsString;
-import static org.junit.jupiter.api.Assertions.assertInstanceOf;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
-@QuarkusTest
-public class HttpPqcTest {
-
- private static final Logger log = LoggerFactory.getLogger(HttpPqcTest.class);
- private static final String PASSWORD = "changeit";
- private static final String CERT_DIR = "target/certs";
-
- @BeforeAll
- public static void setUpClass() {
- // Needed to build the deliberately invalid certificates used by the rejection tests
- if (Security.getProvider("BC") == null) {
- Security.insertProviderAt(new BouncyCastleProvider(), 1);
- }
- }
-
- @BeforeEach
- public void setUp() {
- // Configure base URI and port for each test
- // Read the port dynamically from config - works in both JVM and native tests
- int sslPort = ConfigProvider.getConfig()
- .getValue("quarkus.http.test-ssl-port", Integer.class);
- RestAssured.baseURI = "https://localhost";
- RestAssured.port = sslPort;
- }
-
- @Test
- public void testPqcSecureEndpointWithoutClientCert() {
- // With client-auth=required, TLS handshake fails before reaching the route
- assertRejected(withTrustStore(SSLConfig.sslConfig()), "no client certificate");
- }
-
- @Test
- public void testPqcSecureEndpointWithValidClientCert() {
- // Test /pqc/secure WITH valid hybrid client certificate. It chains to the CA in the server
- // truststore and carries the CA's ML-DSA-65 alternative signature, so the handshake succeeds.
- client(CERT_DIR + "/client-hybrid-keystore.p12")
- .when()
- .get("/pqc/secure")
- .then()
- .statusCode(200)
- .body(containsString("Hybrid PQC certificate validated"))
- .body(containsString("trust anchor"))
- .body(containsString("ML-DSA-65"));
- }
-
- @Test
- public void testPqcSecureEndpointWithRsaOnlyCertificate() {
- // Test /pqc/secure WITH RSA-only client certificate (no PQC extensions). It is issued by the
- // same CA, so it passes chain validation and the ML-DSA-65 check is the only thing rejecting it.
- assertRejected(CERT_DIR + "/client-rsa-only-keystore.p12", "RSA-only cert issued by the CA");
- }
-
- @Test
- public void testPqcSecureEndpointWithUntrustedHybridCertificate() throws Exception {
- // A self-signed hybrid certificate carrying a well-formed ML-DSA-65 alternative signature over
- // its own body, but issued by nobody the server trusts. Rejected because the PQC check adds to
- // the standard chain validation rather than replacing it. This is the case that a custom
- // TrustManager doing its own validation instead of delegating will wrongly accept.
- Path keystore = ForgedCertificates.keystore("rogue", ForgedCertificates.rogueHybrid());
- assertRejected(keystore.toString(), "untrusted self-signed hybrid cert");
- }
-
- @Test
- public void testPqcSecureEndpointWithExpiredHybridCertificate() throws Exception {
- // A hybrid certificate whose validity period ended a year ago, which the validity check picks
- // up. It is self-signed too, so it fails for want of a trust anchor as well; both checks only
- // run because validation is delegated to the platform trust manager.
- Path keystore = ForgedCertificates.keystore("expired", ForgedCertificates.expiredHybrid());
- assertRejected(keystore.toString(), "expired hybrid cert");
- }
-
- private void assertRejected(String keyStorePath, String description) {
- assertRejected(withTrustStore(SSLConfig.sslConfig()).keyStore(keyStorePath, PASSWORD), description);
- }
-
- private void assertRejected(SSLConfig sslConfig, String description) {
- Exception e = assertThrows(Exception.class,
- () -> given(sslConfig).when().get("/pqc/secure").then().statusCode(200),
- "Expected the TLS handshake to be rejected for " + description);
-
- // TLS-level rejections surface as an IOException subclass, most often SSLHandshakeException.
- // Asserting that keeps the test from passing because of an unrelated failure.
- assertInstanceOf(IOException.class, rootCause(e),
- "Expected a TLS failure for " + description + " but got: " + e);
- log.info("✓ Rejected as expected ({}): {}", description, e.getMessage());
- }
-
- /**
- * Trusts the server via the generated client truststore, and verifies its identity against the
- * subject alternative names in the server certificate. Hostname verification is deliberately left
- * enabled so that the tests fail if those names regress.
- */
- private static SSLConfig withTrustStore(SSLConfig sslConfig) {
- return sslConfig.trustStore(CERT_DIR + "/client-hybrid-truststore.p12", PASSWORD);
- }
-
- private static RequestSpecification client(String keyStorePath) {
- return given(withTrustStore(SSLConfig.sslConfig()).keyStore(keyStorePath, PASSWORD));
- }
-
- private static RequestSpecification given(SSLConfig sslConfig) {
- return RestAssured.given().config(RestAssuredConfig.config().sslConfig(sslConfig));
- }
-
- private static Throwable rootCause(Throwable t) {
- Throwable cause = t;
- while (cause.getCause() != null && cause.getCause() != cause) {
- cause = cause.getCause();
- }
- return cause;
- }
-}
diff --git a/http-pqc-j17/src/test/java/org/acme/http/pqc/HybridPqcX509TrustManagerTest.java b/http-pqc-j17/src/test/java/org/acme/http/pqc/HybridPqcX509TrustManagerTest.java
deleted file mode 100644
index 251f71f7..00000000
--- a/http-pqc-j17/src/test/java/org/acme/http/pqc/HybridPqcX509TrustManagerTest.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.acme.http.pqc;
-
-import java.net.Socket;
-import java.security.KeyStore;
-import java.security.Security;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.SSLEngine;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.X509ExtendedTrustManager;
-
-import org.acme.http.pqc.certificates.HybridCertificateGenerator;
-import org.acme.http.pqc.certificates.HybridCertificateGenerator.CertificateData;
-import org.acme.http.pqc.trustmanager.HybridPqcX509TrustManager;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
-/**
- * Verifies that {@link HybridPqcX509TrustManager} implements the whole
- * {@link X509ExtendedTrustManager} contract rather than leaving parts of it permissive. An empty
- * {@code checkServerTrusted} or an empty {@code getAcceptedIssuers} compiles and passes any
- * happy-path test, so each is asserted here explicitly.
- */
-public class HybridPqcX509TrustManagerTest {
-
- private static CertificateData ca;
- private static X509Certificate leaf;
- private static HybridPqcX509TrustManager trustManager;
-
- @BeforeAll
- public static void setUpClass() throws Exception {
- if (Security.getProvider("BC") == null) {
- Security.insertProviderAt(new BouncyCastleProvider(), 1);
- }
-
- ca = HybridCertificateGenerator.generateCertificateAuthority();
- leaf = HybridCertificateGenerator.issueCertificate(ca, "trusted-leaf", true, null).certificate;
- trustManager = trustManagerAnchoredOn(ca.certificate);
- }
-
- /**
- * Builds the trust manager under test on top of a platform one seeded with the given trust anchors,
- * which is the arrangement {@code HybridPqcTrustManagerCustomizer} sets up at runtime.
- */
- private static HybridPqcX509TrustManager trustManagerAnchoredOn(X509Certificate... anchors) throws Exception {
- KeyStore trustStore = KeyStore.getInstance("PKCS12");
- trustStore.load(null, null);
- for (int i = 0; i < anchors.length; i++) {
- trustStore.setCertificateEntry("anchor-" + i, anchors[i]);
- }
-
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
- tmf.init(trustStore);
-
- for (TrustManager candidate : tmf.getTrustManagers()) {
- if (candidate instanceof X509ExtendedTrustManager) {
- return new HybridPqcX509TrustManager((X509ExtendedTrustManager) candidate);
- }
- }
- throw new IllegalStateException("No X509ExtendedTrustManager available");
- }
-
- /**
- * A peer that sends only its own certificate, leaving the relying party to supply the anchor. The
- * issuer's ML-DSA-65 key has to be found in the truststore for this to pass.
- */
- @Test
- public void leafAloneIsAccepted() {
- assertDoesNotThrow(() -> trustManager.checkClientTrusted(new X509Certificate[] { leaf }, "RSA"));
- }
-
- @Test
- public void leafWithCaInChainIsAccepted() {
- assertDoesNotThrow(
- () -> trustManager.checkClientTrusted(new X509Certificate[] { leaf, ca.certificate }, "RSA"));
- }
-
- @Test
- public void untrustedHybridClientIsRejected() throws Exception {
- X509Certificate rogue = ForgedCertificates.rogueHybrid().certificate;
- assertThrows(CertificateException.class,
- () -> trustManager.checkClientTrusted(new X509Certificate[] { rogue }, "RSA"));
- }
-
- /**
- * Issued by the trusted CA, so it passes chain validation, but carries no ML-DSA-65 signature. This
- * isolates the post-quantum check as the sole reason for rejection.
- */
- @Test
- public void certificateFromTheCaWithoutAltSignatureIsRejected() throws Exception {
- X509Certificate rsaOnly = HybridCertificateGenerator
- .issueCertificate(ca, "rsa-only-leaf", false, null).certificate;
-
- CertificateException e = assertThrows(CertificateException.class,
- () -> trustManager.checkClientTrusted(new X509Certificate[] { rsaOnly }, "RSA"));
- assertEquals(true, e.getMessage().contains("2.5.29.73"), "Unexpected message: " + e.getMessage());
- }
-
- @Test
- public void untrustedHybridServerIsRejected() throws Exception {
- X509Certificate rogue = ForgedCertificates.rogueHybrid().certificate;
- assertThrows(CertificateException.class,
- () -> trustManager.checkServerTrusted(new X509Certificate[] { rogue }, "RSA"),
- "checkServerTrusted must validate the chain, not accept anything");
- }
-
- @Test
- public void emptyChainIsRejected() {
- assertThrows(CertificateException.class, () -> trustManager.checkClientTrusted(null, "RSA"));
- assertThrows(CertificateException.class,
- () -> trustManager.checkClientTrusted(new X509Certificate[0], "RSA"));
- }
-
- /**
- * The {@code Socket} and {@code SSLEngine} overloads are the ones a TLS stack actually calls, so
- * they have to run the same two checks as the two-argument methods.
- */
- @Test
- public void extendedOverloadsValidateToo() throws Exception {
- X509Certificate rogue = ForgedCertificates.rogueHybrid().certificate;
-
- assertDoesNotThrow(() -> trustManager.checkClientTrusted(new X509Certificate[] { leaf }, "RSA", (Socket) null));
- assertDoesNotThrow(
- () -> trustManager.checkClientTrusted(new X509Certificate[] { leaf }, "RSA", (SSLEngine) null));
-
- assertThrows(CertificateException.class,
- () -> trustManager.checkClientTrusted(new X509Certificate[] { rogue }, "RSA", (Socket) null));
- assertThrows(CertificateException.class,
- () -> trustManager.checkServerTrusted(new X509Certificate[] { rogue }, "RSA", (SSLEngine) null));
- }
-
- /**
- * The connection context has to reach the delegate, because that is what the platform uses for
- * endpoint identification. Forwarding the three-argument overloads to the two-argument method
- * validates the certificate just as well and would satisfy the test above, while dropping the
- * hostname check on the way through.
- */
- @Test
- public void connectionContextIsHandedToTheDelegate() throws Exception {
- RecordingTrustManager recorder = new RecordingTrustManager(ca.certificate);
- HybridPqcX509TrustManager wrapper = new HybridPqcX509TrustManager(recorder);
- X509Certificate[] chain = new X509Certificate[] { leaf };
-
- wrapper.checkServerTrusted(chain, "RSA", (SSLEngine) null);
- assertEquals("checkServerTrusted/SSLEngine", recorder.lastCall);
-
- wrapper.checkServerTrusted(chain, "RSA", (Socket) null);
- assertEquals("checkServerTrusted/Socket", recorder.lastCall);
-
- wrapper.checkClientTrusted(chain, "RSA", (SSLEngine) null);
- assertEquals("checkClientTrusted/SSLEngine", recorder.lastCall);
-
- wrapper.checkClientTrusted(chain, "RSA", (Socket) null);
- assertEquals("checkClientTrusted/Socket", recorder.lastCall);
- }
-
- /**
- * Two CAs sharing a distinguished name, which is what a key rollover looks like to a relying party
- * holding both. Resolving the issuer by DN alone picks whichever anchor happens to come first, so
- * one of these two certificates would fail its ML-DSA-65 check despite the platform trust manager
- * having just accepted its chain.
- *
- * <p>
- * Both chain shapes are exercised. The CA is the interesting one: it carries no authority key
- * identifier of its own, being self-signed, so matching it needs more than the key identifiers the
- * leaf supplies — and the keystores this example generates do put the CA in the chain.
- */
- @Test
- public void certificatesFromTwoCasSharingADnAreBothAccepted() throws Exception {
- CertificateData firstCa = HybridCertificateGenerator.generateCertificateAuthority();
- CertificateData secondCa = HybridCertificateGenerator.generateCertificateAuthority();
- assertEquals(firstCa.certificate.getSubjectX500Principal(), secondCa.certificate.getSubjectX500Principal(),
- "The two CAs are only interesting to this test if they share a DN");
-
- X509Certificate firstLeaf = HybridCertificateGenerator
- .issueCertificate(firstCa, "rollover-leaf-1", true, null).certificate;
- X509Certificate secondLeaf = HybridCertificateGenerator
- .issueCertificate(secondCa, "rollover-leaf-2", true, null).certificate;
-
- HybridPqcX509TrustManager bothAnchors = trustManagerAnchoredOn(firstCa.certificate, secondCa.certificate);
-
- assertDoesNotThrow(() -> bothAnchors.checkClientTrusted(new X509Certificate[] { firstLeaf }, "RSA"));
- assertDoesNotThrow(() -> bothAnchors.checkClientTrusted(new X509Certificate[] { secondLeaf }, "RSA"));
-
- assertDoesNotThrow(() -> bothAnchors
- .checkClientTrusted(new X509Certificate[] { firstLeaf, firstCa.certificate }, "RSA"));
- assertDoesNotThrow(() -> bothAnchors
- .checkClientTrusted(new X509Certificate[] { secondLeaf, secondCa.certificate }, "RSA"));
- }
-
- @Test
- public void acceptedIssuersComeFromTheTruststore() {
- X509Certificate[] issuers = trustManager.getAcceptedIssuers();
- assertEquals(1, issuers.length, "Expected the configured trust anchor to be advertised");
- assertEquals(ca.certificate, issuers[0]);
- }
-
- /**
- * A delegate that accepts everything and records which of the six methods it was asked, so that the
- * overload the wrapper chose can be asserted.
- */
- private static final class RecordingTrustManager extends X509ExtendedTrustManager {
-
- private final X509Certificate anchor;
- private String lastCall;
-
- private RecordingTrustManager(X509Certificate anchor) {
- this.anchor = anchor;
- }
-
- @Override
- public void checkClientTrusted(X509Certificate[] chain, String authType) {
- lastCall = "checkClientTrusted/2";
- }
-
- @Override
- public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) {
- lastCall = "checkClientTrusted/Socket";
- }
-
- @Override
- public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) {
- lastCall = "checkClientTrusted/SSLEngine";
- }
-
- @Override
- public void checkServerTrusted(X509Certificate[] chain, String authType) {
- lastCall = "checkServerTrusted/2";
- }
-
- @Override
- public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) {
- lastCall = "checkServerTrusted/Socket";
- }
-
- @Override
- public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) {
- lastCall = "checkServerTrusted/SSLEngine";
- }
-
- @Override
- public X509Certificate[] getAcceptedIssuers() {
- return new X509Certificate[] { anchor };
- }
- }
-}
diff --git a/http-pqc-j21/eclipse-formatter-config.xml b/http-pqc-j21/eclipse-formatter-config.xml
deleted file mode 100644
index 2248b2b8..00000000
--- a/http-pqc-j21/eclipse-formatter-config.xml
+++ /dev/null
@@ -1,276 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<profiles version="8">
- <profile name="Camel Java Conventions" version="8" kind="CodeFormatterProfile">
- <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.indent_return_description" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
- <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
- <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
- <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="128"/>
- <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
- <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
- <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
- <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="CHECKSTYLE:OFF"/>
- <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="CHECKSTYLE:ON"/>
- </profile>
-</profiles>
diff --git a/http-pqc-j21/README.adoc b/http-pqc/README.adoc
similarity index 88%
rename from http-pqc-j21/README.adoc
rename to http-pqc/README.adoc
index d6da4561..09a8b3c9 100644
--- a/http-pqc-j21/README.adoc
+++ b/http-pqc/README.adoc
@@ -1,13 +1,11 @@
-= HTTP with Post-Quantum Cryptography (PQC): A Camel Quarkus example (Java 21)
-:cq-example-description: An example that shows how to implement quantum-resistant TLS using Java 21 with BouncyCastle JSSE provider for native PQC support with hybrid cipher suites
+= HTTP with Post-Quantum Cryptography (PQC): A Camel Quarkus example
+:cq-example-description: An example that shows how to implement quantum-resistant TLS using the BouncyCastle JSSE provider for native PQC support with hybrid cipher suites
{cq-description}
-This example shows how to implement quantum-resistant TLS on **Java 21** using hybrid cipher suites that combine classical ECDH with post-quantum ML-KEM-768 key exchange (X25519MLKEM768). The TLS stack natively negotiates and uses PQC algorithms.
+This example shows how to implement quantum-resistant TLS using hybrid cipher suites that combine classical ECDH with post-quantum ML-KEM-768 key exchange (X25519MLKEM768). The TLS stack natively negotiates and uses PQC algorithms.
-NOTE: CI runs with jdk17, therefore CI on this example is disabled (via profile)!
-
-IMPORTANT: This example uses **native PQC TLS support** via BouncyCastle JSSE provider. Java 21 supports PQC hybrid cipher suites at the TLS protocol level. For Java 17, see the http-pqc-j17 example which uses application-level validation.
+IMPORTANT: This example uses **native PQC TLS support** via BouncyCastle JSSE provider, which supports PQC hybrid cipher suites at the TLS protocol level.
TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Camel Quarkus User guide] for prerequisites and other general information.
@@ -15,16 +13,16 @@ TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Ca
Post-Quantum Cryptography (PQC) protects against "harvest now, decrypt later" attacks where adversaries capture encrypted data today to decrypt when quantum computers become available.
-=== Java 21 Approach
+=== Approach
-**Java 21 supports PQC algorithms natively in TLS** when using BouncyCastle JSSE provider. This example demonstrates:
+**PQC algorithms are supported natively in TLS** when using BouncyCastle JSSE provider. This example demonstrates:
* **Hybrid cipher suites**: X25519MLKEM768 combines classical X25519 ECDH with quantum-resistant ML-KEM-768 (NIST FIPS 203)
* **TLS-level key exchange**: PQC negotiation happens at the TLS protocol layer, not application level
* **BouncyCastle JSSE provider**: Replaces SunJSSE to enable PQC cipher suites in TLS 1.3
* **Configurable fallback**: Can configure classical fallback algorithms for backward compatibility
-This approach provides true PQC support at the TLS protocol level, unlike Java 17's application-level validation workaround.
+This approach provides true PQC support at the TLS protocol level, rather than relying on application-level validation.
== Certificate Generation
@@ -144,7 +142,7 @@ TIP: Find more details about the JVM mode and Native mode in the Package and run
mvn clean package
java -jar target/quarkus-app/quarkus-run.jar
...
-[io.quarkus] (main) camel-quarkus-examples-http-pqc-j21 started in ?.?s. Listening on: https://0.0.0.0:xxxxx
+[io.quarkus] (main) camel-quarkus-examples-http-pqc started in ?.?s. Listening on: https://0.0.0.0:xxxxx
----
=== Native Mode
@@ -158,7 +156,7 @@ To prepare a native executable using GraalVM, run the following command:
mvn clean package -Dnative
./target/*-runner
...
-[io.quarkus] (main) camel-quarkus-examples-http-pqc-j21 started in ?.?s. Listening on: https://0.0.0.0:xxxxx
+[io.quarkus] (main) camel-quarkus-examples-http-pqc started in ?.?s. Listening on: https://0.0.0.0:xxxxx
...
----
@@ -206,9 +204,9 @@ mvn clean verify -Dnative
NOTE: Native mode only tests the fallback scenario (PqcWithFallbackIT) because a native executable can be built with only one `jdk.tls.namedGroups` configuration. Testing both scenarios would require building two separate native executables.
-== How It Works (Java 21 Native TLS Support)
+== How It Works (Native TLS Support)
-This example uses Java 21's native PQC support via BouncyCastle JSSE provider, which replaces the standard SunJSSE provider.
+This example uses native PQC support via BouncyCastle JSSE provider, which replaces the standard SunJSSE provider.
=== Key Exchange vs Certificate Signatures
@@ -255,8 +253,6 @@ The server will prefer the first algorithm but fall back to subsequent ones if t
== Important Notes
-* **Java 21 Required**: This example requires Java 21 or higher. Java 21 is the first LTS version with PQC support in the TLS stack. Do not attempt to run this example on Java 17 or earlier.
-
* **BouncyCastle JSSE Provider**: The example uses BouncyCastle JSSE (not just JCA provider) registered at position 2 in the security provider list. This replaces SunJSSE for TLS operations while keeping other JCA providers for standard cryptographic operations.
* **Development Only**: Certificates are regenerated during test setup. For production, use persistent certificates from a trusted CA.
diff --git a/http-pqc-j17/eclipse-formatter-config.xml b/http-pqc/eclipse-formatter-config.xml
similarity index 100%
rename from http-pqc-j17/eclipse-formatter-config.xml
rename to http-pqc/eclipse-formatter-config.xml
diff --git a/http-pqc-j21/pom.xml b/http-pqc/pom.xml
similarity index 96%
rename from http-pqc-j21/pom.xml
rename to http-pqc/pom.xml
index e62ea3d4..58c22239 100644
--- a/http-pqc-j21/pom.xml
+++ b/http-pqc/pom.xml
@@ -20,12 +20,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <artifactId>camel-quarkus-examples-http-pqc-j21</artifactId>
+ <artifactId>camel-quarkus-examples-http-pqc</artifactId>
<groupId>org.apache.camel.quarkus.examples</groupId>
<version>4.0.0-SNAPSHOT</version>
- <name>Camel Quarkus :: Examples :: HTTP PQC Java 21</name>
- <description>Camel Quarkus Example :: HTTP with Post-Quantum Cryptography on Java 21 using X25519MLKEM768</description>
+ <name>Camel Quarkus :: Examples :: HTTP PQC</name>
+ <description>Camel Quarkus Example :: HTTP with Post-Quantum Cryptography using X25519MLKEM768</description>
<properties>
<quarkus.platform.version>3.40.1</quarkus.platform.version>
@@ -305,17 +305,6 @@
</build>
<profiles>
- <!-- Disable CI testing for this example because CI runs with jdk 17 -->
- <profile>
- <id>jdk-17</id>
- <activation>
- <jdk>17</jdk>
- </activation>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- <maven.compiler.release>17</maven.compiler.release>
- </properties>
- </profile>
<profile>
<id>native</id>
<activation>
diff --git a/http-pqc-j21/src/main/java/org/acme/http/pqc/PqcCamelRoute.java b/http-pqc/src/main/java/org/acme/http/pqc/PqcCamelRoute.java
similarity index 100%
rename from http-pqc-j21/src/main/java/org/acme/http/pqc/PqcCamelRoute.java
rename to http-pqc/src/main/java/org/acme/http/pqc/PqcCamelRoute.java
diff --git a/http-pqc-j21/src/main/java/org/acme/http/pqc/certificates/CertificateGenerator.java b/http-pqc/src/main/java/org/acme/http/pqc/certificates/CertificateGenerator.java
similarity index 99%
rename from http-pqc-j21/src/main/java/org/acme/http/pqc/certificates/CertificateGenerator.java
rename to http-pqc/src/main/java/org/acme/http/pqc/certificates/CertificateGenerator.java
index 17143b22..63c6272e 100644
--- a/http-pqc-j21/src/main/java/org/acme/http/pqc/certificates/CertificateGenerator.java
+++ b/http-pqc/src/main/java/org/acme/http/pqc/certificates/CertificateGenerator.java
@@ -45,7 +45,7 @@ import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.jboss.logging.Logger;
/**
- * Utility class for generating and persisting PQC-ready certificates for Java 21.
+ * Utility class for generating and persisting PQC-ready certificates.
* These certificates use RSA keys and are compatible with BouncyCastle JSSE provider
* which enables PQC hybrid key exchange (X25519MLKEM768) at the TLS layer.
*
diff --git a/http-pqc-j21/src/main/java/org/acme/http/pqc/certificates/SecurityConfiguration.java b/http-pqc/src/main/java/org/acme/http/pqc/certificates/SecurityConfiguration.java
similarity index 100%
rename from http-pqc-j21/src/main/java/org/acme/http/pqc/certificates/SecurityConfiguration.java
rename to http-pqc/src/main/java/org/acme/http/pqc/certificates/SecurityConfiguration.java
diff --git a/http-pqc-j21/src/main/resources/application.properties b/http-pqc/src/main/resources/application.properties
similarity index 94%
rename from http-pqc-j21/src/main/resources/application.properties
rename to http-pqc/src/main/resources/application.properties
index a72b3831..0a729628 100644
--- a/http-pqc-j21/src/main/resources/application.properties
+++ b/http-pqc/src/main/resources/application.properties
@@ -20,7 +20,7 @@
quarkus.banner.enabled = false
quarkus.log.file.enabled = true
-# HTTPS Configuration with PQC Support (Java 21 + BouncyCastle JSSE)
+# HTTPS Configuration with PQC Support (BouncyCastle JSSE)
# Use port 0 to get a random available port (prevents port conflicts in tests)
quarkus.http.ssl-port = 0
quarkus.http.insecure-requests = disabled
diff --git a/http-pqc-j21/src/test/java/org/acme/http/pqc/AbstractPqcTest.java b/http-pqc/src/test/java/org/acme/http/pqc/AbstractPqcTest.java
similarity index 100%
rename from http-pqc-j21/src/test/java/org/acme/http/pqc/AbstractPqcTest.java
rename to http-pqc/src/test/java/org/acme/http/pqc/AbstractPqcTest.java
diff --git a/http-pqc-j21/src/test/java/org/acme/http/pqc/PqcOnlyTest.java b/http-pqc/src/test/java/org/acme/http/pqc/PqcOnlyTest.java
similarity index 100%
rename from http-pqc-j21/src/test/java/org/acme/http/pqc/PqcOnlyTest.java
rename to http-pqc/src/test/java/org/acme/http/pqc/PqcOnlyTest.java
diff --git a/http-pqc-j21/src/test/java/org/acme/http/pqc/PqcWithFallbackIT.java b/http-pqc/src/test/java/org/acme/http/pqc/PqcWithFallbackIT.java
similarity index 100%
rename from http-pqc-j21/src/test/java/org/acme/http/pqc/PqcWithFallbackIT.java
rename to http-pqc/src/test/java/org/acme/http/pqc/PqcWithFallbackIT.java
diff --git a/http-pqc-j21/src/test/java/org/acme/http/pqc/PqcWithFallbackTest.java b/http-pqc/src/test/java/org/acme/http/pqc/PqcWithFallbackTest.java
similarity index 100%
rename from http-pqc-j21/src/test/java/org/acme/http/pqc/PqcWithFallbackTest.java
rename to http-pqc/src/test/java/org/acme/http/pqc/PqcWithFallbackTest.java
diff --git a/http-pqc-j21/src/test/java/org/acme/http/pqc/profiles/PqcOnlyProfile.java b/http-pqc/src/test/java/org/acme/http/pqc/profiles/PqcOnlyProfile.java
similarity index 100%
rename from http-pqc-j21/src/test/java/org/acme/http/pqc/profiles/PqcOnlyProfile.java
rename to http-pqc/src/test/java/org/acme/http/pqc/profiles/PqcOnlyProfile.java
diff --git a/http-pqc-j21/src/test/java/org/acme/http/pqc/profiles/PqcWithFallbackProfile.java b/http-pqc/src/test/java/org/acme/http/pqc/profiles/PqcWithFallbackProfile.java
similarity index 100%
rename from http-pqc-j21/src/test/java/org/acme/http/pqc/profiles/PqcWithFallbackProfile.java
rename to http-pqc/src/test/java/org/acme/http/pqc/profiles/PqcWithFallbackProfile.java
diff --git a/http-pqc-j21/src/test/resources/application.properties b/http-pqc/src/test/resources/application.properties
similarity index 100%
rename from http-pqc-j21/src/test/resources/application.properties
rename to http-pqc/src/test/resources/application.properties
diff --git a/jdbc-datasource/pom.xml b/jdbc-datasource/pom.xml
index 8702e6f5..18b30301 100644
--- a/jdbc-datasource/pom.xml
+++ b/jdbc-datasource/pom.xml
@@ -40,7 +40,7 @@
<maven-jar-plugin.version>3.5.1</maven-jar-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
diff --git a/jms-jpa/pom.xml b/jms-jpa/pom.xml
index 0d7ceef5..324e8146 100644
--- a/jms-jpa/pom.xml
+++ b/jms-jpa/pom.xml
@@ -41,7 +41,7 @@
<maven-jar-plugin.version>3.5.1</maven-jar-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
diff --git a/jpa-idempotent-repository/pom.xml b/jpa-idempotent-repository/pom.xml
index 0e10188f..1873a710 100644
--- a/jpa-idempotent-repository/pom.xml
+++ b/jpa-idempotent-repository/pom.xml
@@ -40,7 +40,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
diff --git a/jta-jpa/pom.xml b/jta-jpa/pom.xml
index d5fa9e66..0b6c3ae6 100644
--- a/jta-jpa/pom.xml
+++ b/jta-jpa/pom.xml
@@ -40,7 +40,7 @@
<maven-jar-plugin.version>3.5.1</maven-jar-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
diff --git a/kafka/pom.xml b/kafka/pom.xml
index 9d4fc98c..5841b55b 100644
--- a/kafka/pom.xml
+++ b/kafka/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/kamelet-chucknorris/pom.xml b/kamelet-chucknorris/pom.xml
index 88df3304..02b959bc 100644
--- a/kamelet-chucknorris/pom.xml
+++ b/kamelet-chucknorris/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/langchain4j-ingest-rag/pom.xml b/langchain4j-ingest-rag/pom.xml
index f66f3978..f65bcc89 100644
--- a/langchain4j-ingest-rag/pom.xml
+++ b/langchain4j-ingest-rag/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/message-bridge/pom.xml b/message-bridge/pom.xml
index ee1e6465..aec07d65 100644
--- a/message-bridge/pom.xml
+++ b/message-bridge/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/netty-custom-correlation/pom.xml b/netty-custom-correlation/pom.xml
index a946d2a7..973b98b5 100644
--- a/netty-custom-correlation/pom.xml
+++ b/netty-custom-correlation/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/observability/pom.xml b/observability/pom.xml
index 01391c07..100e3b79 100644
--- a/observability/pom.xml
+++ b/observability/pom.xml
@@ -39,7 +39,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/openapi-contract-first/pom.xml b/openapi-contract-first/pom.xml
index 549bdee9..80285431 100644
--- a/openapi-contract-first/pom.xml
+++ b/openapi-contract-first/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/platform-http-security-keycloak/pom.xml b/platform-http-security-keycloak/pom.xml
index 3aac5572..aa5d7c88 100644
--- a/platform-http-security-keycloak/pom.xml
+++ b/platform-http-security-keycloak/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/pom.xml b/pom.xml
index 39af88a1..9f305f96 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,8 +48,7 @@
<module>file-split-log-xml</module>
<module>health</module>
<module>http-log</module>
- <module>http-pqc-j17</module>
- <module>http-pqc-j21</module>
+ <module>http-pqc</module>
<module>jdbc-datasource</module>
<module>jms-jpa</module>
<module>jpa-idempotent-repository</module>
diff --git a/quarkus-rest-json/pom.xml b/quarkus-rest-json/pom.xml
index 4c761e25..bae965bf 100644
--- a/quarkus-rest-json/pom.xml
+++ b/quarkus-rest-json/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/rest-json/pom.xml b/rest-json/pom.xml
index cf0ce9de..13191754 100644
--- a/rest-json/pom.xml
+++ b/rest-json/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/rest-keycloak-soap-jms/pom.xml b/rest-keycloak-soap-jms/pom.xml
index e328d4dc..5009954f 100644
--- a/rest-keycloak-soap-jms/pom.xml
+++ b/rest-keycloak-soap-jms/pom.xml
@@ -39,7 +39,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/saga/pom.xml b/saga/pom.xml
index 690692cf..7a12bedb 100644
--- a/saga/pom.xml
+++ b/saga/pom.xml
@@ -40,7 +40,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/saga/saga-integration-tests/README.md b/saga/saga-integration-tests/README.md
index 86a3f139..fb856309 100644
--- a/saga/saga-integration-tests/README.md
+++ b/saga/saga-integration-tests/README.md
@@ -24,7 +24,7 @@ The test suite verifies:
### Prerequisites
-- Java 17+
+- Java 21+
- Maven 3.9+
- Docker (for Testcontainers)
diff --git a/spring-redis/pom.xml b/spring-redis/pom.xml
index b218642c..ebeabed0 100644
--- a/spring-redis/pom.xml
+++ b/spring-redis/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/timer-log-main/pom.xml b/timer-log-main/pom.xml
index 56aa0489..c4ccbef4 100644
--- a/timer-log-main/pom.xml
+++ b/timer-log-main/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/timer-log/pom.xml b/timer-log/pom.xml
index 0715b632..8b99ec92 100644
--- a/timer-log/pom.xml
+++ b/timer-log/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/variables/pom.xml b/variables/pom.xml
index 72f2a1bd..4aa307bd 100644
--- a/variables/pom.xml
+++ b/variables/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
diff --git a/vertx-websocket-chat/pom.xml b/vertx-websocket-chat/pom.xml
index 8da2cfd0..9c521fee 100644
--- a/vertx-websocket-chat/pom.xml
+++ b/vertx-websocket-chat/pom.xml
@@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.release>17</maven.compiler.release>
+ <maven.compiler.release>21</maven.compiler.release>
<formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>