This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 6a253ffb947c CAMEL-25794: camel-pqc - HSS, XMSSMT and SNTRUPrime get
their default key material (#28098)
6a253ffb947c is described below
commit 6a253ffb947c0439ca2a1cb9c373a9b680bc7d7c
Author: Andrea Cosentino <[email protected]>
AuthorDate: Mon Oct 19 16:28:15 2026 +0200
CAMEL-25794: camel-pqc - HSS, XMSSMT and SNTRUPrime get their default key
material (#28098)
Co-authored-by: Claude Opus 5 <[email protected]>
---
.../apache/camel/catalog/docs/pqc-component.adoc | 4 +-
.../camel-pqc/src/main/docs/pqc-component.adoc | 4 +-
.../apache/camel/component/pqc/PQCComponent.java | 12 ++++
.../pqc/PQCDefaultMaterialAutowiringTest.java | 83 ++++++++++++++++++++++
4 files changed, 99 insertions(+), 4 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pqc-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pqc-component.adoc
index 93295b5eea4a..136728d35fc4 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pqc-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pqc-component.adoc
@@ -360,9 +360,9 @@ All other signature algorithms follow the exact same route
pattern shown above f
|HSS
|`HSS`
-|HSS
+|LMS
|BC
-|LMS-SHA256-N32-H5
+|LMS-SHA256-N32-H5 / SHA256-N32-W2 (OTS), 2 levels
|`PQCDefaultHSSMaterial`
|Dilithium
diff --git a/components/camel-pqc/src/main/docs/pqc-component.adoc
b/components/camel-pqc/src/main/docs/pqc-component.adoc
index 93295b5eea4a..136728d35fc4 100644
--- a/components/camel-pqc/src/main/docs/pqc-component.adoc
+++ b/components/camel-pqc/src/main/docs/pqc-component.adoc
@@ -360,9 +360,9 @@ All other signature algorithms follow the exact same route
pattern shown above f
|HSS
|`HSS`
-|HSS
+|LMS
|BC
-|LMS-SHA256-N32-H5
+|LMS-SHA256-N32-H5 / SHA256-N32-W2 (OTS), 2 levels
|`PQCDefaultHSSMaterial`
|Dilithium
diff --git
a/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCComponent.java
b/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCComponent.java
index 7b37f94f7c1f..de68f41073cb 100644
---
a/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCComponent.java
+++
b/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCComponent.java
@@ -114,6 +114,14 @@ public class PQCComponent extends HealthCheckComponent {
configuration.setSigner(PQCDefaultXMSSMaterial.signer);
configuration.setKeyPair(PQCDefaultXMSSMaterial.keyPair);
break;
+ case "XMSSMT":
+
configuration.setSigner(PQCDefaultXMSSMTMaterial.signer);
+
configuration.setKeyPair(PQCDefaultXMSSMTMaterial.keyPair);
+ break;
+ case "HSS":
+ configuration.setSigner(PQCDefaultHSSMaterial.signer);
+
configuration.setKeyPair(PQCDefaultHSSMaterial.keyPair);
+ break;
case "FALCON":
configuration.setSigner(PQCDefaultFalconMaterial.signer);
configuration.setKeyPair(PQCDefaultFalconMaterial.keyPair);
@@ -176,6 +184,10 @@ public class PQCComponent extends HealthCheckComponent {
configuration.setKeyGenerator(PQCDefaultNTRULPRimeMaterial.keyGenerator);
configuration.setKeyPair(PQCDefaultNTRULPRimeMaterial.keyPair);
break;
+ case "SNTRUPrime":
+
configuration.setKeyGenerator(PQCDefaultSNTRUPrimeMaterial.keyGenerator);
+
configuration.setKeyPair(PQCDefaultSNTRUPrimeMaterial.keyPair);
+ break;
case "KYBER":
configuration.setKeyGenerator(PQCDefaultKYBERMaterial.keyGenerator);
configuration.setKeyPair(PQCDefaultKYBERMaterial.keyPair);
diff --git
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDefaultMaterialAutowiringTest.java
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDefaultMaterialAutowiringTest.java
new file mode 100644
index 000000000000..e1fc42bb1aea
--- /dev/null
+++
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDefaultMaterialAutowiringTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.apache.camel.component.pqc;
+
+import java.security.Security;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Every constant of the algorithm enums must get default key material
autowired from the URI alone. Three of them (HSS,
+ * XMSSMT, SNTRUPrime) fell through the component's switch, so their
documented default material class was dead code and
+ * the route only failed on the first exchange.
+ */
+public class PQCDefaultMaterialAutowiringTest {
+
+ @BeforeEach
+ void addProviders() {
+ if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
+ Security.addProvider(new BouncyCastleProvider());
+ }
+ if (Security.getProvider(BouncyCastlePQCProvider.PROVIDER_NAME) ==
null) {
+ Security.addProvider(new BouncyCastlePQCProvider());
+ }
+ }
+
+ @ParameterizedTest
+ @EnumSource(PQCSignatureAlgorithms.class)
+ void everySignatureAlgorithmGetsDefaultMaterial(PQCSignatureAlgorithms
algorithm) throws Exception {
+ try (CamelContext context = new DefaultCamelContext()) {
+ context.setAutowiredEnabled(false);
+ context.start();
+
+ PQCEndpoint endpoint = context.getEndpoint(
+ "pqc:sign?operation=sign&signatureAlgorithm=" +
algorithm.name(), PQCEndpoint.class);
+
+ assertNotNull(endpoint.getConfiguration().getKeyPair(),
+ "no default key pair autowired for signatureAlgorithm=" +
algorithm.name());
+ assertNotNull(endpoint.getConfiguration().getSigner(),
+ "no default signer autowired for signatureAlgorithm=" +
algorithm.name());
+ }
+ }
+
+ @ParameterizedTest
+ @EnumSource(PQCKeyEncapsulationAlgorithms.class)
+ void everyKemAlgorithmGetsDefaultMaterial(PQCKeyEncapsulationAlgorithms
algorithm) throws Exception {
+ try (CamelContext context = new DefaultCamelContext()) {
+ context.setAutowiredEnabled(false);
+ context.start();
+
+ PQCEndpoint endpoint = context.getEndpoint(
+
"pqc:kem?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=AES"
+ +
"&keyEncapsulationAlgorithm=" + algorithm.name(),
+ PQCEndpoint.class);
+
+ assertNotNull(endpoint.getConfiguration().getKeyPair(),
+ "no default key pair autowired for
keyEncapsulationAlgorithm=" + algorithm.name());
+ assertNotNull(endpoint.getConfiguration().getKeyGenerator(),
+ "no default key generator autowired for
keyEncapsulationAlgorithm=" + algorithm.name());
+ }
+ }
+}