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 624acf581487 CAMEL-26548: camel-pqc - symmetricKeyLength defaults to
256 (#29093)
624acf581487 is described below
commit 624acf581487d9c73019d54b25037bd159ec30a7
Author: Andrea Cosentino <[email protected]>
AuthorDate: Wed Nov 4 19:53:16 2026 +0100
CAMEL-26548: camel-pqc - symmetricKeyLength defaults to 256 (#29093)
The camel-pqc symmetricKeyLength option now defaults to 256 bits. The docs
and the upgrade guide list which ciphers accept only 128 or only 256 bits.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
---
.../org/apache/camel/catalog/components/pqc.json | 4 +-
.../org/apache/camel/catalog/dataformats/pqc.json | 2 +-
.../apache/camel/catalog/docs/pqc-dataformat.adoc | 4 +-
.../org/apache/camel/catalog/models/pqc.json | 2 +-
.../apache/camel/catalog/schemas/camel-spring.xsd | 3 +-
.../apache/camel/catalog/schemas/camel-xml-io.xsd | 3 +-
.../camel/catalog/schemas/camelYamlDsl-model.json | 4 +-
.../apache/camel/component/pqc/dataformat/pqc.json | 2 +-
.../org/apache/camel/component/pqc/pqc.json | 4 +-
.../camel-pqc/src/main/docs/pqc-dataformat.adoc | 4 +-
.../camel/component/pqc/PQCConfiguration.java | 8 +-
.../component/pqc/dataformat/PQCDataFormat.java | 5 +-
.../pqc/PQCDefaultSymmetricKeyLengthTest.java | 86 ++++++++++++++++++++++
.../PQCKemConcurrentExtractionIsolationTest.java | 2 +-
.../pqc/PQCKemSharedKeyGeneratorIsolationTest.java | 4 +-
...erateEncapsulationCryptoRoundTripCAST5Test.java | 6 +-
...rateEncapsulationCryptoRoundTripDESedeTest.java | 6 +-
...enerateEncapsulationCryptoRoundTripRC2Test.java | 6 +-
...enerateEncapsulationCryptoRoundTripSM4Test.java | 6 +-
.../org/apache/camel/model/dataformat/pqc.json | 2 +-
.../camel/model/dataformat/PQCDataFormat.java | 5 +-
.../apache/camel/java/out/JavaDslModelWriter.java | 2 +-
.../java/org/apache/camel/xml/out/ModelWriter.java | 2 +-
.../org/apache/camel/yaml/out/YamlModelWriter.java | 2 +-
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 24 ++++++
.../component/dsl/PqcComponentBuilderFactory.java | 7 +-
.../endpoint/dsl/PQCEndpointBuilderFactory.java | 14 +++-
.../dsl/yaml/deserializers/ModelDeserializers.java | 2 +-
.../resources/schema/camelYamlDsl-canonical.json | 4 +-
.../resources/schema/camelYamlDsl-model.json | 4 +-
.../generated/resources/schema/camelYamlDsl.json | 4 +-
31 files changed, 179 insertions(+), 54 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pqc.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pqc.json
index c3aeb57ed737..b5f7f9a728e8 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pqc.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pqc.json
@@ -52,7 +52,7 @@
"storeExtractedSecretKeyAsHeader": { "index": 25, "kind": "property",
"displayName": "Store Extracted Secret Key As Header", "group": "advanced",
"label": "advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.pqc.PQCConfiguration", "configurationField":
"configuration", "description": "In the context of extractSec [...]
"strictKeyLifecycle": { "index": 26, "kind": "property", "displayName":
"Strict Key Lifecycle", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
true, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "Whether to enforce key
status checks before cryptographic [...]
"symmetricKeyAlgorithm": { "index": 27, "kind": "property", "displayName":
"Symmetric Key Algorithm", "group": "advanced", "label": "advanced",
"required": false, "type": "enum", "javaType": "java.lang.String", "enum": [
"AES", "ARIA", "RC2", "RC5", "CAMELLIA", "CAST5", "CAST6", "CHACHA7539",
"DSTU7624", "GOST28147", "GOST3412_2015", "GRAIN128", "HC128", "HC256",
"SALSA20", "SEED", "SM4", "DESEDE" ], "deprecated": false, "deprecationNote":
"", "autowired": false, "secret": false, "co [...]
- "symmetricKeyLength": { "index": 28, "kind": "property", "displayName":
"Symmetric Key Length", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
128, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "The required length of
the symmetric key used" },
+ "symmetricKeyLength": { "index": 28, "kind": "property", "displayName":
"Symmetric Key Length", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
256, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "The required length of
the symmetric key used. The default of 2 [...]
"healthCheckConsumerEnabled": { "index": 29, "kind": "property",
"displayName": "Health Check Consumer Enabled", "group": "health", "label":
"health", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue": true,
"description": "Used for enabling or disabling all consumer based health checks
from this component" },
"healthCheckProducerEnabled": { "index": 30, "kind": "property",
"displayName": "Health Check Producer Enabled", "group": "health", "label":
"health", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue": true,
"description": "Used for enabling or disabling all producer based health checks
from this component. Notice: Camel has by default disabled all producer based
health-checks. You can turn on produce [...]
},
@@ -109,6 +109,6 @@
"storeExtractedSecretKeyAsHeader": { "index": 20, "kind": "parameter",
"displayName": "Store Extracted Secret Key As Header", "group": "advanced",
"label": "advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.pqc.PQCConfiguration", "configurationField":
"configuration", "description": "In the context of extractSe [...]
"strictKeyLifecycle": { "index": 21, "kind": "parameter", "displayName":
"Strict Key Lifecycle", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
true, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "Whether to enforce key
status checks before cryptographic [...]
"symmetricKeyAlgorithm": { "index": 22, "kind": "parameter",
"displayName": "Symmetric Key Algorithm", "group": "advanced", "label":
"advanced", "required": false, "type": "enum", "javaType": "java.lang.String",
"enum": [ "AES", "ARIA", "RC2", "RC5", "CAMELLIA", "CAST5", "CAST6",
"CHACHA7539", "DSTU7624", "GOST28147", "GOST3412_2015", "GRAIN128", "HC128",
"HC256", "SALSA20", "SEED", "SM4", "DESEDE" ], "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "c [...]
- "symmetricKeyLength": { "index": 23, "kind": "parameter", "displayName":
"Symmetric Key Length", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
128, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "The required length of
the symmetric key used" }
+ "symmetricKeyLength": { "index": 23, "kind": "parameter", "displayName":
"Symmetric Key Length", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
256, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "The required length of
the symmetric key used. The default of [...]
}
}
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/pqc.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/pqc.json
index d8114a080b7b..cd0e8044c303 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/pqc.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/pqc.json
@@ -25,7 +25,7 @@
"id": { "index": 0, "kind": "attribute", "displayName": "Id", "group":
"common", "required": false, "type": "string", "javaType": "java.lang.String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
id of this node" },
"keyEncapsulationAlgorithm": { "index": 1, "kind": "attribute",
"displayName": "Key Encapsulation Algorithm", "group": "common", "required":
false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLKEM",
"BIKE", "HQC", "CMCE", "SABER", "FRODO", "NTRU", "NTRULPRime", "SNTRUPrime",
"KYBER" ], "deprecated": false, "autowired": false, "secret": false,
"defaultValue": "MLKEM", "description": "The Post-Quantum KEM algorithm to use
for key encapsulation." },
"symmetricKeyAlgorithm": { "index": 2, "kind": "attribute", "displayName":
"Symmetric Key Algorithm", "group": "common", "required": false, "type":
"enum", "javaType": "java.lang.String", "enum": [ "AES", "ARIA", "CAMELLIA",
"CAST6", "DSTU7624", "GOST3412_2015", "SEED", "SM4", "CHACHA7539" ],
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
"AES", "description": "The symmetric encryption algorithm to use with the
shared secret. Only algorithms that support au [...]
- "symmetricKeyLength": { "index": 3, "kind": "attribute", "displayName":
"Symmetric Key Length", "group": "common", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 128, "description": "The length (in
bits) of the symmetric key." },
+ "symmetricKeyLength": { "index": 3, "kind": "attribute", "displayName":
"Symmetric Key Length", "group": "common", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 256, "description": "The length (in
bits) of the symmetric key. SEED and SM4 only accept 128; GOST3412_2015 and
CHACHA7539 only accept 256." },
"keyPair": { "index": 4, "kind": "attribute", "displayName": "Key Pair",
"group": "common", "required": false, "type": "object", "javaType":
"java.security.KeyPair", "deprecated": false, "autowired": false, "secret":
false, "description": "Refers to the KeyPair to lookup from the registry to use
for KEM operations." },
"provider": { "index": 5, "kind": "attribute", "displayName": "Provider",
"group": "advanced", "label": "advanced", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "description": "The JCE security provider to use." },
"keyGenerator": { "index": 6, "kind": "attribute", "displayName": "Key
Generator", "group": "advanced", "label": "advanced", "required": false,
"type": "object", "javaType": "javax.crypto.KeyGenerator", "deprecated": false,
"autowired": false, "secret": false, "description": "Refers to a custom
KeyGenerator to lookup from the registry for KEM operations." }
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pqc-dataformat.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pqc-dataformat.adoc
index e983435fe922..17c4b02d6136 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pqc-dataformat.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pqc-dataformat.adoc
@@ -127,8 +127,8 @@ YAML::
|symmetricKeyLength
|int
-|128
-|Length of the symmetric key in bits (128, 192, or 256 for AES)
+|256
+|Length of the symmetric key in bits (128, 192 or 256 for AES). SEED and SM4
only accept 128; GOST3412-2015 and CHACHA7539 only accept 256
|keyPair
|KeyPair
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pqc.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pqc.json
index bc3e555dd029..ab5f394da363 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pqc.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pqc.json
@@ -16,7 +16,7 @@
"id": { "index": 0, "kind": "attribute", "displayName": "Id", "group":
"common", "required": false, "type": "string", "javaType": "java.lang.String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
id of this node" },
"keyEncapsulationAlgorithm": { "index": 1, "kind": "attribute",
"displayName": "Key Encapsulation Algorithm", "group": "common", "required":
false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLKEM",
"BIKE", "HQC", "CMCE", "SABER", "FRODO", "NTRU", "NTRULPRime", "SNTRUPrime",
"KYBER" ], "deprecated": false, "autowired": false, "secret": false,
"defaultValue": "MLKEM", "description": "The Post-Quantum KEM algorithm to use
for key encapsulation." },
"symmetricKeyAlgorithm": { "index": 2, "kind": "attribute", "displayName":
"Symmetric Key Algorithm", "group": "common", "required": false, "type":
"enum", "javaType": "java.lang.String", "enum": [ "AES", "ARIA", "CAMELLIA",
"CAST6", "DSTU7624", "GOST3412_2015", "SEED", "SM4", "CHACHA7539" ],
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
"AES", "description": "The symmetric encryption algorithm to use with the
shared secret. Only algorithms that support au [...]
- "symmetricKeyLength": { "index": 3, "kind": "attribute", "displayName":
"Symmetric Key Length", "group": "common", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 128, "description": "The length (in
bits) of the symmetric key." },
+ "symmetricKeyLength": { "index": 3, "kind": "attribute", "displayName":
"Symmetric Key Length", "group": "common", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 256, "description": "The length (in
bits) of the symmetric key. SEED and SM4 only accept 128; GOST3412_2015 and
CHACHA7539 only accept 256." },
"keyPair": { "index": 4, "kind": "attribute", "displayName": "Key Pair",
"group": "common", "required": false, "type": "object", "javaType":
"java.security.KeyPair", "deprecated": false, "autowired": false, "secret":
false, "description": "Refers to the KeyPair to lookup from the registry to use
for KEM operations." },
"provider": { "index": 5, "kind": "attribute", "displayName": "Provider",
"group": "advanced", "label": "advanced", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "description": "The JCE security provider to use." },
"keyGenerator": { "index": 6, "kind": "attribute", "displayName": "Key
Generator", "group": "advanced", "label": "advanced", "required": false,
"type": "object", "javaType": "javax.crypto.KeyGenerator", "deprecated": false,
"autowired": false, "secret": false, "description": "Refers to a custom
KeyGenerator to lookup from the registry for KEM operations." }
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
index 92526b71f23a..54561ee3e618 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
@@ -9819,7 +9819,8 @@ CHACHA7539 with ChaCha20-Poly1305. Default value: AES
<xs:annotation>
<xs:documentation xml:lang="en">
<![CDATA[
-The length (in bits) of the symmetric key. Default value: 128
+The length (in bits) of the symmetric key. SEED and SM4 only accept 128;
GOST3412_2015 and CHACHA7539 only accept 256.
+Default value: 256
]]>
</xs:documentation>
</xs:annotation>
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
index 6e879f5cec64..c1aabdd84c60 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
@@ -8941,7 +8941,8 @@ CHACHA7539 with ChaCha20-Poly1305. Default value: AES
<xs:annotation>
<xs:documentation xml:lang="en">
<![CDATA[
-The length (in bits) of the symmetric key. Default value: 128
+The length (in bits) of the symmetric key. SEED and SM4 only accept 128;
GOST3412_2015 and CHACHA7539 only accept 256.
+Default value: 256
]]>
</xs:documentation>
</xs:annotation>
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
index 8a0b9f6a4736..d357319a7c26 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
@@ -13084,9 +13084,9 @@
}, {
"name" : "symmetricKeyLength",
"type" : "number",
- "description" : "The length (in bits) of the symmetric key.",
+ "description" : "The length (in bits) of the symmetric key. SEED and
SM4 only accept 128; GOST3412_2015 and CHACHA7539 only accept 256.",
"title" : "Symmetric Key Length",
- "default" : "128"
+ "default" : "256"
} ]
},
"parquetAvro" : {
diff --git
a/components/camel-pqc/src/generated/resources/META-INF/org/apache/camel/component/pqc/dataformat/pqc.json
b/components/camel-pqc/src/generated/resources/META-INF/org/apache/camel/component/pqc/dataformat/pqc.json
index d8114a080b7b..cd0e8044c303 100644
---
a/components/camel-pqc/src/generated/resources/META-INF/org/apache/camel/component/pqc/dataformat/pqc.json
+++
b/components/camel-pqc/src/generated/resources/META-INF/org/apache/camel/component/pqc/dataformat/pqc.json
@@ -25,7 +25,7 @@
"id": { "index": 0, "kind": "attribute", "displayName": "Id", "group":
"common", "required": false, "type": "string", "javaType": "java.lang.String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
id of this node" },
"keyEncapsulationAlgorithm": { "index": 1, "kind": "attribute",
"displayName": "Key Encapsulation Algorithm", "group": "common", "required":
false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLKEM",
"BIKE", "HQC", "CMCE", "SABER", "FRODO", "NTRU", "NTRULPRime", "SNTRUPrime",
"KYBER" ], "deprecated": false, "autowired": false, "secret": false,
"defaultValue": "MLKEM", "description": "The Post-Quantum KEM algorithm to use
for key encapsulation." },
"symmetricKeyAlgorithm": { "index": 2, "kind": "attribute", "displayName":
"Symmetric Key Algorithm", "group": "common", "required": false, "type":
"enum", "javaType": "java.lang.String", "enum": [ "AES", "ARIA", "CAMELLIA",
"CAST6", "DSTU7624", "GOST3412_2015", "SEED", "SM4", "CHACHA7539" ],
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
"AES", "description": "The symmetric encryption algorithm to use with the
shared secret. Only algorithms that support au [...]
- "symmetricKeyLength": { "index": 3, "kind": "attribute", "displayName":
"Symmetric Key Length", "group": "common", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 128, "description": "The length (in
bits) of the symmetric key." },
+ "symmetricKeyLength": { "index": 3, "kind": "attribute", "displayName":
"Symmetric Key Length", "group": "common", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 256, "description": "The length (in
bits) of the symmetric key. SEED and SM4 only accept 128; GOST3412_2015 and
CHACHA7539 only accept 256." },
"keyPair": { "index": 4, "kind": "attribute", "displayName": "Key Pair",
"group": "common", "required": false, "type": "object", "javaType":
"java.security.KeyPair", "deprecated": false, "autowired": false, "secret":
false, "description": "Refers to the KeyPair to lookup from the registry to use
for KEM operations." },
"provider": { "index": 5, "kind": "attribute", "displayName": "Provider",
"group": "advanced", "label": "advanced", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "description": "The JCE security provider to use." },
"keyGenerator": { "index": 6, "kind": "attribute", "displayName": "Key
Generator", "group": "advanced", "label": "advanced", "required": false,
"type": "object", "javaType": "javax.crypto.KeyGenerator", "deprecated": false,
"autowired": false, "secret": false, "description": "Refers to a custom
KeyGenerator to lookup from the registry for KEM operations." }
diff --git
a/components/camel-pqc/src/generated/resources/META-INF/org/apache/camel/component/pqc/pqc.json
b/components/camel-pqc/src/generated/resources/META-INF/org/apache/camel/component/pqc/pqc.json
index c3aeb57ed737..b5f7f9a728e8 100644
---
a/components/camel-pqc/src/generated/resources/META-INF/org/apache/camel/component/pqc/pqc.json
+++
b/components/camel-pqc/src/generated/resources/META-INF/org/apache/camel/component/pqc/pqc.json
@@ -52,7 +52,7 @@
"storeExtractedSecretKeyAsHeader": { "index": 25, "kind": "property",
"displayName": "Store Extracted Secret Key As Header", "group": "advanced",
"label": "advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.pqc.PQCConfiguration", "configurationField":
"configuration", "description": "In the context of extractSec [...]
"strictKeyLifecycle": { "index": 26, "kind": "property", "displayName":
"Strict Key Lifecycle", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
true, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "Whether to enforce key
status checks before cryptographic [...]
"symmetricKeyAlgorithm": { "index": 27, "kind": "property", "displayName":
"Symmetric Key Algorithm", "group": "advanced", "label": "advanced",
"required": false, "type": "enum", "javaType": "java.lang.String", "enum": [
"AES", "ARIA", "RC2", "RC5", "CAMELLIA", "CAST5", "CAST6", "CHACHA7539",
"DSTU7624", "GOST28147", "GOST3412_2015", "GRAIN128", "HC128", "HC256",
"SALSA20", "SEED", "SM4", "DESEDE" ], "deprecated": false, "deprecationNote":
"", "autowired": false, "secret": false, "co [...]
- "symmetricKeyLength": { "index": 28, "kind": "property", "displayName":
"Symmetric Key Length", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
128, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "The required length of
the symmetric key used" },
+ "symmetricKeyLength": { "index": 28, "kind": "property", "displayName":
"Symmetric Key Length", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
256, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "The required length of
the symmetric key used. The default of 2 [...]
"healthCheckConsumerEnabled": { "index": 29, "kind": "property",
"displayName": "Health Check Consumer Enabled", "group": "health", "label":
"health", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue": true,
"description": "Used for enabling or disabling all consumer based health checks
from this component" },
"healthCheckProducerEnabled": { "index": 30, "kind": "property",
"displayName": "Health Check Producer Enabled", "group": "health", "label":
"health", "required": false, "type": "boolean", "javaType": "boolean",
"deprecated": false, "autowired": false, "secret": false, "defaultValue": true,
"description": "Used for enabling or disabling all producer based health checks
from this component. Notice: Camel has by default disabled all producer based
health-checks. You can turn on produce [...]
},
@@ -109,6 +109,6 @@
"storeExtractedSecretKeyAsHeader": { "index": 20, "kind": "parameter",
"displayName": "Store Extracted Secret Key As Header", "group": "advanced",
"label": "advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.pqc.PQCConfiguration", "configurationField":
"configuration", "description": "In the context of extractSe [...]
"strictKeyLifecycle": { "index": 21, "kind": "parameter", "displayName":
"Strict Key Lifecycle", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
true, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "Whether to enforce key
status checks before cryptographic [...]
"symmetricKeyAlgorithm": { "index": 22, "kind": "parameter",
"displayName": "Symmetric Key Algorithm", "group": "advanced", "label":
"advanced", "required": false, "type": "enum", "javaType": "java.lang.String",
"enum": [ "AES", "ARIA", "RC2", "RC5", "CAMELLIA", "CAST5", "CAST6",
"CHACHA7539", "DSTU7624", "GOST28147", "GOST3412_2015", "GRAIN128", "HC128",
"HC256", "SALSA20", "SEED", "SM4", "DESEDE" ], "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "c [...]
- "symmetricKeyLength": { "index": 23, "kind": "parameter", "displayName":
"Symmetric Key Length", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
128, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "The required length of
the symmetric key used" }
+ "symmetricKeyLength": { "index": 23, "kind": "parameter", "displayName":
"Symmetric Key Length", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
256, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration",
"configurationField": "configuration", "description": "The required length of
the symmetric key used. The default of [...]
}
}
diff --git a/components/camel-pqc/src/main/docs/pqc-dataformat.adoc
b/components/camel-pqc/src/main/docs/pqc-dataformat.adoc
index e983435fe922..17c4b02d6136 100644
--- a/components/camel-pqc/src/main/docs/pqc-dataformat.adoc
+++ b/components/camel-pqc/src/main/docs/pqc-dataformat.adoc
@@ -127,8 +127,8 @@ YAML::
|symmetricKeyLength
|int
-|128
-|Length of the symmetric key in bits (128, 192, or 256 for AES)
+|256
+|Length of the symmetric key in bits (128, 192 or 256 for AES). SEED and SM4
only accept 128; GOST3412-2015 and CHACHA7539 only accept 256
|keyPair
|KeyPair
diff --git
a/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCConfiguration.java
b/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCConfiguration.java
index d53b58dab0ac..d224d5a56247 100644
---
a/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCConfiguration.java
+++
b/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCConfiguration.java
@@ -61,8 +61,8 @@ public class PQCConfiguration implements Cloneable {
@Metadata(label = "advanced")
private String symmetricKeyAlgorithm;
@UriParam
- @Metadata(label = "advanced", defaultValue = "128")
- private int symmetricKeyLength = 128;
+ @Metadata(label = "advanced", defaultValue = "256")
+ private int symmetricKeyLength = 256;
@UriParam
@Metadata(label = "advanced", defaultValue = "false")
private boolean storeExtractedSecretKeyAsHeader = false;
@@ -223,7 +223,9 @@ public class PQCConfiguration implements Cloneable {
}
/**
- * The required length of the symmetric key used
+ * The required length of the symmetric key used. The default of 256 keeps
the strength of the shared secret the KEM
+ * produces; the fixed-size ciphers, such as SEED and SM4, only accept
128, and GOST3412-2015 and CHACHA7539 only
+ * accept 256.
*/
public void setSymmetricKeyLength(int symmetricKeyLength) {
this.symmetricKeyLength = symmetricKeyLength;
diff --git
a/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/dataformat/PQCDataFormat.java
b/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/dataformat/PQCDataFormat.java
index 6282ca7b7d8b..b36aae6941a4 100644
---
a/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/dataformat/PQCDataFormat.java
+++
b/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/dataformat/PQCDataFormat.java
@@ -138,7 +138,7 @@ public class PQCDataFormat extends ServiceSupport
implements DataFormat, DataFor
private String keyEncapsulationAlgorithm = "MLKEM";
private String symmetricKeyAlgorithm = "AES";
- private int symmetricKeyLength = 128;
+ private int symmetricKeyLength = 256;
private KeyPair keyPair;
private String provider;
private KeyGenerator keyGenerator;
@@ -410,7 +410,8 @@ public class PQCDataFormat extends ServiceSupport
implements DataFormat, DataFor
}
/**
- * Sets the length (in bits) of the symmetric key. Default is 128.
+ * Sets the length (in bits) of the symmetric key. Default is 256. SEED
and SM4 only accept 128; GOST3412-2015 and
+ * CHACHA7539 only accept 256.
*/
public void setSymmetricKeyLength(int symmetricKeyLength) {
this.symmetricKeyLength = symmetricKeyLength;
diff --git
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDefaultSymmetricKeyLengthTest.java
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDefaultSymmetricKeyLengthTest.java
new file mode 100644
index 000000000000..5e896a092d96
--- /dev/null
+++
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDefaultSymmetricKeyLengthTest.java
@@ -0,0 +1,86 @@
+/*
+ * 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.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.pqc.dataformat.PQCDataFormat;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.bouncycastle.jcajce.SecretKeyWithEncapsulation;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * The default KEM is ML-KEM-768, which produces a 256-bit shared secret, so
the symmetric key derived from it defaults
+ * to 256 bits rather than throwing that margin away.
+ */
+public class PQCDefaultSymmetricKeyLengthTest extends CamelTestSupport {
+
+ @EndpointInject("mock:encapsulate")
+ protected MockEndpoint resultEncapsulate;
+
+ @Produce("direct:encapsulate")
+ protected ProducerTemplate templateEncapsulate;
+
+ @BeforeEach
+ void addProvider() {
+ if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
+ Security.addProvider(new BouncyCastleProvider());
+ }
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ // no symmetricKeyLength: the default is what is under test
+ from("direct:encapsulate")
+
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&keyEncapsulationAlgorithm=MLKEM"
+ + "&symmetricKeyAlgorithm=AES")
+ .to("mock:encapsulate");
+ }
+ };
+ }
+
+ @Test
+ void theConfiguredDefaultIs256() {
+ assertEquals(256, new PQCConfiguration().getSymmetricKeyLength());
+ assertEquals(256, new PQCDataFormat().getSymmetricKeyLength());
+ }
+
+ @Test
+ void anEncapsulatedKeyIs256BitsByDefault() throws Exception {
+ resultEncapsulate.expectedMessageCount(1);
+
+ templateEncapsulate.sendBody("Hello");
+
+ resultEncapsulate.assertIsSatisfied();
+
+ SecretKeyWithEncapsulation key =
resultEncapsulate.getExchanges().get(0).getMessage()
+ .getBody(SecretKeyWithEncapsulation.class);
+ assertEquals(32, key.getEncoded().length, "the derived key must be 256
bits");
+ }
+}
diff --git
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemConcurrentExtractionIsolationTest.java
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemConcurrentExtractionIsolationTest.java
index b5f639ab26ee..0f9725141642 100644
---
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemConcurrentExtractionIsolationTest.java
+++
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemConcurrentExtractionIsolationTest.java
@@ -98,7 +98,7 @@ class PQCKemConcurrentExtractionIsolationTest extends
CamelTestSupport {
PQCKeyEncapsulationAlgorithms.MLKEM.getBcProvider());
int matching = 0;
for (int i = 0; i < MESSAGES_PER_THREAD; i++) {
- sender.init(new KEMGenerateSpec(keyPair.getPublic(),
"AES", 128), new SecureRandom());
+ sender.init(new KEMGenerateSpec(keyPair.getPublic(),
"AES", 256), new SecureRandom());
SecretKeyWithEncapsulation sent =
(SecretKeyWithEncapsulation) sender.generateKey();
SecretKeyWithEncapsulation extracted
= template.requestBody("direct:extract", sent,
SecretKeyWithEncapsulation.class);
diff --git
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemSharedKeyGeneratorIsolationTest.java
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemSharedKeyGeneratorIsolationTest.java
index b0cf702607ab..79fe7e47030b 100644
---
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemSharedKeyGeneratorIsolationTest.java
+++
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemSharedKeyGeneratorIsolationTest.java
@@ -134,13 +134,13 @@ class PQCKemSharedKeyGeneratorIsolationTest extends
CamelTestSupport {
private SecretKeyWithEncapsulation encapsulate() throws Exception {
KeyGenerator kg = newKeyGenerator();
- kg.init(new KEMGenerateSpec(keyPair.getPublic(), "AES", 128), new
SecureRandom());
+ kg.init(new KEMGenerateSpec(keyPair.getPublic(), "AES", 256), new
SecureRandom());
return (SecretKeyWithEncapsulation) kg.generateKey();
}
private byte[] decapsulate(byte[] encapsulation) throws Exception {
KeyGenerator kg = newKeyGenerator();
- kg.init(new KEMExtractSpec(keyPair.getPrivate(), encapsulation, "AES",
128), new SecureRandom());
+ kg.init(new KEMExtractSpec(keyPair.getPrivate(), encapsulation, "AES",
256), new SecureRandom());
return kg.generateKey().getEncoded();
}
diff --git
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripCAST5Test.java
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripCAST5Test.java
index cdc44da68e0b..fd8e52764320 100644
---
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripCAST5Test.java
+++
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripCAST5Test.java
@@ -59,10 +59,10 @@ public class
PQCMLKEMGenerateEncapsulationCryptoRoundTripCAST5Test extends Camel
@Override
public void configure() {
from("direct:encapsulate")
-
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=CAST5")
+
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=CAST5&symmetricKeyLength=128")
.to("mock:encapsulate")
-
.to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=CAST5")
-
.to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=CAST5")
+
.to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=CAST5&symmetricKeyLength=128")
+
.to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=CAST5&symmetricKeyLength=128")
.setHeader(CryptoDataFormat.KEY, body())
.setBody(constant("Hello"))
.marshal(cryptoFormat)
diff --git
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripDESedeTest.java
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripDESedeTest.java
index d388ad5cd831..d6dba7864e20 100644
---
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripDESedeTest.java
+++
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripDESedeTest.java
@@ -62,10 +62,10 @@ public class
PQCMLKEMGenerateEncapsulationCryptoRoundTripDESedeTest extends Came
@Override
public void configure() {
from("direct:encapsulate")
-
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=DESEDE")
+
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=DESEDE&symmetricKeyLength=192")
.to("mock:encapsulate")
-
.to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=DESEDE")
-
.to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=DESEDE")
+
.to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=DESEDE&symmetricKeyLength=192")
+
.to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=DESEDE&symmetricKeyLength=192")
.setHeader(CryptoDataFormat.KEY, body())
.setBody(constant("Hello"))
.marshal(cryptoFormat)
diff --git
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripRC2Test.java
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripRC2Test.java
index 11cd799f29d9..9488c1a75d01 100644
---
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripRC2Test.java
+++
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripRC2Test.java
@@ -62,10 +62,10 @@ public class
PQCMLKEMGenerateEncapsulationCryptoRoundTripRC2Test extends CamelTe
@Override
public void configure() {
from("direct:encapsulate")
-
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=RC2")
+
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=RC2&symmetricKeyLength=128")
.to("mock:encapsulate")
-
.to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=RC2")
-
.to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=RC2")
+
.to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=RC2&symmetricKeyLength=128")
+
.to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=RC2&symmetricKeyLength=128")
.setHeader(CryptoDataFormat.KEY, body())
.setBody(constant("Hello"))
.marshal(cryptoFormat)
diff --git
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripSM4Test.java
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripSM4Test.java
index aab5cb5e86bb..0a6c1c127978 100644
---
a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripSM4Test.java
+++
b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCMLKEMGenerateEncapsulationCryptoRoundTripSM4Test.java
@@ -62,10 +62,10 @@ public class
PQCMLKEMGenerateEncapsulationCryptoRoundTripSM4Test extends CamelTe
@Override
public void configure() {
from("direct:encapsulate")
-
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=SM4")
+
.to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=SM4&symmetricKeyLength=128")
.to("mock:encapsulate")
-
.to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=SM4")
-
.to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=SM4")
+
.to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=SM4&symmetricKeyLength=128")
+
.to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=SM4&symmetricKeyLength=128")
.setHeader(CryptoDataFormat.KEY, body())
.setBody(constant("Hello"))
.marshal(cryptoFormat)
diff --git
a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/pqc.json
b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/pqc.json
index bc3e555dd029..ab5f394da363 100644
---
a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/pqc.json
+++
b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/pqc.json
@@ -16,7 +16,7 @@
"id": { "index": 0, "kind": "attribute", "displayName": "Id", "group":
"common", "required": false, "type": "string", "javaType": "java.lang.String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
id of this node" },
"keyEncapsulationAlgorithm": { "index": 1, "kind": "attribute",
"displayName": "Key Encapsulation Algorithm", "group": "common", "required":
false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLKEM",
"BIKE", "HQC", "CMCE", "SABER", "FRODO", "NTRU", "NTRULPRime", "SNTRUPrime",
"KYBER" ], "deprecated": false, "autowired": false, "secret": false,
"defaultValue": "MLKEM", "description": "The Post-Quantum KEM algorithm to use
for key encapsulation." },
"symmetricKeyAlgorithm": { "index": 2, "kind": "attribute", "displayName":
"Symmetric Key Algorithm", "group": "common", "required": false, "type":
"enum", "javaType": "java.lang.String", "enum": [ "AES", "ARIA", "CAMELLIA",
"CAST6", "DSTU7624", "GOST3412_2015", "SEED", "SM4", "CHACHA7539" ],
"deprecated": false, "autowired": false, "secret": false, "defaultValue":
"AES", "description": "The symmetric encryption algorithm to use with the
shared secret. Only algorithms that support au [...]
- "symmetricKeyLength": { "index": 3, "kind": "attribute", "displayName":
"Symmetric Key Length", "group": "common", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 128, "description": "The length (in
bits) of the symmetric key." },
+ "symmetricKeyLength": { "index": 3, "kind": "attribute", "displayName":
"Symmetric Key Length", "group": "common", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 256, "description": "The length (in
bits) of the symmetric key. SEED and SM4 only accept 128; GOST3412_2015 and
CHACHA7539 only accept 256." },
"keyPair": { "index": 4, "kind": "attribute", "displayName": "Key Pair",
"group": "common", "required": false, "type": "object", "javaType":
"java.security.KeyPair", "deprecated": false, "autowired": false, "secret":
false, "description": "Refers to the KeyPair to lookup from the registry to use
for KEM operations." },
"provider": { "index": 5, "kind": "attribute", "displayName": "Provider",
"group": "advanced", "label": "advanced", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "description": "The JCE security provider to use." },
"keyGenerator": { "index": 6, "kind": "attribute", "displayName": "Key
Generator", "group": "advanced", "label": "advanced", "required": false,
"type": "object", "javaType": "javax.crypto.KeyGenerator", "deprecated": false,
"autowired": false, "secret": false, "description": "Refers to a custom
KeyGenerator to lookup from the registry for KEM operations." }
diff --git
a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/PQCDataFormat.java
b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/PQCDataFormat.java
index 9ddd208b0040..be4787d76334 100644
---
a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/PQCDataFormat.java
+++
b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/PQCDataFormat.java
@@ -47,8 +47,9 @@ public class PQCDataFormat extends DataFormatDefinition {
+ " SEED and SM4 are encrypted with GCM, and
CHACHA7539 with ChaCha20-Poly1305.")
private String symmetricKeyAlgorithm;
@XmlAttribute
- @Metadata(javaType = "java.lang.Integer", defaultValue = "128",
- description = "The length (in bits) of the symmetric key.")
+ @Metadata(javaType = "java.lang.Integer", defaultValue = "256",
+ description = "The length (in bits) of the symmetric key. SEED
and SM4 only accept 128;"
+ + " GOST3412_2015 and CHACHA7539 only accept 256.")
private String symmetricKeyLength;
@XmlAttribute
@Metadata(javaType = "java.security.KeyPair",
diff --git
a/core/camel-java-io/src/generated/java/org/apache/camel/java/out/JavaDslModelWriter.java
b/core/camel-java-io/src/generated/java/org/apache/camel/java/out/JavaDslModelWriter.java
index a424b321bc64..3375e4dcb598 100644
---
a/core/camel-java-io/src/generated/java/org/apache/camel/java/out/JavaDslModelWriter.java
+++
b/core/camel-java-io/src/generated/java/org/apache/camel/java/out/JavaDslModelWriter.java
@@ -3282,7 +3282,7 @@ public class JavaDslModelWriter extends
JavaDslModelWriterSupport {
doWriteIdentifiedTypeAttributes(sb, def);
doWriteAttribute(sb, "keyEncapsulationAlgorithm",
def.getKeyEncapsulationAlgorithm(), "MLKEM");
doWriteAttribute(sb, "symmetricKeyAlgorithm",
def.getSymmetricKeyAlgorithm(), "AES");
- doWriteAttribute(sb, "symmetricKeyLength",
def.getSymmetricKeyLength(), "128");
+ doWriteAttribute(sb, "symmetricKeyLength",
def.getSymmetricKeyLength(), "256");
doWriteAttribute(sb, "keyPair", def.getKeyPair(), null);
doWriteAttribute(sb, "provider", def.getProvider(), null);
doWriteAttribute(sb, "keyGenerator", def.getKeyGenerator(), null);
diff --git
a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
index fbb8d8dc38b0..a1b02fceb282 100644
---
a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
+++
b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
@@ -2650,7 +2650,7 @@ public class ModelWriter extends BaseWriter {
doWriteIdentifiedTypeAttributes(def);
doWriteAttribute("keyEncapsulationAlgorithm",
def.getKeyEncapsulationAlgorithm(), "MLKEM");
doWriteAttribute("symmetricKeyAlgorithm",
def.getSymmetricKeyAlgorithm(), "AES");
- doWriteAttribute("symmetricKeyLength", def.getSymmetricKeyLength(),
"128");
+ doWriteAttribute("symmetricKeyLength", def.getSymmetricKeyLength(),
"256");
doWriteAttribute("keyPair", def.getKeyPair(), null);
doWriteAttribute("provider", def.getProvider(), null);
doWriteAttribute("keyGenerator", def.getKeyGenerator(), null);
diff --git
a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/YamlModelWriter.java
b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/YamlModelWriter.java
index dbcf2facfc33..f72582ee5723 100644
---
a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/YamlModelWriter.java
+++
b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/YamlModelWriter.java
@@ -2651,7 +2651,7 @@ public class YamlModelWriter extends
YamlModelWriterSupport {
doWriteIdentifiedTypeAttributes(jo, def);
doWriteAttribute(jo, "keyEncapsulationAlgorithm",
def.getKeyEncapsulationAlgorithm(), "MLKEM");
doWriteAttribute(jo, "symmetricKeyAlgorithm",
def.getSymmetricKeyAlgorithm(), "AES");
- doWriteAttribute(jo, "symmetricKeyLength",
def.getSymmetricKeyLength(), "128");
+ doWriteAttribute(jo, "symmetricKeyLength",
def.getSymmetricKeyLength(), "256");
doWriteAttribute(jo, "keyPair", def.getKeyPair(), null);
doWriteAttribute(jo, "provider", def.getProvider(), null);
doWriteAttribute(jo, "keyGenerator", def.getKeyGenerator(), null);
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 7a345a2226b3..8f1855871da2 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -1421,6 +1421,30 @@ has a generated exchange id now, as with any other
consumer, and the LSN is in t
header (a `String` such as `0/16B3748`). Use
`+${header.CamelPgReplicationSlotLsn}+` instead of `+${exchangeId}+` to read
the LSN.
+=== camel-pqc - symmetricKeyLength defaults to 256
+
+The `symmetricKeyLength` option of the `pqc` component and of the `pqc` data
format now defaults to `256` instead of
+`128`. The default KEM is ML-KEM-768, a NIST category 3 algorithm producing a
256-bit shared secret, and deriving a
+128-bit key from it threw that margin away.
+
+A route that leaves `symmetricKeyLength` unset therefore now produces a
256-bit key. Two consequences:
+
+* A key encapsulated by 4.24 cannot be used by a peer still running the old
default, and material encrypted with the
+ `pqc` data format by one version cannot be read by the other. Set
`symmetricKeyLength=128` explicitly on both ends
+ while they are mixed.
+* The algorithms that cannot take a 256-bit key now fail unless
`symmetricKeyLength` is set explicitly. Those are
+ `RC2` and `CAST5` (40, 64, 128), `DESEDE` (128, 192), and `GRAIN128`,
`HC128`, `SEED` and `SM4` (128 only).
+ Conversely `CHACHA7539`, `GOST28147`, `GOST3412-2015` and `HC256` accept 256
only, and no longer need an explicit
+ value.
++
+The `pqc` *component* validates the length when the route starts and fails
there with
+`Invalid symmetric key length 256 for algorithm <name>. Valid key lengths:
[...]`.
++
+The `pqc` *data format* does not check the length when it starts, so it fails
on the first message instead, when the
+cipher rejects the key. Of the algorithms the data format accepts, only `SEED`
and `SM4` are affected. Note also that
+the algorithm itself can come from the `CamelPQCSymmetricAlgorithm` header, so
a route whose configured algorithm is
+fine can still fail per message on an override.
+
=== camel-pqc - an unknown hybridKdfAlgorithm is rejected
The hybrid KEM operations now fail with an `IllegalArgumentException` when
`hybridKdfAlgorithm` is not one of
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PqcComponentBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PqcComponentBuilderFactory.java
index 467f1fad9656..a320934f3502 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PqcComponentBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PqcComponentBuilderFactory.java
@@ -543,11 +543,14 @@ public interface PqcComponentBuilderFactory {
/**
- * The required length of the symmetric key used.
+ * The required length of the symmetric key used. The default of 256
+ * keeps the strength of the shared secret the KEM produces; the
+ * fixed-size ciphers, such as SEED and SM4, only accept 128, and
+ * GOST3412-2015 and CHACHA7539 only accept 256.
*
* The option is a: <code>int</code> type.
*
- * Default: 128
+ * Default: 256
* Group: advanced
*
* @param symmetricKeyLength the value to set
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PQCEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PQCEndpointBuilderFactory.java
index 54e93ff2eeb5..0ead2ec5d1f2 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PQCEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PQCEndpointBuilderFactory.java
@@ -627,11 +627,14 @@ public interface PQCEndpointBuilderFactory {
return this;
}
/**
- * The required length of the symmetric key used.
+ * The required length of the symmetric key used. The default of 256
+ * keeps the strength of the shared secret the KEM produces; the
+ * fixed-size ciphers, such as SEED and SM4, only accept 128, and
+ * GOST3412-2015 and CHACHA7539 only accept 256.
*
* The option is a: <code>int</code> type.
*
- * Default: 128
+ * Default: 256
* Group: advanced
*
* @param symmetricKeyLength the value to set
@@ -642,11 +645,14 @@ public interface PQCEndpointBuilderFactory {
return this;
}
/**
- * The required length of the symmetric key used.
+ * The required length of the symmetric key used. The default of 256
+ * keeps the strength of the shared secret the KEM produces; the
+ * fixed-size ciphers, such as SEED and SM4, only accept 128, and
+ * GOST3412-2015 and CHACHA7539 only accept 256.
*
* The option will be converted to a <code>int</code> type.
*
- * Default: 128
+ * Default: 256
* Group: advanced
*
* @param symmetricKeyLength the value to set
diff --git
a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
index 302fec077acd..9d35bf63bc31 100644
---
a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
+++
b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
@@ -11472,7 +11472,7 @@ public final class ModelDeserializers extends
YamlDeserializerSupport {
@YamlProperty(name = "keyPair", type = "string",
description = "Refers to the KeyPair to lookup from the registry to use for KEM
operations.", displayName = "Key Pair"),
@YamlProperty(name = "provider", type = "string",
description = "The JCE security provider to use.", displayName = "Provider"),
@YamlProperty(name = "symmetricKeyAlgorithm", type =
"enum:AES,ARIA,CAMELLIA,CAST6,DSTU7624,GOST3412_2015,SEED,SM4,CHACHA7539",
defaultValue = "AES", description = "The symmetric encryption algorithm to use
with the shared secret. Only algorithms that support authenticated encryption
(AEAD) are allowed: AES, ARIA, CAMELLIA, CAST6, DSTU7624, GOST3412_2015, SEED
and SM4 are encrypted with GCM, and CHACHA7539 with ChaCha20-Poly1305.",
displayName = "Symmetric Key Algorithm"),
- @YamlProperty(name = "symmetricKeyLength", type =
"number", defaultValue = "128", description = "The length (in bits) of the
symmetric key.", displayName = "Symmetric Key Length")
+ @YamlProperty(name = "symmetricKeyLength", type =
"number", defaultValue = "256", description = "The length (in bits) of the
symmetric key. SEED and SM4 only accept 128; GOST3412_2015 and CHACHA7539 only
accept 256.", displayName = "Symmetric Key Length")
}
)
public static class PQCDataFormatDeserializer extends
YamlDeserializerBase<PQCDataFormat> {
diff --git
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
index 69dc0cf93ece..67e2440ec3a6 100644
---
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
+++
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
@@ -8303,8 +8303,8 @@
"symmetricKeyLength" : {
"type" : "number",
"title" : "Symmetric Key Length",
- "description" : "The length (in bits) of the symmetric key.",
- "default" : 128
+ "description" : "The length (in bits) of the symmetric key. SEED
and SM4 only accept 128; GOST3412_2015 and CHACHA7539 only accept 256.",
+ "default" : 256
}
}
},
diff --git
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
index 8a0b9f6a4736..d357319a7c26 100644
---
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
+++
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
@@ -13084,9 +13084,9 @@
}, {
"name" : "symmetricKeyLength",
"type" : "number",
- "description" : "The length (in bits) of the symmetric key.",
+ "description" : "The length (in bits) of the symmetric key. SEED and
SM4 only accept 128; GOST3412_2015 and CHACHA7539 only accept 256.",
"title" : "Symmetric Key Length",
- "default" : "128"
+ "default" : "256"
} ]
},
"parquetAvro" : {
diff --git
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
index 2c47ee81ca96..a67e091a2569 100644
---
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
+++
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
@@ -10456,8 +10456,8 @@
"symmetricKeyLength" : {
"type" : "number",
"title" : "Symmetric Key Length",
- "description" : "The length (in bits) of the symmetric key.",
- "default" : 128
+ "description" : "The length (in bits) of the symmetric key. SEED
and SM4 only accept 128; GOST3412_2015 and CHACHA7539 only accept 256.",
+ "default" : 256
}
}
},