XML Security

XML Security

Scheme: xmlsecurity
Name Kind Type Required Deprecated Default Value Enum Values Description
command path org.apache.camel.component.xmlsecurity.XmlCommand true false sign
verify
name path java.lang.String true false
keyAccessor parameter org.apache.camel.component.xmlsecurity.api.KeyAccessor false
canonicalizationMethod parameter javax.xml.crypto.AlgorithmMethod false Optional canonicalization method for SignerInfo. Default value is {@link CanonicalizationMethod#INCLUSIVE}.
signatureAlgorithm parameter java.lang.String false Signature algorithm. Default value is "http://www.w3.org/2000/09/xmldsig#rsa-sha1". @param signatureAlgorithm signature algorithm
digestAlgorithm parameter java.lang.String false Digest algorithm URI. Optional parameter. This digest algorithm is used for calculating the digest of the input message. If this digest algorithm is not specified then the digest algorithm is calculated from the signature algorithm. Example: "http://www.w3.org/2001/04/xmlenc#sha256"
addKeyInfoReference parameter java.lang.Boolean false true In order to protect the KeyInfo element from tampering you can add a reference to the signed info element so that it is protected via the signature value. The default value is true.

Only relevant when a KeyInfo is returned by {@link KeyAccessor}. and {@link KeyInfo#getId()} is not null. @param addKeyInfoReference boolean value

prefixForXmlSignatureNamespace parameter java.lang.String false ds Namespace prefix for the XML signature namespace "http://www.w3.org/2000/09/xmldsig#". Default value is "ds". If null or an empty value is set then no prefix is used for the XML signature namespace.

See best practice http://www.w3.org/TR/xmldsig-bestpractices/#signing-xml- without-namespaces @param prefixForXmlSignatureNamespace prefix

contentObjectId parameter java.lang.String false Sets the content object Id attribute value. By default a UUID is generated. If you set the null value, then a new UUID will be generated. Only used in the enveloping case. @param contentObjectId
signatureId parameter java.lang.String false Sets the signature Id. If this parameter is not set (null value) then a unique ID is generated for the signature ID (default). If this parameter is set to "" (empty string) then no Id attribute is created in the signature element. @param signatureId
contentReferenceUri parameter java.lang.String false The URI of the content reference. This value can be overwritten by the header {@link XmlSignatureConstants#HEADER_CONTENT_REFERENCE_URI}. Can only be used in connection with the enveloped case when you specify a schema (see {@link #setSchemaResourceUri(String)}. Will be ignored in the enveloping and detached case.
contentReferenceType parameter java.lang.String false Type of the content reference. The default value is null. This value can be overwritten by the header {@link XmlSignatureConstants#HEADER_CONTENT_REFERENCE_TYPE}.
parentLocalName parameter java.lang.String false Local name of the parent element to which the XML signature element will be added. Only relevant for enveloped XML signature. Alternatively you can also use {@link #setParentXpath(XPathFilterParameterSpec)}.

Default value is null. The value must be null for enveloping and detached XML signature.

This parameter or the parameter {@link #setParentXpath(XPathFilterParameterSpec)} for enveloped signature and the parameter {@link #setXpathsToIdAttributes(List)} for detached signature must not be set in the same configuration.

If the parameters parentXpath and parentLocalName are specified in the same configuration then an exception is thrown. @param parentLocalName local name

parentNamespace parameter java.lang.String false Namespace of the parent element to which the XML signature element will be added.
plainText parameter java.lang.Boolean false false Indicator whether the message body contains plain text. The default value is false, indicating that the message body contains XML. The value can be overwritten by the header {@link XmlSignatureConstants#HEADER_MESSAGE_IS_PLAIN_TEXT}.
plainTextEncoding parameter java.lang.String false Encoding of the plain text. Only relevant if the message body is plain text (see parameter {@link #plainText}. Default value is "UTF-8".
keyAccessorName parameter java.lang.String false
canonicalizationMethodName parameter java.lang.String false
transformMethodsName parameter java.lang.String false
propertiesName parameter java.lang.String false
baseUri parameter java.lang.String false You can set a base URI which is used in the URI dereferencing. Relative URIs are then concatenated with the base URI. @param baseUri base URI @see XMLCryptoContext#setBaseURI(String)
cryptoContextProperties parameter java.util.Map false Sets the crypto context properties. See {@link XMLCryptoContext#setProperty(String, Object)}. Possible properties are defined in {@link XMLSignContext} an {@link XMLValidateContext} (see Supported Properties).

The following properties are set by default to the value {@link Boolean#TRUE} for the XML validation. If you want to switch these features off you must set the property value to {@link Boolean#FALSE}.

  • "org.jcp.xml.dsig.validateManifests"
  • "javax.xml.crypto.dsig.cacheReference"
@param cryptoContextProperties
disallowDoctypeDecl parameter java.lang.Boolean false true Disallows that the incoming XML document contains DTD DOCTYPE declaration. The default value is {@link Boolean#TRUE}. @param disallowDoctypeDecl if set to {@link Boolean#FALSE} then DOCTYPE declaration is allowed, otherwise not
omitXmlDeclaration parameter java.lang.Boolean false false Indicator whether the XML declaration in the outgoing message body should be omitted. Default value is false. Can be overwritten by the header {@link XmlSignatureConstants#HEADER_OMIT_XML_DECLARATION}.
clearHeaders parameter java.lang.Boolean false true Determines if the XML signature specific headers be cleared after signing and verification. Defaults to true.
schemaResourceUri parameter java.lang.String false Classpath to the XML Schema. Must be specified in the detached XML Signature case for determining the ID attributes, might be set in the enveloped and enveloping case. If set, then the XML document is validated with the specified XML schema. The schema resource URI can be overwritten by the header {@link XmlSignatureConstants#HEADER_SCHEMA_RESOURCE_URI}.
outputXmlEncoding parameter java.lang.String false The character encoding of the resulting signed XML document. If null then the encoding of the original XML document is used. @param outputXmlEncoding character encoding
verifierConfiguration parameter org.apache.camel.component.xmlsecurity.processor.XmlVerifierConfiguration false
exchangePattern parameter org.apache.camel.ExchangePattern false InOnly InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the default exchange pattern when creating an exchange
synchronous parameter boolean false false Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).