You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2025/10/22 17:09:36 UTC
(camel) 01/02: CAMEL-22586 - Camel-PQC: Like Crypto support it as dataformat
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch pqc-improv
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 9633eff8538342cefed8b42ebc75f3f348e18049
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Oct 22 14:58:53 2025 +0200
CAMEL-22586 - Camel-PQC: Like Crypto support it as dataformat
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
.../org/apache/camel/catalog/components.properties | 1 -
.../org/apache/camel/catalog/components/pqc.json | 78 ---
.../apache/camel/catalog/dataformats.properties | 1 +
.../org/apache/camel/catalog/dataformats/pqc.json | 28 ++
.../org/apache/camel/catalog/models.properties | 1 +
.../org/apache/camel/catalog/models/pqc.json | 25 +
.../apache/camel/catalog/schemas/camel-spring.xsd | 81 ++++
.../apache/camel/catalog/schemas/camel-xml-io.xsd | 81 ++++
.../component/pqc/PQCDataFormatConfigurer.java | 102 ++++
.../org/apache/camel/component/pqc/pqc.json | 86 +---
.../org/apache/camel/configurer/pqc-dataformat | 2 +
.../org/apache/camel/dataformat.properties | 7 +
.../services/org/apache/camel/dataformat/pqc | 2 +
.../camel-pqc/src/main/docs/pqc-component.adoc | 529 +++++++++++++++++++++
.../apache/camel/component/pqc/PQCDataFormat.java | 385 +++++++++++++++
.../component/pqc/PQCDataFormatHeaderTest.java | 122 +++++
.../pqc/PQCDataFormatIntegrationTest.java | 174 +++++++
.../pqc/PQCDataFormatMultipleAlgorithmsTest.java | 103 ++++
.../camel/component/pqc/PQCDataFormatTest.java | 139 ++++++
.../org/apache/camel/model/dataformat/pqc.json | 25 +
.../services/org/apache/camel/model.properties | 1 +
.../org/apache/camel/model/dataformat/jaxb.index | 1 +
.../camel/model/dataformat/PQCDataFormat.java | 262 ++++++++++
.../reifier/dataformat/DataFormatReifier.java | 2 +
.../reifier/dataformat/PQCDataFormatReifier.java | 42 ++
.../org/apache/camel/main/components.properties | 1 -
.../org/apache/camel/main/dataformats.properties | 1 +
.../java/org/apache/camel/xml/in/ModelParser.java | 13 +
.../java/org/apache/camel/xml/out/ModelWriter.java | 15 +
.../org/apache/camel/yaml/out/ModelWriter.java | 15 +
.../{ROOT => dataformats}/examples/json/pqc.json | 0
.../component/ComponentsBuilderFactory.java | 13 -
.../builder/endpoint/StaticEndpointBuilders.java | 40 --
.../camel-component-known-dependencies.properties | 1 -
.../dsl/yaml/deserializers/ModelDeserializers.java | 82 ++++
.../deserializers/ModelDeserializersResolver.java | 2 +
.../generated/resources/schema/camelYamlDsl.json | 52 ++
37 files changed, 2313 insertions(+), 202 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
index b89f4ad80482..279fc099b156 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
@@ -274,7 +274,6 @@ platform-http
plc4x
pop3
pop3s
-pqc
pubnub
pulsar
qdrant
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
deleted file mode 100644
index c9b8c6b29537..000000000000
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pqc.json
+++ /dev/null
@@ -1,78 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "pqc",
- "title": "PQC Algorithms",
- "description": "Post Quantum Cryptography Signature and Verification component.",
- "deprecated": false,
- "firstVersion": "4.12.0",
- "label": "security",
- "javaType": "org.apache.camel.component.pqc.PQCComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-pqc",
- "version": "4.16.0-SNAPSHOT",
- "scheme": "pqc",
- "extendsScheme": "",
- "syntax": "pqc:label",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": true,
- "lenientProperties": false,
- "browsable": false,
- "remote": true
- },
- "componentProperties": {
- "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.pqc.PQCConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
- "lazyStartProducer": { "index": 1, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
- "operation": { "index": 2, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.pqc.PQCOperations", "enum": [ "sign", "verify", "generateSecretKeyEncapsulation", "extractSecretKeyEncapsulation", "extractSecretKeyFromEncapsulation", "getRemainingSignatures", "getKeyState", "deleteKeyState", "generateKeyPair", "exportKey", "importKey", "rotateKey", "getKeyMetadata", "listKeys", "expir [...]
- "autowiredEnabled": { "index": 3, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
- "keyEncapsulationAlgorithm": { "index": 4, "kind": "property", "displayName": "Key Encapsulation Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLKEM", "BIKE", "HQC", "CMCE", "SABER", "FRODO", "NTRU", "NTRULPRime", "SNTRUPrime", "KYBER" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configur [...]
- "keyGenerator": { "index": 5, "kind": "property", "displayName": "Key Generator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.crypto.KeyGenerator", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The Key Generator to be used in encapsulation and extraction" },
- "keyPair": { "index": 6, "kind": "property", "displayName": "Key Pair", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.KeyPair", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The KeyPair to be used" },
- "keyPairAlias": { "index": 7, "kind": "property", "displayName": "Key Pair Alias", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "A KeyPair alias to use in combination with KeyStore parameter" },
- "keyStore": { "index": 8, "kind": "property", "displayName": "Key Store", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.KeyStore", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "A KeyStore where we could get Cryptographic material" },
- "keyStorePassword": { "index": 9, "kind": "property", "displayName": "Key Store Password", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The KeyStore password to use in combination with KeyStore Parameter" },
- "signatureAlgorithm": { "index": 10, "kind": "property", "displayName": "Signature Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLDSA", "SLHDSA", "LMS", "HSS", "XMSS", "XMSSMT", "DILITHIUM", "FALCON", "PICNIC", "SNOVA", "MAYO", "SPHINCSPLUS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "c [...]
- "signer": { "index": 11, "kind": "property", "displayName": "Signer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.Signature", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The Signer to be used" },
- "storeExtractedSecretKeyAsHeader": { "index": 12, "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 [...]
- "symmetricKeyAlgorithm": { "index": 13, "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": 14, "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" },
- "healthCheckConsumerEnabled": { "index": 15, "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": 16, "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 [...]
- },
- "headers": {
- "CamelPQCOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform", "constantName": "org.apache.camel.component.pqc.PQCConstants#OPERATION" },
- "CamelPQCSignature": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The signature of a body", "constantName": "org.apache.camel.component.pqc.PQCConstants#SIGNATURE" },
- "CamelPQCVerification": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The result of verification of a Body signature", "constantName": "org.apache.camel.component.pqc.PQCConstants#VERIFY" },
- "CamelPQCSecretKey": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The extracted key in case of extractSecretKeyFromEncapsulation operation and storeExtractedSecretKeyAsHeader option enabled", "constantName": "org.apache.camel.component.pqc.PQCConstants#SECRET_KEY" },
- "CamelPQCRemainingSignatures": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remaining signatures for a stateful key", "constantName": "org.apache.camel.component.pqc.PQCConstants#REMAINING_SIGNATURES" },
- "CamelPQCKeyState": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.pqc.stateful.StatefulKeyState", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The key state for a stateful key", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_STATE" },
- "CamelPQCKeyId": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The key ID for stateful key operations", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_ID" },
- "CamelPQCKeyPair": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.security.KeyPair", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The generated key pair", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_PAIR" },
- "CamelPQCKeyFormat": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The key format for import\/export operations", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_FORMAT" },
- "CamelPQCExportedKey": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exported key data", "constantName": "org.apache.camel.component.pqc.PQCConstants#EXPORTED_KEY" },
- "CamelPQCKeyMetadata": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.pqc.lifecycle.KeyMetadata", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The key metadata", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_METADATA" },
- "CamelPQCKeyList": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.util.List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List of key metadata", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_LIST" },
- "CamelPQCAlgorithm": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The algorithm for key generation", "constantName": "org.apache.camel.component.pqc.PQCConstants#ALGORITHM" },
- "CamelPQCIncludePrivate": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Include private key in export", "constantName": "org.apache.camel.component.pqc.PQCConstants#INCLUDE_PRIVATE" },
- "CamelPQCRevocationReason": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Revocation reason", "constantName": "org.apache.camel.component.pqc.PQCConstants#REVOCATION_REASON" }
- },
- "properties": {
- "label": { "index": 0, "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "Logical name" },
- "operation": { "index": 1, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.pqc.PQCOperations", "enum": [ "sign", "verify", "generateSecretKeyEncapsulation", "extractSecretKeyEncapsulation", "extractSecretKeyFromEncapsulation", "getRemainingSignatures", "getKeyState", "deleteKeyState", "generateKeyPair", "exportKey", "importKey", "rotateKey", "getKeyMetadata", "listKeys", "expi [...]
- "lazyStartProducer": { "index": 2, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...]
- "keyEncapsulationAlgorithm": { "index": 3, "kind": "parameter", "displayName": "Key Encapsulation Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLKEM", "BIKE", "HQC", "CMCE", "SABER", "FRODO", "NTRU", "NTRULPRime", "SNTRUPrime", "KYBER" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configu [...]
- "keyGenerator": { "index": 4, "kind": "parameter", "displayName": "Key Generator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.crypto.KeyGenerator", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The Key Generator to be used in encapsulation and extraction" },
- "keyPair": { "index": 5, "kind": "parameter", "displayName": "Key Pair", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.KeyPair", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The KeyPair to be used" },
- "keyPairAlias": { "index": 6, "kind": "parameter", "displayName": "Key Pair Alias", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "A KeyPair alias to use in combination with KeyStore parameter" },
- "keyStore": { "index": 7, "kind": "parameter", "displayName": "Key Store", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.KeyStore", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "A KeyStore where we could get Cryptographic material" },
- "keyStorePassword": { "index": 8, "kind": "parameter", "displayName": "Key Store Password", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The KeyStore password to use in combination with KeyStore Parameter" },
- "signatureAlgorithm": { "index": 9, "kind": "parameter", "displayName": "Signature Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLDSA", "SLHDSA", "LMS", "HSS", "XMSS", "XMSSMT", "DILITHIUM", "FALCON", "PICNIC", "SNOVA", "MAYO", "SPHINCSPLUS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "c [...]
- "signer": { "index": 10, "kind": "parameter", "displayName": "Signer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.Signature", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The Signer to be used" },
- "storeExtractedSecretKeyAsHeader": { "index": 11, "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 [...]
- "symmetricKeyAlgorithm": { "index": 12, "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": 13, "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" }
- }
-}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties
index a71e6f2ab78b..95f2e595b066 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties
@@ -32,6 +32,7 @@ lzf
mimeMultipart
parquetAvro
pgp
+pqc
protobuf
protobufJackson
rss
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
new file mode 100644
index 000000000000..f812dc3ab61d
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/pqc.json
@@ -0,0 +1,28 @@
+{
+ "dataformat": {
+ "kind": "dataformat",
+ "name": "pqc",
+ "title": "PQC (Post-Quantum Cryptography)",
+ "description": "Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).",
+ "deprecated": false,
+ "firstVersion": "4.16.0",
+ "label": "dataformat,transformation,security",
+ "javaType": "org.apache.camel.component.pqc.PQCDataFormat",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-pqc",
+ "version": "4.16.0-SNAPSHOT",
+ "modelName": "pqc",
+ "modelJavaType": "org.apache.camel.model.dataformat.PQCDataFormat"
+ },
+ "properties": {
+ "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": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MLKEM", "description": "The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER, FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER" },
+ "symmetricKeyAlgorithm": { "index": 2, "kind": "attribute", "displayName": "Symmetric Key Algorithm", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AES", "description": "The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5, CAMELLIA, CAST5, CAST6, CHACHA7539, etc." },
+ "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." },
+ "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 register to use for KEM operations." },
+ "bufferSize": { "index": 5, "kind": "attribute", "displayName": "Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 4096, "description": "The size of the buffer used for streaming encryption\/decryption." },
+ "provider": { "index": 6, "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": 7, "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 register for KEM operations." }
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
index 18b851a47309..9672a491283e 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
@@ -134,6 +134,7 @@ policy
poll
pollEnrich
post
+pqc
predicateValidator
process
property
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
new file mode 100644
index 000000000000..c228ea88aaf6
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pqc.json
@@ -0,0 +1,25 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "pqc",
+ "title": "PQC (Post-Quantum Cryptography)",
+ "description": "Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).",
+ "deprecated": false,
+ "firstVersion": "4.16.0",
+ "label": "dataformat,transformation,security",
+ "javaType": "org.apache.camel.model.dataformat.PQCDataFormat",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "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": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MLKEM", "description": "The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER, FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER" },
+ "symmetricKeyAlgorithm": { "index": 2, "kind": "attribute", "displayName": "Symmetric Key Algorithm", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AES", "description": "The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5, CAMELLIA, CAST5, CAST6, CHACHA7539, etc." },
+ "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." },
+ "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 register to use for KEM operations." },
+ "bufferSize": { "index": 5, "kind": "attribute", "displayName": "Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 4096, "description": "The size of the buffer used for streaming encryption\/decryption." },
+ "provider": { "index": 6, "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": 7, "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 register 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 5a71c2266797..bbdab286aff5 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
@@ -1323,6 +1323,15 @@ Enriches messages with data polled from a secondary resource
<xs:documentation xml:lang="en">
<![CDATA[
Rest POST command
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="pqc" type="tns:pqcDataFormat">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).
]]>
</xs:documentation>
</xs:annotation>
@@ -17200,6 +17209,78 @@ Set a reference to a custom Expression to use.
</xs:choice>
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="pqcDataFormat">
+ <xs:complexContent>
+ <xs:extension base="tns:dataFormat">
+ <xs:sequence/>
+ <xs:attribute name="keyEncapsulationAlgorithm" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER, FRODO,
+NTRU, NTRULPRime, SNTRUPrime, KYBER. Default value: MLKEM
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="symmetricKeyAlgorithm" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5, CAMELLIA,
+CAST5, CAST6, CHACHA7539, etc. Default value: AES
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="symmetricKeyLength" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The length (in bits) of the symmetric key. Default value: 128
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="keyPair" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+Refers to the KeyPair to lookup from the register to use for KEM operations.
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="bufferSize" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The size of the buffer used for streaming encryption/decryption. Default value: 4096
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="provider" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The JCE security provider to use.
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="keyGenerator" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+Refers to a custom KeyGenerator to lookup from the register for KEM operations.
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
<xs:complexType name="cSimpleExpression">
<xs:simpleContent>
<xs:extension base="tns:typedExpressionDefinition"/>
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 665a94c67ad4..3e382bffa755 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
@@ -1260,6 +1260,15 @@ Enriches messages with data polled from a secondary resource
<xs:documentation xml:lang="en">
<![CDATA[
Rest POST command
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="pqc" type="tns:pqcDataFormat">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).
]]>
</xs:documentation>
</xs:annotation>
@@ -15894,6 +15903,78 @@ Set a reference to a custom Expression to use.
</xs:choice>
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="pqcDataFormat">
+ <xs:complexContent>
+ <xs:extension base="tns:dataFormat">
+ <xs:sequence/>
+ <xs:attribute name="keyEncapsulationAlgorithm" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER, FRODO,
+NTRU, NTRULPRime, SNTRUPrime, KYBER. Default value: MLKEM
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="symmetricKeyAlgorithm" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5, CAMELLIA,
+CAST5, CAST6, CHACHA7539, etc. Default value: AES
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="symmetricKeyLength" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The length (in bits) of the symmetric key. Default value: 128
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="keyPair" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+Refers to the KeyPair to lookup from the register to use for KEM operations.
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="bufferSize" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The size of the buffer used for streaming encryption/decryption. Default value: 4096
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="provider" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+The JCE security provider to use.
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="keyGenerator" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+<![CDATA[
+Refers to a custom KeyGenerator to lookup from the register for KEM operations.
+]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
<xs:complexType name="cSimpleExpression">
<xs:simpleContent>
<xs:extension base="tns:typedExpressionDefinition"/>
diff --git a/components/camel-pqc/src/generated/java/org/apache/camel/component/pqc/PQCDataFormatConfigurer.java b/components/camel-pqc/src/generated/java/org/apache/camel/component/pqc/PQCDataFormatConfigurer.java
new file mode 100644
index 000000000000..163982adcdf5
--- /dev/null
+++ b/components/camel-pqc/src/generated/java/org/apache/camel/component/pqc/PQCDataFormatConfigurer.java
@@ -0,0 +1,102 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.pqc;
+
+import javax.annotation.processing.Generated;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.PackageDataFormatMojo")
+@SuppressWarnings("unchecked")
+public class PQCDataFormatConfigurer extends org.apache.camel.support.component.PropertyConfigurerSupport implements GeneratedPropertyConfigurer, ExtendedPropertyConfigurerGetter {
+
+ private static final Map<String, Object> ALL_OPTIONS;
+ static {
+ Map<String, Object> map = new CaseInsensitiveMap();
+ map.put("BufferSize", int.class);
+ map.put("KeyEncapsulationAlgorithm", java.lang.String.class);
+ map.put("KeyGenerator", javax.crypto.KeyGenerator.class);
+ map.put("KeyPair", java.security.KeyPair.class);
+ map.put("Provider", java.lang.String.class);
+ map.put("SymmetricKeyAlgorithm", java.lang.String.class);
+ map.put("SymmetricKeyLength", int.class);
+ ALL_OPTIONS = map;
+ }
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+ PQCDataFormat target = (PQCDataFormat) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "buffersize":
+ case "bufferSize": target.setBufferSize(property(camelContext, int.class, value)); return true;
+ case "keyencapsulationalgorithm":
+ case "keyEncapsulationAlgorithm": target.setKeyEncapsulationAlgorithm(property(camelContext, java.lang.String.class, value)); return true;
+ case "keygenerator":
+ case "keyGenerator": target.setKeyGenerator(property(camelContext, javax.crypto.KeyGenerator.class, value)); return true;
+ case "keypair":
+ case "keyPair": target.setKeyPair(property(camelContext, java.security.KeyPair.class, value)); return true;
+ case "provider": target.setProvider(property(camelContext, java.lang.String.class, value)); return true;
+ case "symmetrickeyalgorithm":
+ case "symmetricKeyAlgorithm": target.setSymmetricKeyAlgorithm(property(camelContext, java.lang.String.class, value)); return true;
+ case "symmetrickeylength":
+ case "symmetricKeyLength": target.setSymmetricKeyLength(property(camelContext, int.class, value)); return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public Map<String, Object> getAllOptions(Object target) {
+ return ALL_OPTIONS;
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "buffersize":
+ case "bufferSize": return int.class;
+ case "keyencapsulationalgorithm":
+ case "keyEncapsulationAlgorithm": return java.lang.String.class;
+ case "keygenerator":
+ case "keyGenerator": return javax.crypto.KeyGenerator.class;
+ case "keypair":
+ case "keyPair": return java.security.KeyPair.class;
+ case "provider": return java.lang.String.class;
+ case "symmetrickeyalgorithm":
+ case "symmetricKeyAlgorithm": return java.lang.String.class;
+ case "symmetrickeylength":
+ case "symmetricKeyLength": return int.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ PQCDataFormat target = (PQCDataFormat) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "buffersize":
+ case "bufferSize": return target.getBufferSize();
+ case "keyencapsulationalgorithm":
+ case "keyEncapsulationAlgorithm": return target.getKeyEncapsulationAlgorithm();
+ case "keygenerator":
+ case "keyGenerator": return target.getKeyGenerator();
+ case "keypair":
+ case "keyPair": return target.getKeyPair();
+ case "provider": return target.getProvider();
+ case "symmetrickeyalgorithm":
+ case "symmetricKeyAlgorithm": return target.getSymmetricKeyAlgorithm();
+ case "symmetrickeylength":
+ case "symmetricKeyLength": return target.getSymmetricKeyLength();
+ default: return null;
+ }
+ }
+}
+
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 c9b8c6b29537..f812dc3ab61d 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
@@ -1,78 +1,28 @@
{
- "component": {
- "kind": "component",
+ "dataformat": {
+ "kind": "dataformat",
"name": "pqc",
- "title": "PQC Algorithms",
- "description": "Post Quantum Cryptography Signature and Verification component.",
+ "title": "PQC (Post-Quantum Cryptography)",
+ "description": "Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).",
"deprecated": false,
- "firstVersion": "4.12.0",
- "label": "security",
- "javaType": "org.apache.camel.component.pqc.PQCComponent",
- "supportLevel": "Stable",
+ "firstVersion": "4.16.0",
+ "label": "dataformat,transformation,security",
+ "javaType": "org.apache.camel.component.pqc.PQCDataFormat",
+ "supportLevel": "Preview",
"groupId": "org.apache.camel",
"artifactId": "camel-pqc",
"version": "4.16.0-SNAPSHOT",
- "scheme": "pqc",
- "extendsScheme": "",
- "syntax": "pqc:label",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": true,
- "lenientProperties": false,
- "browsable": false,
- "remote": true
- },
- "componentProperties": {
- "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.pqc.PQCConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
- "lazyStartProducer": { "index": 1, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
- "operation": { "index": 2, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.pqc.PQCOperations", "enum": [ "sign", "verify", "generateSecretKeyEncapsulation", "extractSecretKeyEncapsulation", "extractSecretKeyFromEncapsulation", "getRemainingSignatures", "getKeyState", "deleteKeyState", "generateKeyPair", "exportKey", "importKey", "rotateKey", "getKeyMetadata", "listKeys", "expir [...]
- "autowiredEnabled": { "index": 3, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...]
- "keyEncapsulationAlgorithm": { "index": 4, "kind": "property", "displayName": "Key Encapsulation Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLKEM", "BIKE", "HQC", "CMCE", "SABER", "FRODO", "NTRU", "NTRULPRime", "SNTRUPrime", "KYBER" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configur [...]
- "keyGenerator": { "index": 5, "kind": "property", "displayName": "Key Generator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.crypto.KeyGenerator", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The Key Generator to be used in encapsulation and extraction" },
- "keyPair": { "index": 6, "kind": "property", "displayName": "Key Pair", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.KeyPair", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The KeyPair to be used" },
- "keyPairAlias": { "index": 7, "kind": "property", "displayName": "Key Pair Alias", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "A KeyPair alias to use in combination with KeyStore parameter" },
- "keyStore": { "index": 8, "kind": "property", "displayName": "Key Store", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.KeyStore", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "A KeyStore where we could get Cryptographic material" },
- "keyStorePassword": { "index": 9, "kind": "property", "displayName": "Key Store Password", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The KeyStore password to use in combination with KeyStore Parameter" },
- "signatureAlgorithm": { "index": 10, "kind": "property", "displayName": "Signature Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLDSA", "SLHDSA", "LMS", "HSS", "XMSS", "XMSSMT", "DILITHIUM", "FALCON", "PICNIC", "SNOVA", "MAYO", "SPHINCSPLUS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "c [...]
- "signer": { "index": 11, "kind": "property", "displayName": "Signer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.Signature", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The Signer to be used" },
- "storeExtractedSecretKeyAsHeader": { "index": 12, "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 [...]
- "symmetricKeyAlgorithm": { "index": 13, "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": 14, "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" },
- "healthCheckConsumerEnabled": { "index": 15, "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": 16, "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 [...]
- },
- "headers": {
- "CamelPQCOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform", "constantName": "org.apache.camel.component.pqc.PQCConstants#OPERATION" },
- "CamelPQCSignature": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The signature of a body", "constantName": "org.apache.camel.component.pqc.PQCConstants#SIGNATURE" },
- "CamelPQCVerification": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The result of verification of a Body signature", "constantName": "org.apache.camel.component.pqc.PQCConstants#VERIFY" },
- "CamelPQCSecretKey": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The extracted key in case of extractSecretKeyFromEncapsulation operation and storeExtractedSecretKeyAsHeader option enabled", "constantName": "org.apache.camel.component.pqc.PQCConstants#SECRET_KEY" },
- "CamelPQCRemainingSignatures": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remaining signatures for a stateful key", "constantName": "org.apache.camel.component.pqc.PQCConstants#REMAINING_SIGNATURES" },
- "CamelPQCKeyState": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.pqc.stateful.StatefulKeyState", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The key state for a stateful key", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_STATE" },
- "CamelPQCKeyId": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The key ID for stateful key operations", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_ID" },
- "CamelPQCKeyPair": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.security.KeyPair", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The generated key pair", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_PAIR" },
- "CamelPQCKeyFormat": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The key format for import\/export operations", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_FORMAT" },
- "CamelPQCExportedKey": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exported key data", "constantName": "org.apache.camel.component.pqc.PQCConstants#EXPORTED_KEY" },
- "CamelPQCKeyMetadata": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.pqc.lifecycle.KeyMetadata", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The key metadata", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_METADATA" },
- "CamelPQCKeyList": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.util.List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List of key metadata", "constantName": "org.apache.camel.component.pqc.PQCConstants#KEY_LIST" },
- "CamelPQCAlgorithm": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The algorithm for key generation", "constantName": "org.apache.camel.component.pqc.PQCConstants#ALGORITHM" },
- "CamelPQCIncludePrivate": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Include private key in export", "constantName": "org.apache.camel.component.pqc.PQCConstants#INCLUDE_PRIVATE" },
- "CamelPQCRevocationReason": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Revocation reason", "constantName": "org.apache.camel.component.pqc.PQCConstants#REVOCATION_REASON" }
+ "modelName": "pqc",
+ "modelJavaType": "org.apache.camel.model.dataformat.PQCDataFormat"
},
"properties": {
- "label": { "index": 0, "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "Logical name" },
- "operation": { "index": 1, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.pqc.PQCOperations", "enum": [ "sign", "verify", "generateSecretKeyEncapsulation", "extractSecretKeyEncapsulation", "extractSecretKeyFromEncapsulation", "getRemainingSignatures", "getKeyState", "deleteKeyState", "generateKeyPair", "exportKey", "importKey", "rotateKey", "getKeyMetadata", "listKeys", "expi [...]
- "lazyStartProducer": { "index": 2, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...]
- "keyEncapsulationAlgorithm": { "index": 3, "kind": "parameter", "displayName": "Key Encapsulation Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLKEM", "BIKE", "HQC", "CMCE", "SABER", "FRODO", "NTRU", "NTRULPRime", "SNTRUPrime", "KYBER" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configu [...]
- "keyGenerator": { "index": 4, "kind": "parameter", "displayName": "Key Generator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.crypto.KeyGenerator", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The Key Generator to be used in encapsulation and extraction" },
- "keyPair": { "index": 5, "kind": "parameter", "displayName": "Key Pair", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.KeyPair", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The KeyPair to be used" },
- "keyPairAlias": { "index": 6, "kind": "parameter", "displayName": "Key Pair Alias", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "A KeyPair alias to use in combination with KeyStore parameter" },
- "keyStore": { "index": 7, "kind": "parameter", "displayName": "Key Store", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.KeyStore", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "A KeyStore where we could get Cryptographic material" },
- "keyStorePassword": { "index": 8, "kind": "parameter", "displayName": "Key Store Password", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The KeyStore password to use in combination with KeyStore Parameter" },
- "signatureAlgorithm": { "index": 9, "kind": "parameter", "displayName": "Signature Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "MLDSA", "SLHDSA", "LMS", "HSS", "XMSS", "XMSSMT", "DILITHIUM", "FALCON", "PICNIC", "SNOVA", "MAYO", "SPHINCSPLUS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "c [...]
- "signer": { "index": 10, "kind": "parameter", "displayName": "Signer", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.security.Signature", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.pqc.PQCConfiguration", "configurationField": "configuration", "description": "The Signer to be used" },
- "storeExtractedSecretKeyAsHeader": { "index": 11, "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 [...]
- "symmetricKeyAlgorithm": { "index": 12, "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": 13, "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" }
+ "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": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MLKEM", "description": "The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER, FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER" },
+ "symmetricKeyAlgorithm": { "index": 2, "kind": "attribute", "displayName": "Symmetric Key Algorithm", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AES", "description": "The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5, CAMELLIA, CAST5, CAST6, CHACHA7539, etc." },
+ "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." },
+ "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 register to use for KEM operations." },
+ "bufferSize": { "index": 5, "kind": "attribute", "displayName": "Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 4096, "description": "The size of the buffer used for streaming encryption\/decryption." },
+ "provider": { "index": 6, "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": 7, "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 register for KEM operations." }
}
}
diff --git a/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/configurer/pqc-dataformat b/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/configurer/pqc-dataformat
new file mode 100644
index 000000000000..8d8ff5be74d3
--- /dev/null
+++ b/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/configurer/pqc-dataformat
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.pqc.PQCDataFormatConfigurer
diff --git a/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties b/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties
new file mode 100644
index 000000000000..f86c16e6209e
--- /dev/null
+++ b/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+dataFormats=pqc
+groupId=org.apache.camel
+artifactId=camel-pqc
+version=4.16.0-SNAPSHOT
+projectName=Camel :: PQC
+projectDescription=Execute different Signature and verification using Post Quantum Cryptography algorithms
diff --git a/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/dataformat/pqc b/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/dataformat/pqc
new file mode 100644
index 000000000000..620d5c22e76f
--- /dev/null
+++ b/components/camel-pqc/src/generated/resources/META-INF/services/org/apache/camel/dataformat/pqc
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.pqc.PQCDataFormat
diff --git a/components/camel-pqc/src/main/docs/pqc-component.adoc b/components/camel-pqc/src/main/docs/pqc-component.adoc
index 37f64264d863..34bd0990067f 100644
--- a/components/camel-pqc/src/main/docs/pqc-component.adoc
+++ b/components/camel-pqc/src/main/docs/pqc-component.adoc
@@ -1830,4 +1830,533 @@ for (KeyMetadata metadata : keys) {
logger.info("Migrated {} keys to file-based storage", keys.size());
--------------------------------------------------------------------------------
+== PQC DataFormat
+
+The PQC component also provides a DataFormat for quantum-resistant encryption and decryption of message payloads using Key Encapsulation Mechanisms (KEM).
+
+=== Overview
+
+The PQC DataFormat simplifies quantum-resistant encryption by combining:
+
+1. **Key Encapsulation Mechanism (KEM)** - Uses PQC algorithms (ML-KEM, BIKE, NTRU, etc.) to establish a shared secret
+2. **Symmetric Encryption** - Encrypts data with the shared secret using standard algorithms (AES, Camellia, etc.)
+3. **Automatic Key Management** - Handles encapsulation/decapsulation transparently
+
+This approach provides **defense-in-depth**: even if the symmetric algorithm is compromised, the shared secret is protected by quantum-resistant KEM.
+
+=== Benefits
+
+* **Simplified API** - Single marshal/unmarshal operation instead of multiple KEM steps
+* **Streaming Support** - Efficient encryption/decryption of large payloads
+* **Header-based Configuration** - Dynamic algorithm and key selection per message
+* **Standards-based** - Uses NIST-standardized ML-KEM and other PQC algorithms
+* **Drop-in Replacement** - Compatible with existing Camel DataFormat patterns
+
+=== Wire Format
+
+The encrypted message format is:
+
+[source,text]
+--------------------------------------------------------------------------------
+[4 bytes: encapsulation length] [N bytes: encapsulation] [M bytes: encrypted data]
+--------------------------------------------------------------------------------
+
+This format allows the receiver to extract the encapsulation, decapsulate the shared secret using their private key, and decrypt the data.
+
+=== Basic Usage
+
+==== Java DSL
+
+[source,java]
+--------------------------------------------------------------------------------
+// Create PQC DataFormat
+PQCDataFormat pqcFormat = new PQCDataFormat();
+pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+pqcFormat.setSymmetricKeyAlgorithm("AES");
+pqcFormat.setSymmetricKeyLength(256);
+
+from("direct:encrypt")
+ .marshal(pqcFormat)
+ .to("file:encrypted");
+
+from("file:encrypted")
+ .unmarshal(pqcFormat)
+ .to("direct:decrypted");
+--------------------------------------------------------------------------------
+
+==== YAML DSL
+
+[source,yaml]
+--------------------------------------------------------------------------------
+- route:
+ id: encrypt-route
+ from:
+ uri: direct:encrypt
+ steps:
+ - marshal:
+ pqc:
+ keyEncapsulationAlgorithm: MLKEM
+ symmetricKeyAlgorithm: AES
+ symmetricKeyLength: 256
+ - to: file:encrypted
+
+- route:
+ id: decrypt-route
+ from:
+ uri: file:encrypted
+ steps:
+ - unmarshal:
+ pqc:
+ keyEncapsulationAlgorithm: MLKEM
+ symmetricKeyAlgorithm: AES
+ symmetricKeyLength: 256
+ - to: direct:decrypted
+--------------------------------------------------------------------------------
+
+=== Configuration Options
+
+[options="header"]
+|===
+|Option |Type |Default |Description
+
+|keyEncapsulationAlgorithm
+|String
+|MLKEM
+|PQC KEM algorithm (MLKEM, BIKE, HQC, CMCE, SABER, FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER)
+
+|symmetricKeyAlgorithm
+|String
+|AES
+|Symmetric encryption algorithm (AES, ARIA, RC2, RC5, CAMELLIA, CAST5, CAST6, CHACHA7539, DSTU7624, GOST28147, GRAIN128, SEED, SM4, DESEDE)
+
+|symmetricKeyLength
+|int
+|128
+|Length of the symmetric key in bits (128, 192, or 256 for AES)
+
+|keyPair
+|KeyPair
+|null
+|KeyPair to use for encryption/decryption. Can also be provided via header.
+
+|bufferSize
+|int
+|4096
+|Buffer size for streaming encryption/decryption
+
+|provider
+|String
+|null
+|JCE security provider (defaults to Bouncy Castle PQC provider)
+
+|keyGenerator
+|KeyGenerator
+|null
+|Custom KeyGenerator for KEM operations
+|===
+
+=== Registering KeyPair
+
+The DataFormat requires a KeyPair to be available either:
+
+1. Configured on the DataFormat instance
+2. Registered in the Camel Registry
+3. Provided via message header
+
+==== Option 1: Registry-based Configuration
+
+[source,java]
+--------------------------------------------------------------------------------
+@BindToRegistry("pqcKeyPair")
+public KeyPair createMLKEMKeyPair() throws Exception {
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("ML-KEM", "BCPQC");
+ kpg.initialize(MLKEMParameterSpec.ml_kem_768, new SecureRandom());
+ return kpg.generateKeyPair();
+}
+
+// DataFormat will automatically use the registered KeyPair
+PQCDataFormat pqcFormat = new PQCDataFormat();
+pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+pqcFormat.setSymmetricKeyAlgorithm("AES");
+--------------------------------------------------------------------------------
+
+==== Option 2: Direct Configuration
+
+[source,java]
+--------------------------------------------------------------------------------
+KeyPairGenerator kpg = KeyPairGenerator.getInstance("ML-KEM", "BCPQC");
+kpg.initialize(MLKEMParameterSpec.ml_kem_768, new SecureRandom());
+KeyPair keyPair = kpg.generateKeyPair();
+
+PQCDataFormat pqcFormat = new PQCDataFormat();
+pqcFormat.setKeyPair(keyPair);
+pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+pqcFormat.setSymmetricKeyAlgorithm("AES");
+--------------------------------------------------------------------------------
+
+==== Option 3: Header-based Configuration
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:encrypt")
+ .setHeader(PQCDataFormat.KEY_PAIR, () -> generateKeyPair())
+ .marshal(pqcFormat)
+ .to("direct:encrypted");
+--------------------------------------------------------------------------------
+
+=== Supported Algorithms
+
+==== Key Encapsulation Algorithms
+
+**Standardized (NIST)**
+
+* **MLKEM** - ML-KEM (FIPS 203) - Recommended for production use
+
+**Experimental**
+
+* BIKE - Bit Flipping Key Encapsulation
+* CMCE - Classic McEliece
+* HQC - Hamming Quasi-Cyclic
+* FRODO - FrodoKEM
+* SABER - Saber KEM
+* NTRU - NTRU Encrypt
+* NTRULPRime - NTRU LPRime
+* SNTRUPrime - Streamlined NTRU Prime
+* KYBER - Kyber (pre-standardization version)
+
+==== Symmetric Encryption Algorithms
+
+* AES - Advanced Encryption Standard (recommended)
+* ARIA - Korean standard
+* RC2, RC5 - Rivest ciphers
+* CAMELLIA - Japanese standard
+* CAST5, CAST6 - CAST ciphers
+* CHACHA7539 - ChaCha stream cipher
+* DSTU7624 - Ukrainian standard
+* GOST28147 - Russian standard
+* GRAIN128 - Stream cipher
+* SEED - Korean standard
+* SM4 - Chinese standard
+* DESEDE - Triple DES
+
+=== Advanced Examples
+
+==== Secure File Transfer
+
+[source,java]
+--------------------------------------------------------------------------------
+PQCDataFormat pqcFormat = new PQCDataFormat();
+pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+pqcFormat.setSymmetricKeyAlgorithm("AES");
+pqcFormat.setSymmetricKeyLength(256);
+
+from("file:incoming?noop=true")
+ .log("Encrypting file: ${header.CamelFileName}")
+ .marshal(pqcFormat)
+ .to("file:encrypted?fileName=${header.CamelFileName}.pqc")
+ .log("File encrypted successfully");
+
+from("file:encrypted?noop=true")
+ .log("Decrypting file: ${header.CamelFileName}")
+ .unmarshal(pqcFormat)
+ .to("file:decrypted")
+ .log("File decrypted successfully");
+--------------------------------------------------------------------------------
+
+==== API Message Encryption
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:secure-api")
+ .marshal().json() // Convert to JSON
+ .marshal(pqcFormat) // Encrypt with PQC
+ .setHeader(Exchange.HTTP_METHOD, constant("POST"))
+ .to("https://api.example.com/secure-endpoint")
+ .unmarshal(pqcFormat) // Decrypt response
+ .unmarshal().json() // Parse JSON response
+ .to("direct:result");
+--------------------------------------------------------------------------------
+
+==== Multiple Algorithm Support
+
+[source,java]
+--------------------------------------------------------------------------------
+// Different algorithms for different security levels
+PQCDataFormat highSecurity = new PQCDataFormat();
+highSecurity.setKeyEncapsulationAlgorithm("MLKEM");
+highSecurity.setSymmetricKeyAlgorithm("AES");
+highSecurity.setSymmetricKeyLength(256);
+
+PQCDataFormat mediumSecurity = new PQCDataFormat();
+mediumSecurity.setKeyEncapsulationAlgorithm("KYBER");
+mediumSecurity.setSymmetricKeyAlgorithm("CAMELLIA");
+mediumSecurity.setSymmetricKeyLength(128);
+
+from("direct:classify")
+ .choice()
+ .when(header("SecurityLevel").isEqualTo("HIGH"))
+ .marshal(highSecurity)
+ .when(header("SecurityLevel").isEqualTo("MEDIUM"))
+ .marshal(mediumSecurity)
+ .otherwise()
+ .log("No encryption for low security")
+ .end()
+ .to("direct:output");
+--------------------------------------------------------------------------------
+
+==== Dynamic Algorithm Selection via Headers
+
+[source,java]
+--------------------------------------------------------------------------------
+PQCDataFormat pqcFormat = new PQCDataFormat();
+
+from("direct:dynamic-encrypt")
+ .setHeader(PQCDataFormat.KEM_ALGORITHM, constant("MLKEM"))
+ .setHeader(PQCDataFormat.SYMMETRIC_ALGORITHM, constant("AES"))
+ .marshal(pqcFormat)
+ .to("direct:encrypted");
+--------------------------------------------------------------------------------
+
+=== Integration with Key Lifecycle Management
+
+The PQC DataFormat can be integrated with the Key Lifecycle Manager for automated key management:
+
+[source,java]
+--------------------------------------------------------------------------------
+@BindToRegistry("keyLifecycleManager")
+public KeyLifecycleManager createKeyManager() {
+ return new FileBasedKeyLifecycleManager("/secure/keys");
+}
+
+@BindToRegistry("pqcKeyPair")
+public KeyPair createKeyPair() throws Exception {
+ KeyLifecycleManager manager = context.getRegistry()
+ .lookupByNameAndType("keyLifecycleManager", KeyLifecycleManager.class);
+
+ // Generate or retrieve key
+ KeyPair keyPair;
+ try {
+ keyPair = manager.getKey("dataformat-key");
+ } catch (Exception e) {
+ keyPair = manager.generateKeyPair("MLKEM", "dataformat-key",
+ MLKEMParameterSpec.ml_kem_768);
+ }
+
+ // Check if rotation needed
+ if (manager.needsRotation("dataformat-key", Duration.ofDays(90), 10000)) {
+ keyPair = manager.rotateKey("dataformat-key", "dataformat-key-new", "MLKEM");
+ }
+
+ return keyPair;
+}
+--------------------------------------------------------------------------------
+
+=== Comparison with Manual KEM Operations
+
+**Manual Approach (using PQC component endpoints):**
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:manual-encrypt")
+ .to("pqc:keyenc?operation=generateSecretKeyEncapsulation&symmetricKeyAlgorithm=AES")
+ .to("pqc:keyenc?operation=extractSecretKeyEncapsulation&symmetricKeyAlgorithm=AES")
+ .to("pqc:keyenc?operation=extractSecretKeyFromEncapsulation&symmetricKeyAlgorithm=AES")
+ .setHeader(CryptoDataFormat.KEY, body())
+ .setBody(constant("Hello"))
+ .marshal(new CryptoDataFormat("AES", null))
+ .to("direct:encrypted");
+--------------------------------------------------------------------------------
+
+**DataFormat Approach (simplified):**
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:dataformat-encrypt")
+ .setBody(constant("Hello"))
+ .marshal(new PQCDataFormat("MLKEM", "AES", keyPair))
+ .to("direct:encrypted");
+--------------------------------------------------------------------------------
+
+The DataFormat approach is significantly simpler and handles all KEM operations internally.
+
+=== Security Considerations
+
+**1. Key Management**
+
+* **Private Key Protection**: The private key must be kept secure. Consider using:
+ - Hardware Security Modules (HSMs)
+ - Secure key storage (FileBasedKeyLifecycleManager with encrypted filesystem)
+ - Cloud key management services (HashicorpVaultKeyLifecycleManager, AwsSecretsManagerKeyLifecycleManager)
+
+* **Key Rotation**: Regularly rotate keys using the Key Lifecycle Manager
+
+**2. Algorithm Selection**
+
+* **Production Use**: Use MLKEM (NIST-standardized)
+* **High Security**: Use ML-KEM-1024 parameter spec
+* **Testing**: Experimental algorithms are suitable for research and testing
+
+**3. Symmetric Algorithm**
+
+* **Recommended**: AES-256 or AES-128
+* **Avoid**: RC2, GOST28147 (legacy algorithms)
+
+**4. Wire Format Security**
+
+* The encapsulation is not secret and can be transmitted in the clear
+* The encrypted data is protected by the symmetric key
+* Use authenticated encryption modes (GCM) when available
+
+=== Performance Considerations
+
+**1. Buffer Size**
+
+Adjust bufferSize based on message size:
+
+[source,java]
+--------------------------------------------------------------------------------
+PQCDataFormat pqcFormat = new PQCDataFormat();
+pqcFormat.setBufferSize(8192); // Larger buffer for big files
+--------------------------------------------------------------------------------
+
+**2. Caching KeyGenerator**
+
+Configure a KeyGenerator once to avoid repeated initialization:
+
+[source,java]
+--------------------------------------------------------------------------------
+@BindToRegistry("kemKeyGenerator")
+public KeyGenerator createKeyGenerator() throws Exception {
+ return KeyGenerator.getInstance("ML-KEM", "BCPQC");
+}
+
+PQCDataFormat pqcFormat = new PQCDataFormat();
+pqcFormat.setKeyGenerator(kemKeyGenerator);
+--------------------------------------------------------------------------------
+
+**3. Streaming**
+
+The DataFormat supports streaming for large payloads, avoiding memory issues:
+
+[source,java]
+--------------------------------------------------------------------------------
+from("file:large-files?noop=true")
+ .streamCaching() // Enable stream caching if needed
+ .marshal(pqcFormat)
+ .to("file:encrypted");
+--------------------------------------------------------------------------------
+
+=== Testing
+
+Example test demonstrating round-trip encryption/decryption:
+
+[source,java]
+--------------------------------------------------------------------------------
+@Test
+void testPQCDataFormatRoundTrip() throws Exception {
+ // Setup
+ Security.addProvider(new BouncyCastleProvider());
+ Security.addProvider(new BouncyCastlePQCProvider());
+
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("ML-KEM", "BCPQC");
+ kpg.initialize(MLKEMParameterSpec.ml_kem_512, new SecureRandom());
+ KeyPair keyPair = kpg.generateKeyPair();
+
+ PQCDataFormat pqcFormat = new PQCDataFormat();
+ pqcFormat.setKeyPair(keyPair);
+ pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+ pqcFormat.setSymmetricKeyAlgorithm("AES");
+
+ // Create route
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .marshal(pqcFormat)
+ .to("mock:encrypted")
+ .unmarshal(pqcFormat)
+ .to("mock:decrypted");
+ }
+ });
+
+ // Test
+ String original = "Sensitive data";
+ template.sendBody("direct:start", original);
+
+ MockEndpoint encrypted = getMockEndpoint("mock:encrypted");
+ MockEndpoint decrypted = getMockEndpoint("mock:decrypted");
+
+ encrypted.assertIsSatisfied();
+ decrypted.assertIsSatisfied();
+
+ byte[] encryptedBody = encrypted.getExchanges().get(0).getMessage().getBody(byte[].class);
+ assertNotEquals(original, new String(encryptedBody));
+
+ String decryptedBody = decrypted.getExchanges().get(0).getMessage().getBody(String.class);
+ assertEquals(original, decryptedBody);
+}
+--------------------------------------------------------------------------------
+
+=== Troubleshooting
+
+**Issue**: `IllegalStateException: A valid KeyPair with public key is required`
+
+* **Solution**: Ensure KeyPair is registered in registry or configured on DataFormat
+
+**Issue**: `NoSuchAlgorithmException`
+
+* **Solution**: Add Bouncy Castle providers:
++
+[source,java]
+--------------------------------------------------------------------------------
+Security.addProvider(new BouncyCastleProvider());
+Security.addProvider(new BouncyCastlePQCProvider());
+--------------------------------------------------------------------------------
+
+**Issue**: Decryption fails with corrupted data
+
+* **Solution**: Ensure the same KeyPair is used for encryption and decryption
+* **Solution**: Verify encapsulation is not being corrupted during transmission
+
+**Issue**: OutOfMemoryError with large files
+
+* **Solution**: Increase buffer size or enable stream caching:
++
+[source,java]
+--------------------------------------------------------------------------------
+pqcFormat.setBufferSize(16384);
+// or
+from("file:large").streamCaching().marshal(pqcFormat)...
+--------------------------------------------------------------------------------
+
+=== Dependencies
+
+The PQC DataFormat is included in the camel-pqc component. Ensure you have:
+
+[source,xml]
+--------------------------------------------------------------------------------
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-pqc</artifactId>
+ <version>${camel.version}</version>
+</dependency>
+
+<!-- Bouncy Castle PQC provider -->
+<dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk18on</artifactId>
+ <version>${bouncycastle.version}</version>
+</dependency>
+<dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk18on</artifactId>
+ <version>${bouncycastle.version}</version>
+</dependency>
+<dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpqc-jdk18on</artifactId>
+ <version>${bouncycastle.version}</version>
+</dependency>
+--------------------------------------------------------------------------------
+
include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCDataFormat.java b/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCDataFormat.java
new file mode 100644
index 000000000000..60ee9e3b35dc
--- /dev/null
+++ b/components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCDataFormat.java
@@ -0,0 +1,385 @@
+/*
+ * 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.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.KeyPair;
+import java.security.SecureRandom;
+
+import javax.crypto.Cipher;
+import javax.crypto.CipherInputStream;
+import javax.crypto.CipherOutputStream;
+import javax.crypto.KeyGenerator;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.DataFormat;
+import org.apache.camel.spi.DataFormatName;
+import org.apache.camel.spi.annotations.Dataformat;
+import org.apache.camel.support.ExchangeHelper;
+import org.apache.camel.support.builder.OutputStreamBuilder;
+import org.apache.camel.support.service.ServiceSupport;
+import org.apache.camel.util.IOHelper;
+import org.bouncycastle.jcajce.SecretKeyWithEncapsulation;
+import org.bouncycastle.jcajce.spec.KEMExtractSpec;
+import org.bouncycastle.jcajce.spec.KEMGenerateSpec;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * PQCDataFormat uses Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM) to securely encrypt and decrypt
+ * message payloads.
+ *
+ * <p>
+ * This DataFormat provides quantum-resistant encryption by:
+ * </p>
+ * <ul>
+ * <li>Using KEM algorithms (ML-KEM, BIKE, etc.) to establish a shared secret</li>
+ * <li>Encrypting data with symmetric algorithms (AES, Camellia, etc.) using the shared secret</li>
+ * <li>Including the encapsulated key in the output stream for decryption</li>
+ * </ul>
+ *
+ * <p>
+ * The encrypted message format is:
+ * </p>
+ *
+ * <pre>
+ * [4 bytes: encapsulation length] [N bytes: encapsulation] [M bytes: encrypted data]
+ * </pre>
+ *
+ * <p>
+ * Example usage:
+ * </p>
+ *
+ * <pre>
+ * PQCDataFormat pqcFormat = new PQCDataFormat();
+ * pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+ * pqcFormat.setSymmetricKeyAlgorithm("AES");
+ * pqcFormat.setKeyPair(keyPair);
+ *
+ * from("direct:encrypt")
+ * .marshal(pqcFormat)
+ * .to("file:encrypted");
+ *
+ * from("file:encrypted")
+ * .unmarshal(pqcFormat)
+ * .to("direct:decrypted");
+ * </pre>
+ */
+@Dataformat("pqc")
+public class PQCDataFormat extends ServiceSupport implements DataFormat, DataFormatName {
+
+ public static final String KEY_PAIR = "CamelPQCKeyPair";
+ public static final String KEM_ALGORITHM = "CamelPQCKemAlgorithm";
+ public static final String SYMMETRIC_ALGORITHM = "CamelPQCSymmetricAlgorithm";
+
+ private static final Logger LOG = LoggerFactory.getLogger(PQCDataFormat.class);
+
+ private String keyEncapsulationAlgorithm = "MLKEM";
+ private String symmetricKeyAlgorithm = "AES";
+ private int symmetricKeyLength = 128;
+ private KeyPair keyPair;
+ private int bufferSize = 4096;
+ private String provider;
+ private KeyGenerator keyGenerator;
+
+ public PQCDataFormat() {
+ }
+
+ public PQCDataFormat(String keyEncapsulationAlgorithm, String symmetricKeyAlgorithm, KeyPair keyPair) {
+ this.keyEncapsulationAlgorithm = keyEncapsulationAlgorithm;
+ this.symmetricKeyAlgorithm = symmetricKeyAlgorithm;
+ this.keyPair = keyPair;
+ }
+
+ @Override
+ public String getDataFormatName() {
+ return "pqc";
+ }
+
+ @Override
+ public void marshal(Exchange exchange, Object graph, OutputStream outputStream) throws Exception {
+ KeyPair kp = getKeyPair(exchange);
+ if (kp == null || kp.getPublic() == null) {
+ throw new IllegalStateException(
+ "A valid KeyPair with public key is required for encryption. " +
+ "Either configure the PQCDataFormat with a KeyPair or provide one in a header using '"
+ + KEY_PAIR + "'");
+ }
+
+ String kemAlg = getKemAlgorithm(exchange);
+ String symAlg = getSymmetricAlgorithm(exchange);
+
+ InputStream plaintextStream = ExchangeHelper.convertToMandatoryType(exchange, InputStream.class, graph);
+
+ try {
+ // Generate KEM encapsulation and shared secret
+ KeyGenerator kg = getOrCreateKeyGenerator(kemAlg);
+ kg.init(
+ new KEMGenerateSpec(kp.getPublic(), symAlg, symmetricKeyLength),
+ new SecureRandom());
+
+ SecretKeyWithEncapsulation secretKey = (SecretKeyWithEncapsulation) kg.generateKey();
+ byte[] encapsulation = secretKey.getEncapsulation();
+
+ // Write encapsulation length and data
+ DataOutputStream dataOut = new DataOutputStream(outputStream);
+ dataOut.writeInt(encapsulation.length);
+ outputStream.write(encapsulation);
+ outputStream.flush();
+
+ // Encrypt data with the shared secret
+ Cipher cipher = Cipher.getInstance(symAlg);
+ cipher.init(Cipher.ENCRYPT_MODE, secretKey);
+
+ byte[] buffer = new byte[bufferSize];
+ int read;
+ CipherOutputStream cipherStream = null;
+ try {
+ cipherStream = new CipherOutputStream(outputStream, cipher);
+ while ((read = plaintextStream.read(buffer)) > 0) {
+ cipherStream.write(buffer, 0, read);
+ cipherStream.flush();
+ }
+ } finally {
+ IOHelper.close(cipherStream, "cipher", LOG);
+ IOHelper.close(plaintextStream, "plaintext", LOG);
+ }
+ } catch (Exception e) {
+ throw new IOException("Failed to encrypt data using PQC KEM", e);
+ }
+ }
+
+ @Override
+ public Object unmarshal(Exchange exchange, InputStream encryptedStream) throws Exception {
+ if (encryptedStream == null) {
+ return null;
+ }
+
+ KeyPair kp = getKeyPair(exchange);
+ if (kp == null || kp.getPrivate() == null) {
+ throw new IllegalStateException(
+ "A valid KeyPair with private key is required for decryption. " +
+ "Either configure the PQCDataFormat with a KeyPair or provide one in a header using '"
+ + KEY_PAIR + "'");
+ }
+
+ String kemAlg = getKemAlgorithm(exchange);
+ String symAlg = getSymmetricAlgorithm(exchange);
+
+ CipherInputStream cipherStream = null;
+ OutputStreamBuilder osb = null;
+
+ try {
+ // Read encapsulation from stream
+ DataInputStream dataIn = new DataInputStream(encryptedStream);
+ int encapsulationLength = dataIn.readInt();
+ byte[] encapsulation = new byte[encapsulationLength];
+ int read = encryptedStream.read(encapsulation);
+ if (read != encapsulationLength) {
+ throw new IOException(
+ String.format("Expected to read %d bytes of encapsulation but got %d bytes",
+ encapsulationLength, read));
+ }
+
+ // Extract secret key from encapsulation
+ KeyGenerator kg = getOrCreateKeyGenerator(kemAlg);
+ kg.init(
+ new KEMExtractSpec(kp.getPrivate(), encapsulation, symAlg, symmetricKeyLength),
+ new SecureRandom());
+
+ SecretKeyWithEncapsulation secretKey = (SecretKeyWithEncapsulation) kg.generateKey();
+
+ // Decrypt data with the extracted secret
+ Cipher cipher = Cipher.getInstance(symAlg);
+ cipher.init(Cipher.DECRYPT_MODE, secretKey);
+
+ cipherStream = new CipherInputStream(encryptedStream, cipher);
+ osb = OutputStreamBuilder.withExchange(exchange);
+ byte[] buffer = new byte[bufferSize];
+ while ((read = cipherStream.read(buffer)) >= 0) {
+ osb.write(buffer, 0, read);
+ }
+
+ return osb.build();
+ } catch (Exception e) {
+ throw new IOException("Failed to decrypt data using PQC KEM", e);
+ } finally {
+ IOHelper.close(cipherStream, "cipher", LOG);
+ IOHelper.close(osb, "plaintext", LOG);
+ }
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ if (keyEncapsulationAlgorithm != null && keyGenerator == null) {
+ PQCKeyEncapsulationAlgorithms kemEnum = PQCKeyEncapsulationAlgorithms.valueOf(keyEncapsulationAlgorithm);
+ String algorithm = kemEnum.getAlgorithm();
+ String bcProvider = kemEnum.getBcProvider();
+
+ if (provider != null) {
+ keyGenerator = KeyGenerator.getInstance(algorithm, provider);
+ } else if (bcProvider != null) {
+ keyGenerator = KeyGenerator.getInstance(algorithm, bcProvider);
+ } else {
+ keyGenerator = KeyGenerator.getInstance(algorithm);
+ }
+ }
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ // noop
+ }
+
+ private KeyPair getKeyPair(Exchange exchange) {
+ KeyPair kp = exchange.getIn().getHeader(KEY_PAIR, KeyPair.class);
+ if (kp != null) {
+ return kp;
+ }
+ if (this.keyPair != null) {
+ return this.keyPair;
+ }
+ // Try to lookup from registry
+ return exchange.getContext().getRegistry().lookupByNameAndType("pqcKeyPair", KeyPair.class);
+ }
+
+ private String getKemAlgorithm(Exchange exchange) {
+ String alg = exchange.getIn().getHeader(KEM_ALGORITHM, String.class);
+ return alg != null ? alg : this.keyEncapsulationAlgorithm;
+ }
+
+ private String getSymmetricAlgorithm(Exchange exchange) {
+ String alg = exchange.getIn().getHeader(SYMMETRIC_ALGORITHM, String.class);
+ if (alg != null) {
+ return alg;
+ }
+
+ // Convert to BC algorithm name if it's an enum value
+ try {
+ PQCSymmetricAlgorithms symEnum = PQCSymmetricAlgorithms.valueOf(this.symmetricKeyAlgorithm);
+ return symEnum.getAlgorithm();
+ } catch (IllegalArgumentException e) {
+ // Not an enum, return as-is
+ return this.symmetricKeyAlgorithm;
+ }
+ }
+
+ private KeyGenerator getOrCreateKeyGenerator(String kemAlgorithm) throws Exception {
+ if (keyGenerator != null) {
+ return keyGenerator;
+ }
+
+ // Create a temporary key generator for this operation
+ PQCKeyEncapsulationAlgorithms kemEnum = PQCKeyEncapsulationAlgorithms.valueOf(kemAlgorithm);
+ String algorithm = kemEnum.getAlgorithm();
+ String bcProvider = kemEnum.getBcProvider();
+
+ if (provider != null) {
+ return KeyGenerator.getInstance(algorithm, provider);
+ } else if (bcProvider != null) {
+ return KeyGenerator.getInstance(algorithm, bcProvider);
+ } else {
+ return KeyGenerator.getInstance(algorithm);
+ }
+ }
+
+ // Getters and Setters
+
+ public String getKeyEncapsulationAlgorithm() {
+ return keyEncapsulationAlgorithm;
+ }
+
+ /**
+ * Sets the Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE,
+ * SABER, FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER
+ */
+ public void setKeyEncapsulationAlgorithm(String keyEncapsulationAlgorithm) {
+ this.keyEncapsulationAlgorithm = keyEncapsulationAlgorithm;
+ }
+
+ public String getSymmetricKeyAlgorithm() {
+ return symmetricKeyAlgorithm;
+ }
+
+ /**
+ * Sets the symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5,
+ * CAMELLIA, CAST5, CAST6, CHACHA7539, etc.
+ */
+ public void setSymmetricKeyAlgorithm(String symmetricKeyAlgorithm) {
+ this.symmetricKeyAlgorithm = symmetricKeyAlgorithm;
+ }
+
+ public int getSymmetricKeyLength() {
+ return symmetricKeyLength;
+ }
+
+ /**
+ * Sets the length (in bits) of the symmetric key. Default is 128.
+ */
+ public void setSymmetricKeyLength(int symmetricKeyLength) {
+ this.symmetricKeyLength = symmetricKeyLength;
+ }
+
+ public KeyPair getKeyPair() {
+ return keyPair;
+ }
+
+ /**
+ * Sets the KeyPair to use for KEM operations. The public key is used for encryption (marshal), the private key for
+ * decryption (unmarshal).
+ */
+ public void setKeyPair(KeyPair keyPair) {
+ this.keyPair = keyPair;
+ }
+
+ public int getBufferSize() {
+ return bufferSize;
+ }
+
+ /**
+ * Sets the buffer size for streaming encryption/decryption. Default is 4096 bytes.
+ */
+ public void setBufferSize(int bufferSize) {
+ this.bufferSize = bufferSize;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ /**
+ * Sets the JCE security provider to use. If not set, will use the provider from the KEM algorithm enum.
+ */
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public KeyGenerator getKeyGenerator() {
+ return keyGenerator;
+ }
+
+ /**
+ * Sets a custom KeyGenerator for KEM operations. If not set, one will be created based on the KEM algorithm.
+ */
+ public void setKeyGenerator(KeyGenerator keyGenerator) {
+ this.keyGenerator = keyGenerator;
+ }
+}
diff --git a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatHeaderTest.java b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatHeaderTest.java
new file mode 100644
index 000000000000..170fdbbccba0
--- /dev/null
+++ b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatHeaderTest.java
@@ -0,0 +1,122 @@
+/*
+ * 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.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.util.HashMap;
+import java.util.Map;
+
+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.test.junit5.CamelTestSupport;
+import org.bouncycastle.jcajce.spec.MLKEMParameterSpec;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests PQCDataFormat with header-based configuration
+ */
+public class PQCDataFormatHeaderTest extends CamelTestSupport {
+
+ @EndpointInject("mock:result")
+ protected MockEndpoint result;
+
+ @Produce("direct:start")
+ protected ProducerTemplate template;
+
+ private static final String ORIGINAL_MESSAGE = "Testing header-based configuration";
+ private KeyPair keyPair;
+
+ @BeforeAll
+ public static void startup() {
+ Security.addProvider(new BouncyCastleProvider());
+ Security.addProvider(new BouncyCastlePQCProvider());
+ }
+
+ @Override
+ protected void doPreSetup() throws Exception {
+ super.doPreSetup();
+ // Create key pair for testing
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(
+ PQCKeyEncapsulationAlgorithms.MLKEM.getAlgorithm(),
+ PQCKeyEncapsulationAlgorithms.MLKEM.getBcProvider());
+ kpg.initialize(MLKEMParameterSpec.ml_kem_512, new SecureRandom());
+ keyPair = kpg.generateKeyPair();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ // DataFormat without pre-configured KeyPair
+ PQCDataFormat pqcFormat = new PQCDataFormat();
+ pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+ pqcFormat.setSymmetricKeyAlgorithm("AES");
+
+ from("direct:start")
+ .marshal(pqcFormat)
+ .log("Encrypted: ${body}")
+ .unmarshal(pqcFormat)
+ .to("mock:result");
+ }
+ };
+ }
+
+ @Test
+ void testKeyPairInHeader() throws Exception {
+ result.expectedMessageCount(1);
+
+ // Send message with KeyPair in header
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(PQCDataFormat.KEY_PAIR, keyPair);
+
+ template.sendBodyAndHeaders(ORIGINAL_MESSAGE, headers);
+
+ result.assertIsSatisfied();
+
+ String decrypted = result.getExchanges().get(0).getMessage().getBody(String.class);
+ assertEquals(ORIGINAL_MESSAGE, decrypted);
+ }
+
+ @Test
+ void testDynamicAlgorithmSelection() throws Exception {
+ result.reset();
+ result.expectedMessageCount(1);
+
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(PQCDataFormat.KEY_PAIR, keyPair);
+ headers.put(PQCDataFormat.SYMMETRIC_ALGORITHM, "AES");
+
+ template.sendBodyAndHeaders(ORIGINAL_MESSAGE, headers);
+
+ result.assertIsSatisfied();
+
+ String decrypted = result.getExchanges().get(0).getMessage().getBody(String.class);
+ assertEquals(ORIGINAL_MESSAGE, decrypted);
+ }
+}
diff --git a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatIntegrationTest.java b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatIntegrationTest.java
new file mode 100644
index 000000000000..b20e0130e5b3
--- /dev/null
+++ b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatIntegrationTest.java
@@ -0,0 +1,174 @@
+/*
+ * 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.InvalidAlgorithmParameterException;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.SecureRandom;
+import java.security.Security;
+
+import org.apache.camel.BindToRegistry;
+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.test.junit5.CamelTestSupport;
+import org.bouncycastle.jcajce.spec.MLKEMParameterSpec;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Integration test demonstrating real-world usage of PQCDataFormat in a file encryption/decryption scenario
+ */
+public class PQCDataFormatIntegrationTest extends CamelTestSupport {
+
+ @EndpointInject("mock:encrypted-files")
+ protected MockEndpoint encryptedFiles;
+
+ @EndpointInject("mock:decrypted-files")
+ protected MockEndpoint decryptedFiles;
+
+ @Produce("direct:secure-channel")
+ protected ProducerTemplate secureChannel;
+
+ @BeforeAll
+ public static void startup() {
+ Security.addProvider(new BouncyCastleProvider());
+ Security.addProvider(new BouncyCastlePQCProvider());
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ // Define PQC DataFormat for quantum-resistant encryption
+ PQCDataFormat pqcFormat = new PQCDataFormat();
+ pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+ pqcFormat.setSymmetricKeyAlgorithm("AES");
+ pqcFormat.setSymmetricKeyLength(256);
+
+ // Simulated secure channel: encrypt -> transmit -> decrypt
+ from("direct:secure-channel")
+ .log("Original message: ${body}")
+ .marshal(pqcFormat)
+ .log("Message encrypted with PQC (size: ${body.length} bytes)")
+ .to("mock:encrypted-files")
+ // Simulating transmission/storage...
+ .unmarshal(pqcFormat)
+ .log("Message decrypted: ${body}")
+ .to("mock:decrypted-files");
+
+ // Alternative route: Encrypt-at-rest scenario
+ from("direct:encrypt-at-rest")
+ .marshal(pqcFormat)
+ .to("mock:storage");
+
+ from("direct:decrypt-from-storage")
+ .unmarshal(pqcFormat)
+ .to("mock:retrieved");
+ }
+ };
+ }
+
+ @Test
+ void testSecureChannelEncryption() throws Exception {
+ encryptedFiles.expectedMessageCount(1);
+ decryptedFiles.expectedMessageCount(1);
+
+ String sensitiveData = "TOP SECRET: This message contains sensitive information protected by PQC.";
+
+ secureChannel.sendBody(sensitiveData);
+
+ encryptedFiles.assertIsSatisfied();
+ decryptedFiles.assertIsSatisfied();
+
+ // Verify the message was successfully decrypted
+ String decrypted = decryptedFiles.getExchanges().get(0).getMessage().getBody(String.class);
+ assertEquals(sensitiveData, decrypted);
+ }
+
+ @Test
+ void testMultipleMessagesInSequence() throws Exception {
+ encryptedFiles.reset();
+ decryptedFiles.reset();
+
+ int messageCount = 5;
+ encryptedFiles.expectedMessageCount(messageCount);
+ decryptedFiles.expectedMessageCount(messageCount);
+
+ for (int i = 0; i < messageCount; i++) {
+ String message = "Message #" + i + ": Testing PQC DataFormat with sequential messages";
+ secureChannel.sendBody(message);
+ }
+
+ encryptedFiles.assertIsSatisfied();
+ decryptedFiles.assertIsSatisfied();
+
+ // Verify all messages were correctly decrypted
+ for (int i = 0; i < messageCount; i++) {
+ String expected = "Message #" + i + ": Testing PQC DataFormat with sequential messages";
+ String actual = decryptedFiles.getExchanges().get(i).getMessage().getBody(String.class);
+ assertEquals(expected, actual);
+ }
+ }
+
+ @Test
+ void testJsonPayloadEncryption() throws Exception {
+ encryptedFiles.reset();
+ decryptedFiles.reset();
+
+ encryptedFiles.expectedMessageCount(1);
+ decryptedFiles.expectedMessageCount(1);
+
+ String jsonPayload = """
+ {
+ "userId": "12345",
+ "action": "transfer",
+ "amount": 10000,
+ "currency": "USD",
+ "timestamp": "2025-01-15T10:30:00Z"
+ }
+ """;
+
+ secureChannel.sendBody(jsonPayload);
+
+ encryptedFiles.assertIsSatisfied();
+ decryptedFiles.assertIsSatisfied();
+
+ String decrypted = decryptedFiles.getExchanges().get(0).getMessage().getBody(String.class);
+ assertEquals(jsonPayload, decrypted);
+ }
+
+ @BindToRegistry("pqcKeyPair")
+ public KeyPair createKeyPair()
+ throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException {
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(
+ PQCKeyEncapsulationAlgorithms.MLKEM.getAlgorithm(),
+ PQCKeyEncapsulationAlgorithms.MLKEM.getBcProvider());
+ kpg.initialize(MLKEMParameterSpec.ml_kem_768, new SecureRandom());
+ return kpg.generateKeyPair();
+ }
+}
diff --git a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatMultipleAlgorithmsTest.java b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatMultipleAlgorithmsTest.java
new file mode 100644
index 000000000000..c0bbf4353a47
--- /dev/null
+++ b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatMultipleAlgorithmsTest.java
@@ -0,0 +1,103 @@
+/*
+ * 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.InvalidAlgorithmParameterException;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.SecureRandom;
+import java.security.Security;
+
+import org.apache.camel.BindToRegistry;
+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.test.junit5.CamelTestSupport;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider;
+import org.bouncycastle.pqc.jcajce.spec.KyberParameterSpec;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests PQCDataFormat with different KEM and symmetric algorithms
+ */
+public class PQCDataFormatMultipleAlgorithmsTest extends CamelTestSupport {
+
+ @EndpointInject("mock:kyber-camellia")
+ protected MockEndpoint resultKyberCamellia;
+
+ @Produce("direct:kyber-camellia")
+ protected ProducerTemplate templateKyberCamellia;
+
+ private static final String ORIGINAL_MESSAGE = "Testing different algorithms";
+
+ @BeforeAll
+ public static void startup() {
+ Security.addProvider(new BouncyCastleProvider());
+ Security.addProvider(new BouncyCastlePQCProvider());
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ // Test with Kyber + Camellia
+ PQCDataFormat kyberCamelliaFormat = new PQCDataFormat();
+ kyberCamelliaFormat.setKeyEncapsulationAlgorithm("KYBER");
+ kyberCamelliaFormat.setSymmetricKeyAlgorithm("CAMELLIA");
+ kyberCamelliaFormat.setSymmetricKeyLength(128);
+
+ from("direct:kyber-camellia")
+ .marshal(kyberCamelliaFormat)
+ .log("Encrypted with Kyber+Camellia: ${body}")
+ .unmarshal(kyberCamelliaFormat)
+ .to("mock:kyber-camellia");
+ }
+ };
+ }
+
+ @Test
+ void testKyberWithCamellia() throws Exception {
+ resultKyberCamellia.expectedMessageCount(1);
+
+ templateKyberCamellia.sendBody(ORIGINAL_MESSAGE);
+
+ resultKyberCamellia.assertIsSatisfied();
+
+ String decrypted = resultKyberCamellia.getExchanges().get(0).getMessage().getBody(String.class);
+ assertEquals(ORIGINAL_MESSAGE, decrypted);
+ }
+
+ @BindToRegistry("pqcKeyPair")
+ public KeyPair createKyberKeyPair()
+ throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException {
+ // This test uses Kyber, so register Kyber keypair as pqcKeyPair
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(
+ PQCKeyEncapsulationAlgorithms.KYBER.getAlgorithm(),
+ PQCKeyEncapsulationAlgorithms.KYBER.getBcProvider());
+ kpg.initialize(KyberParameterSpec.kyber512, new SecureRandom());
+ return kpg.generateKeyPair();
+ }
+}
diff --git a/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatTest.java b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatTest.java
new file mode 100644
index 000000000000..0cb7144ceee7
--- /dev/null
+++ b/components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCDataFormatTest.java
@@ -0,0 +1,139 @@
+/*
+ * 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.InvalidAlgorithmParameterException;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.SecureRandom;
+import java.security.Security;
+
+import org.apache.camel.BindToRegistry;
+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.test.junit5.CamelTestSupport;
+import org.bouncycastle.jcajce.spec.MLKEMParameterSpec;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class PQCDataFormatTest extends CamelTestSupport {
+
+ @EndpointInject("mock:encrypted")
+ protected MockEndpoint resultEncrypted;
+
+ @EndpointInject("mock:decrypted")
+ protected MockEndpoint resultDecrypted;
+
+ @Produce("direct:encrypt")
+ protected ProducerTemplate templateEncrypt;
+
+ private static final String ORIGINAL_MESSAGE = "Hello from Apache Camel with Post-Quantum Cryptography!";
+
+ @BeforeAll
+ public static void startup() {
+ Security.addProvider(new BouncyCastleProvider());
+ Security.addProvider(new BouncyCastlePQCProvider());
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ PQCDataFormat pqcFormat = new PQCDataFormat();
+ pqcFormat.setKeyEncapsulationAlgorithm("MLKEM");
+ pqcFormat.setSymmetricKeyAlgorithm("AES");
+
+ from("direct:encrypt")
+ .marshal(pqcFormat)
+ .to("mock:encrypted")
+ .unmarshal(pqcFormat)
+ .to("mock:decrypted");
+ }
+ };
+ }
+
+ @Test
+ void testBasicRoundTrip() throws Exception {
+ resultEncrypted.expectedMessageCount(1);
+ resultDecrypted.expectedMessageCount(1);
+
+ templateEncrypt.sendBody(ORIGINAL_MESSAGE);
+
+ resultEncrypted.assertIsSatisfied();
+ resultDecrypted.assertIsSatisfied();
+
+ // Verify encrypted data is not the same as original
+ byte[] encrypted = resultEncrypted.getExchanges().get(0).getMessage().getBody(byte[].class);
+ assertNotNull(encrypted);
+ assertNotEquals(ORIGINAL_MESSAGE, new String(encrypted));
+
+ // Verify decrypted data matches original
+ String decrypted = resultDecrypted.getExchanges().get(0).getMessage().getBody(String.class);
+ assertEquals(ORIGINAL_MESSAGE, decrypted);
+ }
+
+ @Test
+ void testLargePayload() throws Exception {
+ resultEncrypted.reset();
+ resultDecrypted.reset();
+ resultEncrypted.expectedMessageCount(1);
+ resultDecrypted.expectedMessageCount(1);
+
+ // Create a large message (1MB)
+ StringBuilder largeMessage = new StringBuilder();
+ for (int i = 0; i < 10000; i++) {
+ largeMessage.append("This is line ").append(i).append(" of a large message for testing PQC DataFormat.\n");
+ }
+ String originalLargeMessage = largeMessage.toString();
+
+ templateEncrypt.sendBody(originalLargeMessage);
+
+ resultEncrypted.assertIsSatisfied();
+ resultDecrypted.assertIsSatisfied();
+
+ // Verify encrypted data is not the same as original
+ byte[] encrypted = resultEncrypted.getExchanges().get(0).getMessage().getBody(byte[].class);
+ assertNotNull(encrypted);
+ assertNotEquals(originalLargeMessage, new String(encrypted));
+
+ // Verify decrypted data matches original
+ String decrypted = resultDecrypted.getExchanges().get(0).getMessage().getBody(String.class);
+ assertEquals(originalLargeMessage, decrypted);
+ }
+
+ @BindToRegistry("pqcKeyPair")
+ public KeyPair createKeyPair()
+ throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException {
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(
+ PQCKeyEncapsulationAlgorithms.MLKEM.getAlgorithm(),
+ PQCKeyEncapsulationAlgorithms.MLKEM.getBcProvider());
+ kpg.initialize(MLKEMParameterSpec.ml_kem_512, new SecureRandom());
+ return kpg.generateKeyPair();
+ }
+}
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
new file mode 100644
index 000000000000..c228ea88aaf6
--- /dev/null
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/pqc.json
@@ -0,0 +1,25 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "pqc",
+ "title": "PQC (Post-Quantum Cryptography)",
+ "description": "Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).",
+ "deprecated": false,
+ "firstVersion": "4.16.0",
+ "label": "dataformat,transformation,security",
+ "javaType": "org.apache.camel.model.dataformat.PQCDataFormat",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "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": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MLKEM", "description": "The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER, FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER" },
+ "symmetricKeyAlgorithm": { "index": 2, "kind": "attribute", "displayName": "Symmetric Key Algorithm", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AES", "description": "The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5, CAMELLIA, CAST5, CAST6, CHACHA7539, etc." },
+ "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." },
+ "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 register to use for KEM operations." },
+ "bufferSize": { "index": 5, "kind": "attribute", "displayName": "Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 4096, "description": "The size of the buffer used for streaming encryption\/decryption." },
+ "provider": { "index": 6, "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": 7, "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 register for KEM operations." }
+ }
+}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
index 1e18fab7a55d..65d76944ca5c 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
+++ b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
@@ -135,6 +135,7 @@ policy
poll
pollEnrich
post
+pqc
predicateValidator
process
property
diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index
index c4e1b28044eb..1390b5687415 100644
--- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index
+++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index
@@ -31,6 +31,7 @@ JsonLibrary
LZFDataFormat
MimeMultipartDataFormat
PGPDataFormat
+PQCDataFormat
ParquetAvroDataFormat
ProtobufDataFormat
ProtobufLibrary
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
new file mode 100644
index 000000000000..9a61a455644b
--- /dev/null
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/PQCDataFormat.java
@@ -0,0 +1,262 @@
+/*
+ * 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.model.dataformat;
+
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlAttribute;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlTransient;
+
+import org.apache.camel.builder.DataFormatBuilder;
+import org.apache.camel.model.DataFormatDefinition;
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).
+ */
+@Metadata(firstVersion = "4.16.0", label = "dataformat,transformation,security", title = "PQC (Post-Quantum Cryptography)")
+@XmlRootElement(name = "pqc")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class PQCDataFormat extends DataFormatDefinition {
+
+ @XmlAttribute
+ @Metadata(defaultValue = "MLKEM")
+ private String keyEncapsulationAlgorithm = "MLKEM";
+ @XmlAttribute
+ @Metadata(defaultValue = "AES")
+ private String symmetricKeyAlgorithm = "AES";
+ @XmlAttribute
+ @Metadata(javaType = "java.lang.Integer", defaultValue = "128")
+ private String symmetricKeyLength;
+ @XmlAttribute
+ @Metadata(javaType = "java.security.KeyPair")
+ private String keyPair;
+ @XmlAttribute
+ @Metadata(label = "advanced", javaType = "java.lang.Integer", defaultValue = "4096")
+ private String bufferSize;
+ @XmlAttribute
+ @Metadata(label = "advanced")
+ private String provider;
+ @XmlAttribute
+ @Metadata(label = "advanced", javaType = "javax.crypto.KeyGenerator")
+ private String keyGenerator;
+
+ public PQCDataFormat() {
+ super("pqc");
+ }
+
+ protected PQCDataFormat(PQCDataFormat source) {
+ super(source);
+ this.keyEncapsulationAlgorithm = source.keyEncapsulationAlgorithm;
+ this.symmetricKeyAlgorithm = source.symmetricKeyAlgorithm;
+ this.symmetricKeyLength = source.symmetricKeyLength;
+ this.keyPair = source.keyPair;
+ this.bufferSize = source.bufferSize;
+ this.provider = source.provider;
+ this.keyGenerator = source.keyGenerator;
+ }
+
+ private PQCDataFormat(Builder builder) {
+ this();
+ this.keyEncapsulationAlgorithm = builder.keyEncapsulationAlgorithm;
+ this.symmetricKeyAlgorithm = builder.symmetricKeyAlgorithm;
+ this.symmetricKeyLength = builder.symmetricKeyLength;
+ this.keyPair = builder.keyPair;
+ this.bufferSize = builder.bufferSize;
+ this.provider = builder.provider;
+ this.keyGenerator = builder.keyGenerator;
+ }
+
+ @Override
+ public PQCDataFormat copyDefinition() {
+ return new PQCDataFormat(this);
+ }
+
+ public String getKeyEncapsulationAlgorithm() {
+ return keyEncapsulationAlgorithm;
+ }
+
+ /**
+ * The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER,
+ * FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER
+ */
+ public void setKeyEncapsulationAlgorithm(String keyEncapsulationAlgorithm) {
+ this.keyEncapsulationAlgorithm = keyEncapsulationAlgorithm;
+ }
+
+ public String getSymmetricKeyAlgorithm() {
+ return symmetricKeyAlgorithm;
+ }
+
+ /**
+ * The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5,
+ * CAMELLIA, CAST5, CAST6, CHACHA7539, etc.
+ */
+ public void setSymmetricKeyAlgorithm(String symmetricKeyAlgorithm) {
+ this.symmetricKeyAlgorithm = symmetricKeyAlgorithm;
+ }
+
+ public String getSymmetricKeyLength() {
+ return symmetricKeyLength;
+ }
+
+ /**
+ * The length (in bits) of the symmetric key.
+ */
+ public void setSymmetricKeyLength(String symmetricKeyLength) {
+ this.symmetricKeyLength = symmetricKeyLength;
+ }
+
+ public String getKeyPair() {
+ return keyPair;
+ }
+
+ /**
+ * Refers to the KeyPair to lookup from the register to use for KEM operations.
+ */
+ public void setKeyPair(String keyPair) {
+ this.keyPair = keyPair;
+ }
+
+ public String getBufferSize() {
+ return bufferSize;
+ }
+
+ /**
+ * The size of the buffer used for streaming encryption/decryption.
+ */
+ public void setBufferSize(String bufferSize) {
+ this.bufferSize = bufferSize;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ /**
+ * The JCE security provider to use.
+ */
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public String getKeyGenerator() {
+ return keyGenerator;
+ }
+
+ /**
+ * Refers to a custom KeyGenerator to lookup from the register for KEM operations.
+ */
+ public void setKeyGenerator(String keyGenerator) {
+ this.keyGenerator = keyGenerator;
+ }
+
+ /**
+ * {@code Builder} is a specific builder for {@link PQCDataFormat}.
+ */
+ @XmlTransient
+ public static class Builder implements DataFormatBuilder<PQCDataFormat> {
+
+ private String keyEncapsulationAlgorithm = "MLKEM";
+ private String symmetricKeyAlgorithm = "AES";
+ private String symmetricKeyLength;
+ private String keyPair;
+ private String bufferSize;
+ private String provider;
+ private String keyGenerator;
+
+ /**
+ * The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER,
+ * FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER
+ */
+ public Builder keyEncapsulationAlgorithm(String keyEncapsulationAlgorithm) {
+ this.keyEncapsulationAlgorithm = keyEncapsulationAlgorithm;
+ return this;
+ }
+
+ /**
+ * The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5,
+ * CAMELLIA, CAST5, CAST6, CHACHA7539, etc.
+ */
+ public Builder symmetricKeyAlgorithm(String symmetricKeyAlgorithm) {
+ this.symmetricKeyAlgorithm = symmetricKeyAlgorithm;
+ return this;
+ }
+
+ /**
+ * The length (in bits) of the symmetric key.
+ */
+ public Builder symmetricKeyLength(String symmetricKeyLength) {
+ this.symmetricKeyLength = symmetricKeyLength;
+ return this;
+ }
+
+ /**
+ * The length (in bits) of the symmetric key.
+ */
+ public Builder symmetricKeyLength(int symmetricKeyLength) {
+ this.symmetricKeyLength = Integer.toString(symmetricKeyLength);
+ return this;
+ }
+
+ /**
+ * Refers to the KeyPair to lookup from the register to use for KEM operations.
+ */
+ public Builder keyPair(String keyPair) {
+ this.keyPair = keyPair;
+ return this;
+ }
+
+ /**
+ * The size of the buffer used for streaming encryption/decryption.
+ */
+ public Builder bufferSize(String bufferSize) {
+ this.bufferSize = bufferSize;
+ return this;
+ }
+
+ /**
+ * The size of the buffer used for streaming encryption/decryption.
+ */
+ public Builder bufferSize(int bufferSize) {
+ this.bufferSize = Integer.toString(bufferSize);
+ return this;
+ }
+
+ /**
+ * The JCE security provider to use.
+ */
+ public Builder provider(String provider) {
+ this.provider = provider;
+ return this;
+ }
+
+ /**
+ * Refers to a custom KeyGenerator to lookup from the register for KEM operations.
+ */
+ public Builder keyGenerator(String keyGenerator) {
+ this.keyGenerator = keyGenerator;
+ return this;
+ }
+
+ @Override
+ public PQCDataFormat end() {
+ return new PQCDataFormat(this);
+ }
+ }
+}
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
index c63742d80e00..4a63958075e1 100644
--- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
@@ -196,6 +196,8 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> extends
return new ParquetAvroDataFormatReifier(camelContext, definition);
} else if (definition instanceof PGPDataFormat) {
return new PGPDataFormatReifier(camelContext, definition);
+ } else if (definition instanceof PQCDataFormat) {
+ return new PQCDataFormatReifier(camelContext, definition);
} else if (definition instanceof ProtobufDataFormat) {
return new ProtobufDataFormatReifier(camelContext, definition);
} else if (definition instanceof RssDataFormat) {
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/PQCDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/PQCDataFormatReifier.java
new file mode 100644
index 000000000000..44e1a806bcf8
--- /dev/null
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/PQCDataFormatReifier.java
@@ -0,0 +1,42 @@
+/*
+ * 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.reifier.dataformat;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.model.DataFormatDefinition;
+import org.apache.camel.model.dataformat.PQCDataFormat;
+
+public class PQCDataFormatReifier extends DataFormatReifier<PQCDataFormat> {
+
+ public PQCDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+ super(camelContext, (PQCDataFormat) definition);
+ }
+
+ @Override
+ protected void prepareDataFormatConfig(Map<String, Object> properties) {
+ properties.put("keyEncapsulationAlgorithm", definition.getKeyEncapsulationAlgorithm());
+ properties.put("symmetricKeyAlgorithm", definition.getSymmetricKeyAlgorithm());
+ properties.put("symmetricKeyLength", definition.getSymmetricKeyLength());
+ properties.put("keyPair", asRef(definition.getKeyPair()));
+ properties.put("bufferSize", definition.getBufferSize());
+ properties.put("provider", definition.getProvider());
+ properties.put("keyGenerator", asRef(definition.getKeyGenerator()));
+ }
+
+}
diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
index b89f4ad80482..279fc099b156 100644
--- a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
+++ b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
@@ -274,7 +274,6 @@ platform-http
plc4x
pop3
pop3s
-pqc
pubnub
pulsar
qdrant
diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties
index a71e6f2ab78b..95f2e595b066 100644
--- a/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties
+++ b/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties
@@ -32,6 +32,7 @@ lzf
mimeMultipart
parquetAvro
pgp
+pqc
protobuf
protobufJackson
rss
diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
index d941273520e8..28d34bce938d 100644
--- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
+++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
@@ -2101,6 +2101,18 @@ public class ModelParser extends BaseParser {
default: yield identifiedTypeAttributeHandler().accept(def, key, val);
}, noElementHandler(), noValueHandler());
}
+ protected PQCDataFormat doParsePQCDataFormat() throws IOException, XmlPullParserException {
+ return doParse(new PQCDataFormat(), (def, key, val) -> switch (key) {
+ case "bufferSize": def.setBufferSize(val); yield true;
+ case "keyEncapsulationAlgorithm": def.setKeyEncapsulationAlgorithm(val); yield true;
+ case "keyGenerator": def.setKeyGenerator(val); yield true;
+ case "keyPair": def.setKeyPair(val); yield true;
+ case "provider": def.setProvider(val); yield true;
+ case "symmetricKeyAlgorithm": def.setSymmetricKeyAlgorithm(val); yield true;
+ case "symmetricKeyLength": def.setSymmetricKeyLength(val); yield true;
+ default: yield identifiedTypeAttributeHandler().accept(def, key, val);
+ }, noElementHandler(), noValueHandler());
+ }
protected ParquetAvroDataFormat doParseParquetAvroDataFormat() throws IOException, XmlPullParserException {
return doParse(new ParquetAvroDataFormat(), (def, key, val) -> switch (key) {
case "compressionCodecName": def.setCompressionCodecName(val); yield true;
@@ -2968,6 +2980,7 @@ public class ModelParser extends BaseParser {
case "lzf": return doParseLZFDataFormat();
case "mimeMultipart": return doParseMimeMultipartDataFormat();
case "pgp": return doParsePGPDataFormat();
+ case "pqc": return doParsePQCDataFormat();
case "parquetAvro": return doParseParquetAvroDataFormat();
case "protobuf": return doParseProtobufDataFormat();
case "rss": return doParseRssDataFormat();
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 369ed1d8cf5b..18f9f687dd09 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
@@ -528,6 +528,9 @@ public class ModelWriter extends BaseWriter {
public void writePGPDataFormat(PGPDataFormat def) throws IOException {
doWritePGPDataFormat("pgp", def);
}
+ public void writePQCDataFormat(PQCDataFormat def) throws IOException {
+ doWritePQCDataFormat("pqc", def);
+ }
public void writeParquetAvroDataFormat(ParquetAvroDataFormat def) throws IOException {
doWriteParquetAvroDataFormat("parquetAvro", def);
}
@@ -2803,6 +2806,18 @@ public class ModelWriter extends BaseWriter {
doWriteAttribute("algorithm", def.getAlgorithm(), null);
endElement(name);
}
+ protected void doWritePQCDataFormat(String name, PQCDataFormat def) throws IOException {
+ startElement(name);
+ doWriteIdentifiedTypeAttributes(def);
+ doWriteAttribute("provider", def.getProvider(), null);
+ doWriteAttribute("symmetricKeyAlgorithm", def.getSymmetricKeyAlgorithm(), "AES");
+ doWriteAttribute("keyGenerator", def.getKeyGenerator(), null);
+ doWriteAttribute("keyPair", def.getKeyPair(), null);
+ doWriteAttribute("bufferSize", def.getBufferSize(), "4096");
+ doWriteAttribute("symmetricKeyLength", def.getSymmetricKeyLength(), "128");
+ doWriteAttribute("keyEncapsulationAlgorithm", def.getKeyEncapsulationAlgorithm(), "MLKEM");
+ endElement(name);
+ }
protected void doWriteParquetAvroDataFormat(String name, ParquetAvroDataFormat def) throws IOException {
startElement(name);
doWriteIdentifiedTypeAttributes(def);
diff --git a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
index 8c0b2bb419d2..7d4070562009 100644
--- a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
+++ b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
@@ -528,6 +528,9 @@ public class ModelWriter extends BaseWriter {
public void writePGPDataFormat(PGPDataFormat def) throws IOException {
doWritePGPDataFormat("pgp", def);
}
+ public void writePQCDataFormat(PQCDataFormat def) throws IOException {
+ doWritePQCDataFormat("pqc", def);
+ }
public void writeParquetAvroDataFormat(ParquetAvroDataFormat def) throws IOException {
doWriteParquetAvroDataFormat("parquetAvro", def);
}
@@ -2803,6 +2806,18 @@ public class ModelWriter extends BaseWriter {
doWriteAttribute("algorithm", def.getAlgorithm(), null);
endElement(name);
}
+ protected void doWritePQCDataFormat(String name, PQCDataFormat def) throws IOException {
+ startElement(name);
+ doWriteIdentifiedTypeAttributes(def);
+ doWriteAttribute("provider", def.getProvider(), null);
+ doWriteAttribute("symmetricKeyAlgorithm", def.getSymmetricKeyAlgorithm(), "AES");
+ doWriteAttribute("keyGenerator", def.getKeyGenerator(), null);
+ doWriteAttribute("keyPair", def.getKeyPair(), null);
+ doWriteAttribute("bufferSize", def.getBufferSize(), "4096");
+ doWriteAttribute("symmetricKeyLength", def.getSymmetricKeyLength(), "128");
+ doWriteAttribute("keyEncapsulationAlgorithm", def.getKeyEncapsulationAlgorithm(), "MLKEM");
+ endElement(name);
+ }
protected void doWriteParquetAvroDataFormat(String name, ParquetAvroDataFormat def) throws IOException {
startElement(name);
doWriteIdentifiedTypeAttributes(def);
diff --git a/docs/components/modules/ROOT/examples/json/pqc.json b/docs/components/modules/dataformats/examples/json/pqc.json
similarity index 100%
rename from docs/components/modules/ROOT/examples/json/pqc.json
rename to docs/components/modules/dataformats/examples/json/pqc.json
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index 02c0438ec4a5..4a749e66a8d6 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -3711,19 +3711,6 @@ public interface ComponentsBuilderFactory {
static Pop3sComponentBuilderFactory.Pop3sComponentBuilder pop3s() {
return Pop3sComponentBuilderFactory.pop3s();
}
- /**
- * PQC Algorithms (camel-pqc)
- * Post Quantum Cryptography Signature and Verification component.
- *
- * Category: security
- * Since: 4.12
- * Maven coordinates: org.apache.camel:camel-pqc
- *
- * @return the dsl builder
- */
- static PqcComponentBuilderFactory.PqcComponentBuilder pqc() {
- return PqcComponentBuilderFactory.pqc();
- }
/**
* PubNub (camel-pubnub)
* Send and receive messages to/from PubNub data stream network for
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index d5ab52345921..4366660472fd 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -12366,46 +12366,6 @@ public class StaticEndpointBuilders {
public static MailEndpointBuilderFactory.MailEndpointBuilder pop3s(String path) {
return imap("pop3s", path);
}
- /**
- * PQC Algorithms (camel-pqc)
- * Post Quantum Cryptography Signature and Verification component.
- *
- * Category: security
- * Since: 4.12
- * Maven coordinates: org.apache.camel:camel-pqc
- *
- * Syntax: <code>pqc:label</code>
- *
- * Path parameter: label (required)
- * Logical name
- *
- * @param path label
- * @return the dsl builder
- */
- public static PQCEndpointBuilderFactory.PQCEndpointBuilder pqc(String path) {
- return pqc("pqc", path);
- }
- /**
- * PQC Algorithms (camel-pqc)
- * Post Quantum Cryptography Signature and Verification component.
- *
- * Category: security
- * Since: 4.12
- * Maven coordinates: org.apache.camel:camel-pqc
- *
- * Syntax: <code>pqc:label</code>
- *
- * Path parameter: label (required)
- * Logical name
- *
- * @param componentName to use a custom component name for the endpoint
- * instead of the default name
- * @param path label
- * @return the dsl builder
- */
- public static PQCEndpointBuilderFactory.PQCEndpointBuilder pqc(String componentName, String path) {
- return PQCEndpointBuilderFactory.endpointBuilder(componentName, path);
- }
/**
* PubNub (camel-pubnub)
* Send and receive messages to/from PubNub data stream network for
diff --git a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
index 210584a3aea0..0f883538345a 100644
--- a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
+++ b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
@@ -283,7 +283,6 @@ org.apache.camel.component.pgevent.PgEventComponent=camel:pgevent
org.apache.camel.component.pinecone.PineconeVectorDbComponent=camel:pinecone
org.apache.camel.component.platform.http.PlatformHttpComponent=camel:platform-http
org.apache.camel.component.plc4x.Plc4XComponent=camel:plc4x
-org.apache.camel.component.pqc.PQCComponent=camel:pqc
org.apache.camel.component.printer.PrinterComponent=camel:printer
org.apache.camel.component.pubnub.PubNubComponent=camel:pubnub
org.apache.camel.component.pulsar.PulsarComponent=camel:pulsar
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 a8abb76261bf..eb772dabb0ae 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
@@ -164,6 +164,7 @@ import org.apache.camel.model.dataformat.JsonDataFormat;
import org.apache.camel.model.dataformat.LZFDataFormat;
import org.apache.camel.model.dataformat.MimeMultipartDataFormat;
import org.apache.camel.model.dataformat.PGPDataFormat;
+import org.apache.camel.model.dataformat.PQCDataFormat;
import org.apache.camel.model.dataformat.ParquetAvroDataFormat;
import org.apache.camel.model.dataformat.ProtobufDataFormat;
import org.apache.camel.model.dataformat.RssDataFormat;
@@ -11739,6 +11740,87 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
}
}
+ @YamlType(
+ nodes = "pqc",
+ types = org.apache.camel.model.dataformat.PQCDataFormat.class,
+ order = org.apache.camel.dsl.yaml.common.YamlDeserializerResolver.ORDER_LOWEST - 1,
+ displayName = "PQC (Post-Quantum Cryptography)",
+ description = "Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).",
+ deprecated = false,
+ properties = {
+ @YamlProperty(name = "bufferSize", type = "number", defaultValue = "4096", description = "The size of the buffer used for streaming encryption/decryption.", displayName = "Buffer Size"),
+ @YamlProperty(name = "id", type = "string", description = "The id of this node", displayName = "Id"),
+ @YamlProperty(name = "keyEncapsulationAlgorithm", type = "string", defaultValue = "MLKEM", description = "The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER, FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER", displayName = "Key Encapsulation Algorithm"),
+ @YamlProperty(name = "keyGenerator", type = "string", description = "Refers to a custom KeyGenerator to lookup from the register for KEM operations.", displayName = "Key Generator"),
+ @YamlProperty(name = "keyPair", type = "string", description = "Refers to the KeyPair to lookup from the register 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 = "string", defaultValue = "AES", description = "The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5, CAMELLIA, CAST5, CAST6, CHACHA7539, etc.", displayName = "Symmetric Key Algorithm"),
+ @YamlProperty(name = "symmetricKeyLength", type = "number", defaultValue = "128", description = "The length (in bits) of the symmetric key.", displayName = "Symmetric Key Length")
+ }
+ )
+ public static class PQCDataFormatDeserializer extends YamlDeserializerBase<PQCDataFormat> {
+ public PQCDataFormatDeserializer() {
+ super(PQCDataFormat.class);
+ }
+
+ @Override
+ protected PQCDataFormat newInstance() {
+ return new PQCDataFormat();
+ }
+
+ @Override
+ protected boolean setProperty(PQCDataFormat target, String propertyKey, String propertyName,
+ Node node) {
+ propertyKey = org.apache.camel.util.StringHelper.dashToCamelCase(propertyKey);
+ switch(propertyKey) {
+ case "bufferSize": {
+ String val = asText(node);
+ target.setBufferSize(val);
+ break;
+ }
+ case "id": {
+ String val = asText(node);
+ target.setId(val);
+ break;
+ }
+ case "keyEncapsulationAlgorithm": {
+ String val = asText(node);
+ target.setKeyEncapsulationAlgorithm(val);
+ break;
+ }
+ case "keyGenerator": {
+ String val = asText(node);
+ target.setKeyGenerator(val);
+ break;
+ }
+ case "keyPair": {
+ String val = asText(node);
+ target.setKeyPair(val);
+ break;
+ }
+ case "provider": {
+ String val = asText(node);
+ target.setProvider(val);
+ break;
+ }
+ case "symmetricKeyAlgorithm": {
+ String val = asText(node);
+ target.setSymmetricKeyAlgorithm(val);
+ break;
+ }
+ case "symmetricKeyLength": {
+ String val = asText(node);
+ target.setSymmetricKeyLength(val);
+ break;
+ }
+ default: {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
@YamlType(
nodes = "packageScan",
types = org.apache.camel.model.PackageScanDefinition.class,
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
index d0dc62d2e8f1..2b339e22899b 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
@@ -263,6 +263,8 @@ public final class ModelDeserializersResolver implements YamlDeserializerResolve
case "org.apache.camel.model.OutputTypeDefinition": return new ModelDeserializers.OutputTypeDefinitionDeserializer();
case "pgp": return new ModelDeserializers.PGPDataFormatDeserializer();
case "org.apache.camel.model.dataformat.PGPDataFormat": return new ModelDeserializers.PGPDataFormatDeserializer();
+ case "pqc": return new ModelDeserializers.PQCDataFormatDeserializer();
+ case "org.apache.camel.model.dataformat.PQCDataFormat": return new ModelDeserializers.PQCDataFormatDeserializer();
case "packageScan": return new ModelDeserializers.PackageScanDefinitionDeserializer();
case "org.apache.camel.model.PackageScanDefinition": return new ModelDeserializers.PackageScanDefinitionDeserializer();
case "param": return new ModelDeserializers.ParamDefinitionDeserializer();
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 778d94e29730..ce45777b94f0 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
@@ -12410,6 +12410,58 @@
}
}
},
+ "org.apache.camel.model.dataformat.PQCDataFormat" : {
+ "title" : "PQC (Post-Quantum Cryptography)",
+ "description" : "Encrypt and decrypt messages using Post-Quantum Cryptography Key Encapsulation Mechanisms (KEM).",
+ "type" : "object",
+ "additionalProperties" : false,
+ "properties" : {
+ "bufferSize" : {
+ "type" : "number",
+ "title" : "Buffer Size",
+ "description" : "The size of the buffer used for streaming encryption/decryption.",
+ "default" : "4096"
+ },
+ "id" : {
+ "type" : "string",
+ "title" : "Id",
+ "description" : "The id of this node"
+ },
+ "keyEncapsulationAlgorithm" : {
+ "type" : "string",
+ "title" : "Key Encapsulation Algorithm",
+ "description" : "The Post-Quantum KEM algorithm to use for key encapsulation. Supported values: MLKEM, BIKE, HQC, CMCE, SABER, FRODO, NTRU, NTRULPRime, SNTRUPrime, KYBER",
+ "default" : "MLKEM"
+ },
+ "keyGenerator" : {
+ "type" : "string",
+ "title" : "Key Generator",
+ "description" : "Refers to a custom KeyGenerator to lookup from the register for KEM operations."
+ },
+ "keyPair" : {
+ "type" : "string",
+ "title" : "Key Pair",
+ "description" : "Refers to the KeyPair to lookup from the register to use for KEM operations."
+ },
+ "provider" : {
+ "type" : "string",
+ "title" : "Provider",
+ "description" : "The JCE security provider to use."
+ },
+ "symmetricKeyAlgorithm" : {
+ "type" : "string",
+ "title" : "Symmetric Key Algorithm",
+ "description" : "The symmetric encryption algorithm to use with the shared secret. Supported values: AES, ARIA, RC2, RC5, CAMELLIA, CAST5, CAST6, CHACHA7539, etc.",
+ "default" : "AES"
+ },
+ "symmetricKeyLength" : {
+ "type" : "number",
+ "title" : "Symmetric Key Length",
+ "description" : "The length (in bits) of the symmetric key.",
+ "default" : "128"
+ }
+ }
+ },
"org.apache.camel.model.dataformat.ParquetAvroDataFormat" : {
"title" : "Parquet File",
"description" : "Parquet Avro serialization and de-serialization.",