This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e415d32efc9d515620d9730680e775f90f6fca03
Author: Nicolas Filotto <[email protected]>
AuthorDate: Wed Apr 6 16:20:22 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-xmlsecurity
---
 .../component/xmlsecurity/xmlsecurity-sign.json    | 17 ++++++++++++++
 .../component/xmlsecurity/xmlsecurity-verify.json  | 12 ++++++++++
 .../src/main/docs/xmlsecurity-sign-component.adoc  | 27 +++-------------------
 .../main/docs/xmlsecurity-verify-component.adoc    | 27 +++-------------------
 .../component/xmlsecurity/XmlSignerEndpoint.java   |  8 +++++--
 .../component/xmlsecurity/XmlVerifierEndpoint.java |  8 +++++--
 .../api/DefaultXmlSignature2Message.java           |  3 +--
 .../xmlsecurity/api/XmlSignatureConstants.java     | 27 ++++++++++++++++++----
 .../xmlsecurity/processor/XmlSignerProcessor.java  |  2 +-
 9 files changed, 71 insertions(+), 60 deletions(-)

diff --git 
a/components/camel-xmlsecurity/src/generated/resources/org/apache/camel/component/xmlsecurity/xmlsecurity-sign.json
 
b/components/camel-xmlsecurity/src/generated/resources/org/apache/camel/component/xmlsecurity/xmlsecurity-sign.json
index a1247433769..07cd385cd25 100644
--- 
a/components/camel-xmlsecurity/src/generated/resources/org/apache/camel/component/xmlsecurity/xmlsecurity-sign.json
+++ 
b/components/camel-xmlsecurity/src/generated/resources/org/apache/camel/component/xmlsecurity/xmlsecurity-sign.json
@@ -52,6 +52,23 @@
     "signerConfiguration": { "kind": "property", "displayName": "Signer 
Configuration", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": 
"org.apache.camel.component.xmlsecurity.processor.XmlSignerConfiguration", 
"deprecated": false, "autowired": false, "secret": false, "description": "To 
use a shared XmlSignerConfiguration configuration to use as base for 
configuring endpoints." },
     "uriDereferencer": { "kind": "property", "displayName": "Uri 
Dereferencer", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": "javax.xml.crypto.URIDereferencer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.xmlsecurity.processor.XmlSignerConfiguration", 
"configurationField": "signerConfiguration", "description": "If you want to 
restrict the remote access via reference URIs, you can [...]
   },
+  "headers": {
+    "CamelXmlSignatureMessageIsPlainText": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": "Boolean", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Header for indicating that the message body contains 
non-xml plain text. This header is used in the XML signature generator. If the 
value is set to Boolean#TRUE then the message body is treated as plain text 
Overwrites the configuration  [...]
+    "CamelXmlSignaturePlainTextEncoding": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Header indicating the encoding of the plain text message 
body. Used in the XML signature generator if the header 
HEADER_MESSAGE_IS_PLAIN_TEXT is set to Boolean#TRUE. Overwrites the 
configuration parameter XmlSignerConfiguration#setPlainTex [...]
+    "CamelXmlSignatureOmitXmlDeclaration": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": "Boolean", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Header which indicates that either the resulting 
signature document in the signature generation case or the resulting output of 
the verifier should not contain an XML declaration. If the header is not 
specified then a XML declaration is  [...]
+    "CamelXmlSignatureContentReferenceUri": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The content reference URI" },
+    "CamelXmlSignatureContentReferenceType": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The content reference type" },
+    "CamelXmlSignatureSchemaResourceUri": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The schema resource URI" },
+    "CamelXmlSignatureXpathsToIdAttributes": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "XPaths to id attributes" },
+    "CamelXmlSignatureTransformMethods": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Header for dynamic specifying the transform methods of 
the reference to the signed data. The value of the header must be a comma 
separated list with the transform algorithms, for example: 
http:\/\/www.w3.org\/2000\/09\/xmldsig#enveloped-sig [...]
+    "CamelXmlSignatureXAdESQualifyingPropertiesId": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "for the 'Id' attribute value of 
QualifyingProperties element" },
+    "CamelXmlSignatureXAdESSignedDataObjectPropertiesId": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "for the 'Id' attribute value of 
SignedDataObjectProperties element" },
+    "CamelXmlSignatureXAdESSignedSignaturePropertiesId": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "for the 'Id' attribute value of 
SignedSignatureProperties element" },
+    "CamelXmlSignatureXAdESDataObjectFormatEncoding": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "for the value of the Encoding element 
of the DataObjectFormat element" },
+    "CamelXmlSignatureXAdESNamespace": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "overwrites the XAdES namespace parameter value" },
+    "CamelXmlSignatureXAdESPrefix": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "overwrites the XAdES prefix parameter value" },
+    "CamelCharsetName": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The name of the charset" }
+  },
   "properties": {
     "name": { "kind": "path", "displayName": "Name", "group": "producer", 
"label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The name part in the URI can be chosen 
by the user to distinguish between different signer endpoints within the camel 
context." },
     "addKeyInfoReference": { "kind": "parameter", "displayName": "Add Key Info 
Reference", "group": "producer", "label": "", "required": false, "type": 
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": "true", "configurationClass": 
"org.apache.camel.component.xmlsecurity.processor.XmlSignerConfiguration", 
"configurationField": "configuration", "description": "In order to protect the 
KeyInfo element from tampering you can [...]
diff --git 
a/components/camel-xmlsecurity/src/generated/resources/org/apache/camel/component/xmlsecurity/xmlsecurity-verify.json
 
b/components/camel-xmlsecurity/src/generated/resources/org/apache/camel/component/xmlsecurity/xmlsecurity-verify.json
index c0d878c5541..a3cf2adc6de 100644
--- 
a/components/camel-xmlsecurity/src/generated/resources/org/apache/camel/component/xmlsecurity/xmlsecurity-verify.json
+++ 
b/components/camel-xmlsecurity/src/generated/resources/org/apache/camel/component/xmlsecurity/xmlsecurity-verify.json
@@ -42,6 +42,18 @@
     "uriDereferencer": { "kind": "property", "displayName": "Uri 
Dereferencer", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": "javax.xml.crypto.URIDereferencer", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.xmlsecurity.processor.XmlVerifierConfiguration", 
"configurationField": "verifierConfiguration", "description": "If you want to 
restrict the remote access via reference URIs, you [...]
     "verifierConfiguration": { "kind": "property", "displayName": "Verifier 
Configuration", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": 
"org.apache.camel.component.xmlsecurity.processor.XmlVerifierConfiguration", 
"deprecated": false, "autowired": false, "secret": false, "description": "To 
use a shared XmlVerifierConfiguration configuration to use as base for 
configuring endpoints." }
   },
+  "headers": {
+    "CamelXmlSignatureOmitXmlDeclaration": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": "Boolean", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Header which indicates that either the resulting 
signature document in the signature generation case or the resulting output of 
the verifier should not contain an XML declaration. If the header is not 
specified then a XML declaration is  [...]
+    "CamelXmlSignatureSchemaResourceUri": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The schema resource URI" },
+    "CamelXmlSignatureXpathsToIdAttributes": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "XPaths to id attributes" },
+    "CamelXmlSignatureXAdESQualifyingPropertiesId": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "for the 'Id' attribute value of 
QualifyingProperties element" },
+    "CamelXmlSignatureXAdESSignedDataObjectPropertiesId": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "for the 'Id' attribute value of 
SignedDataObjectProperties element" },
+    "CamelXmlSignatureXAdESSignedSignaturePropertiesId": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "for the 'Id' attribute value of 
SignedSignatureProperties element" },
+    "CamelXmlSignatureXAdESDataObjectFormatEncoding": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "for the value of the Encoding element 
of the DataObjectFormat element" },
+    "CamelXmlSignatureXAdESNamespace": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "overwrites the XAdES namespace parameter value" },
+    "CamelXmlSignatureXAdESPrefix": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "overwrites the XAdES prefix parameter value" },
+    "CamelCharsetName": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The name of the charset" }
+  },
   "properties": {
     "name": { "kind": "path", "displayName": "Name", "group": "producer", 
"label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The name part in the URI can be chosen 
by the user to distinguish between different verify endpoints within the camel 
context." },
     "baseUri": { "kind": "parameter", "displayName": "Base Uri", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.xmlsecurity.processor.XmlVerifierConfiguration", 
"configurationField": "configuration", "description": "You can set a base URI 
which is used in the URI dereferencing. Relative URIs are then concatenated 
with  [...]
diff --git 
a/components/camel-xmlsecurity/src/main/docs/xmlsecurity-sign-component.adoc 
b/components/camel-xmlsecurity/src/main/docs/xmlsecurity-sign-component.adoc
index 40b00e0d0b0..63b0a15ff59 100644
--- a/components/camel-xmlsecurity/src/main/docs/xmlsecurity-sign-component.adoc
+++ b/components/camel-xmlsecurity/src/main/docs/xmlsecurity-sign-component.adoc
@@ -64,6 +64,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == XML Signature Wrapping Modes
 
@@ -589,30 +592,6 @@ 
from("direct:xades").to("xmlsecurity-sign://xades?keyAccessor=#keyAccessorDefaul
 </bean>
 ----
 
-=== Headers
-
-[width="100%",cols="1m,1m,4",options="header",]
-|=======================================================================
-|Header |Type |Description
-|CamelXmlSignatureXAdESQualifyingPropertiesId |String |for the 'Id'
-attribute value of `QualifyingProperties` element
-
-|CamelXmlSignatureXAdESSignedDataObjectPropertiesId |String |for the
-'Id' attribute value of `SignedDataObjectProperties` element
-
-|CamelXmlSignatureXAdESSignedSignaturePropertiesId |String |for the
-'Id' attribute value of `SignedSignatureProperties` element
-
-|CamelXmlSignatureXAdESDataObjectFormatEncoding |String |for the value
-of the Encoding element of the `DataObjectFormat` element
-
-|CamelXmlSignatureXAdESNamespace |String | overwrites the XAdES
-namespace parameter value
-
-|CamelXmlSignatureXAdESPrefix |String |overwrites the XAdES prefix
-parameter value
-|=======================================================================
-
 === Limitations with regard to XAdES version 1.4.2
 
 * No support for signature form XAdES-T and XAdES-C
diff --git 
a/components/camel-xmlsecurity/src/main/docs/xmlsecurity-verify-component.adoc 
b/components/camel-xmlsecurity/src/main/docs/xmlsecurity-verify-component.adoc
index 45f29e15726..375952c1f7d 100644
--- 
a/components/camel-xmlsecurity/src/main/docs/xmlsecurity-verify-component.adoc
+++ 
b/components/camel-xmlsecurity/src/main/docs/xmlsecurity-verify-component.adoc
@@ -88,6 +88,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == XML Signature Wrapping Modes
 
@@ -520,30 +523,6 @@ 
from("direct:xades").to("xmlsecurity-sign://xades?keyAccessor=#keyAccessorDefaul
 </bean>
 ----
 
-=== Headers
-
-[width="100%",cols="1m,1m,4",options="header",]
-|=======================================================================
-|Header |Type |Description
-|CamelXmlSignatureXAdESQualifyingPropertiesId |String |for the 'Id'
-attribute value of `QualifyingProperties` element
-
-|CamelXmlSignatureXAdESSignedDataObjectPropertiesId |String |for the
-'Id' attribute value of `SignedDataObjectProperties` element
-
-|CamelXmlSignatureXAdESSignedSignaturePropertiesId |String |for the
-'Id' attribute value of `SignedSignatureProperties` element
-
-|CamelXmlSignatureXAdESDataObjectFormatEncoding |String |for the value
-of the Encoding element of the `DataObjectFormat` element
-
-|CamelXmlSignatureXAdESNamespace |String | overwrites the XAdES
-namespace parameter value
-
-|CamelXmlSignatureXAdESPrefix |String |overwrites the XAdES prefix
-parameter value
-|=======================================================================
-
 === Limitations with regard to XAdES version 1.4.2
 
 * No support for signature form XAdES-T and XAdES-C
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignerEndpoint.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignerEndpoint.java
index 6192160e53a..cbbd266a58b 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignerEndpoint.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignerEndpoint.java
@@ -20,6 +20,7 @@ import org.apache.camel.Category;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
+import org.apache.camel.component.xmlsecurity.api.XmlSignatureConstants;
 import org.apache.camel.component.xmlsecurity.processor.XmlSignerConfiguration;
 import org.apache.camel.component.xmlsecurity.processor.XmlSignerProcessor;
 import org.apache.camel.spi.Metadata;
@@ -28,11 +29,14 @@ import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.support.DefaultEndpoint;
 
+import static 
org.apache.camel.component.xmlsecurity.api.XmlSignatureConstants.SCHEME_SIGN;
+
 /**
  * Sign XML payloads using the XML signature specification.
  */
-@UriEndpoint(firstVersion = "2.12.0", scheme = "xmlsecurity-sign", title = 
"XML Security Sign",
-             syntax = "xmlsecurity-sign:name", producerOnly = true, category = 
{ Category.SECURITY, Category.TRANSFORMATION })
+@UriEndpoint(firstVersion = "2.12.0", scheme = SCHEME_SIGN, title = "XML 
Security Sign",
+             syntax = "xmlsecurity-sign:name", producerOnly = true, category = 
{ Category.SECURITY, Category.TRANSFORMATION },
+             headersClass = XmlSignatureConstants.class)
 public class XmlSignerEndpoint extends DefaultEndpoint {
 
     @UriPath
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlVerifierEndpoint.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlVerifierEndpoint.java
index 9e958e380e7..b906cb6af57 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlVerifierEndpoint.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlVerifierEndpoint.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.xmlsecurity;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
+import org.apache.camel.component.xmlsecurity.api.XmlSignatureConstants;
 import 
org.apache.camel.component.xmlsecurity.processor.XmlVerifierConfiguration;
 import org.apache.camel.component.xmlsecurity.processor.XmlVerifierProcessor;
 import org.apache.camel.spi.Metadata;
@@ -27,11 +28,14 @@ import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.support.DefaultEndpoint;
 
+import static 
org.apache.camel.component.xmlsecurity.api.XmlSignatureConstants.SCHEME_VERIFIER;
+
 /**
  * Verify XML payloads using the XML signature specification.
  */
-@UriEndpoint(firstVersion = "2.12.0", scheme = "xmlsecurity-verify", title = 
"XML Security Verify",
-             syntax = "xmlsecurity-verify:name", producerOnly = true, label = 
"security,transformation")
+@UriEndpoint(firstVersion = "2.12.0", scheme = SCHEME_VERIFIER, title = "XML 
Security Verify",
+             syntax = "xmlsecurity-verify:name", producerOnly = true, label = 
"security,transformation",
+             headersClass = XmlSignatureConstants.class)
 public class XmlVerifierEndpoint extends DefaultEndpoint {
 
     @UriPath
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultXmlSignature2Message.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultXmlSignature2Message.java
index ccf87d99822..4a0500a7e70 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultXmlSignature2Message.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/DefaultXmlSignature2Message.java
@@ -36,7 +36,6 @@ import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -189,7 +188,7 @@ public class DefaultXmlSignature2Message implements 
XmlSignature2Message {
         XmlSignatureHelper.transformToOutputStream(node, os, 
omitXmlDeclaration(output, input), input.getOutputXmlEncoding());
         output.setBody(os.toByteArray());
         if (input.getOutputXmlEncoding() != null) {
-            output.setHeader(Exchange.CHARSET_NAME, 
input.getOutputXmlEncoding());
+            output.setHeader(XmlSignatureConstants.CHARSET_NAME, 
input.getOutputXmlEncoding());
         }
     }
 
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureConstants.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureConstants.java
index f091c04a3ff..30c51f2d8d6 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureConstants.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureConstants.java
@@ -16,13 +16,19 @@
  */
 package org.apache.camel.component.xmlsecurity.api;
 
-public final class XmlSignatureConstants {
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.Metadata;
 
+public final class XmlSignatureConstants {
+    // The schemes
+    public static final String SCHEME_VERIFIER = "xmlsecurity-verify";
+    public static final String SCHEME_SIGN = "xmlsecurity-sign";
     /**
      * Header for indicating that the message body contains non-xml plain 
text. This header is used in the XML signature
      * generator. If the value is set to {@link Boolean#TRUE} then the message 
body is treated as plain text Overwrites
      * the configuration parameter XmlSignerConfiguration#setPlainText(Boolean)
      */
+    @Metadata(javaType = "Boolean", applicableFor = SCHEME_SIGN)
     public static final String HEADER_MESSAGE_IS_PLAIN_TEXT = 
"CamelXmlSignatureMessageIsPlainText";
 
     /**
@@ -30,6 +36,7 @@ public final class XmlSignatureConstants {
      * {@link #HEADER_MESSAGE_IS_PLAIN_TEXT} is set to {@link Boolean#TRUE}. 
Overwrites the configuration parameter
      * XmlSignerConfiguration#setPlainTextEncoding(String).
      */
+    @Metadata(javaType = "String", applicableFor = SCHEME_SIGN)
     public static final String HEADER_PLAIN_TEXT_ENCODING = 
"CamelXmlSignaturePlainTextEncoding";
 
     /**
@@ -44,14 +51,15 @@ public final class XmlSignatureConstants {
      * Overwrites the configuration parameter 
XmlSignatureConfiguration#setOmitXmlDeclaration(Boolean).
      * 
      */
+    @Metadata(javaType = "Boolean")
     public static final String HEADER_OMIT_XML_DECLARATION = 
"CamelXmlSignatureOmitXmlDeclaration";
-
+    @Metadata(description = "The content reference URI", javaType = "String", 
applicableFor = SCHEME_SIGN)
     public static final String HEADER_CONTENT_REFERENCE_URI = 
"CamelXmlSignatureContentReferenceUri";
-
+    @Metadata(description = "The content reference type", javaType = "String", 
applicableFor = SCHEME_SIGN)
     public static final String HEADER_CONTENT_REFERENCE_TYPE = 
"CamelXmlSignatureContentReferenceType";
-
+    @Metadata(description = "The schema resource URI", javaType = "String")
     public static final String HEADER_SCHEMA_RESOURCE_URI = 
"CamelXmlSignatureSchemaResourceUri";
-
+    @Metadata(description = "XPaths to id attributes", javaType = "String")
     public static final String HEADER_XPATHS_TO_ID_ATTRIBUTES = 
"CamelXmlSignatureXpathsToIdAttributes";
 
     /**
@@ -63,6 +71,7 @@ public final class XmlSignatureConstants {
      * transform algorithms, which need parameters like 
http://www.w3.org/TR/1999/REC-xslt-19991116,
      * http://www.w3.org/2002/06/xmldsig-filter2, or 
http://www.w3.org/TR/1999/REC-xpath-19991116.
      */
+    @Metadata(javaType = "String", applicableFor = SCHEME_SIGN)
     public static final String HEADER_TRANSFORM_METHODS = 
"CamelXmlSignatureTransformMethods";
 
     /*------------------------- headers for XAdES signer 
----------------------------------------------------------*/
@@ -70,12 +79,14 @@ public final class XmlSignatureConstants {
      * Header for the 'Id' attribute value of the XAdES element 
'QualifyingProperties'
      * 
      */
+    @Metadata(description = "for the 'Id' attribute value of 
`QualifyingProperties` element", javaType = "String")
     public static final String HEADER_XADES_QUALIFYING_PROPERTIES_ID = 
"CamelXmlSignatureXAdESQualifyingPropertiesId";
 
     /**
      * Header for the 'Id' attribute value of the XAdES element 
'SignedDataObjectProperties'
      * 
      */
+    @Metadata(description = "for the 'Id' attribute value of 
`SignedDataObjectProperties` element", javaType = "String")
     public static final String HEADER_XADES_SIGNED_DATA_OBJECT_PROPERTIES_ID
             = "CamelXmlSignatureXAdESSignedDataObjectPropertiesId";
 
@@ -83,12 +94,14 @@ public final class XmlSignatureConstants {
      * Header for the 'Id' attribute value of the XAdES element 
'SignedSignatureProperties'
      * 
      */
+    @Metadata(description = "for the 'Id' attribute value of 
`SignedSignatureProperties` element", javaType = "String")
     public static final String HEADER_XADES_SIGNED_SIGNATURE_PROPERTIES_ID
             = "CamelXmlSignatureXAdESSignedSignaturePropertiesId";
 
     /**
      * Header for the "Encoding" element contained in the "DataObjectFormat" 
XAdES element.
      */
+    @Metadata(description = "for the value of the Encoding element of the 
`DataObjectFormat` element", javaType = "String")
     public static final String HEADER_XADES_DATA_OBJECT_FORMAT_ENCODING = 
"CamelXmlSignatureXAdESDataObjectFormatEncoding";
 
     /**
@@ -102,6 +115,7 @@ public final class XmlSignatureConstants {
      * http://uri.etsi.org/01903/v1.3.2#.
      * 
      */
+    @Metadata(description = "overwrites the XAdES namespace parameter value", 
javaType = "String")
     public static final String HEADER_XADES_NAMESPACE = 
"CamelXmlSignatureXAdESNamespace";
 
     /**
@@ -109,7 +123,10 @@ public final class XmlSignatureConstants {
      * header value will have no effect.
      * 
      */
+    @Metadata(description = "overwrites the XAdES prefix parameter value", 
javaType = "String")
     public static final String HEADER_XADES_PREFIX = 
"CamelXmlSignatureXAdESPrefix";
+    @Metadata(description = "The name of the charset", javaType = "String")
+    public static final String CHARSET_NAME = Exchange.CHARSET_NAME;
 
     private XmlSignatureConstants() {
         // no instance
diff --git 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerProcessor.java
 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerProcessor.java
index 6bc79a7e0ad..1c83a20d345 100644
--- 
a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerProcessor.java
+++ 
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignerProcessor.java
@@ -894,7 +894,7 @@ public class XmlSignerProcessor extends 
XmlSignatureProcessor {
 
     protected void setOutputEncodingToMessageHeader(Message message) {
         if (getConfiguration().getOutputXmlEncoding() != null) {
-            message.setHeader(Exchange.CHARSET_NAME, 
getConfiguration().getOutputXmlEncoding());
+            message.setHeader(XmlSignatureConstants.CHARSET_NAME, 
getConfiguration().getOutputXmlEncoding());
         }
     }
 

Reply via email to