374.6. Spring Boot Auto-Configuration


组件支持 63 个选项,如下所列。

Expand
Name描述默认值类型

camel.component.xmlsecurity.enabled

启用 xmlsecurity 组件

true

布尔值

camel.component.xmlsecurity.resolve-property-placeholders

组件是否应在启动时解析属性占位符。只有 String 类型的属性可以使用属性占位符。

true

布尔值

camel.component.xmlsecurity.signer-configuration.add-key-info-reference

为了防止 KeyInfo 元素被篡改,您可以添加对已签名 info 元素的引用,使其可以通过签名值进行保护。默认值为 true。只有在 KeyAccessor. 和 KeyInfo 不是 null 时,才会相关。

true

布尔值

camel.component.xmlsecurity.signer-configuration.base-uri

您可以设置一个在 URI 解引用中使用的基本 URI。然后,相对 URI 与基础 URI 进行连接。

 

字符串

camel.component.xmlsecurity.signer-configuration.canonicalization-method

在计算摘要前,用于规范 SignedInfo 元素的规范方法。您可以使用帮助程序方法 XmlSignatureHelper.getCanonicalizationMethod (String algorithm)或 getCanonicalizationMethod (String algorithm, List inclusiveNamespacePrefixes)来创建规范方法。

 

AlgorithmMethod

camel.component.xmlsecurity.signer-configuration.canonicalization-method-name

  

字符串

camel.component.xmlsecurity.signer-configuration.clear-headers

确定在签名和验证后是否清除特定 XML 签名的标头。默认值为 true。

true

布尔值

camel.component.xmlsecurity.signer-configuration.content-object-id

设置内容对象 Id 属性值。默认情况下会生成 UUID。如果设置 null 值,则会生成一个新的 UUID。仅在信封问题单中使用。

 

字符串

camel.component.xmlsecurity.signer-configuration.content-reference-type

内容引用的类型。默认值为 null。此值可以被标头 XmlSignatureConstants#HEADER_CONTENT_REFERENCE_TYPE 覆盖。

 

字符串

camel.component.xmlsecurity.signer-configuration.content-reference-uri

要签名的内容的引用 URI。仅在信封问题单中使用。如果引用 URI 包含 ID 属性值,则必须设置资源架构 URI (setSchemaResourceUri (String),因为 schema 验证器将查找哪些属性是 ID 属性。在信封或分离的情况下将被忽略。

 

字符串

camel.component.xmlsecurity.signer-configuration.crypto-context-properties

设置加密策略属性。请参阅 link XMLCryptoContext SerialsetProperty (String, Object)。可能的属性在 XMLSignContext 中定义(请参阅支持的属性)。对于 XML 验证,以下属性默认设置为 XML 验证的值 Boolean#TRUE。如果要关闭这些功能,您必须将属性值设置为 Boolean failingFALSE. org.jcp.xml.dsig.validateManifests javax.xml.crypto.dsig.cacheReference

 

Map

camel.component.xmlsecurity.signer-configuration.digest-algorithm

摘要算法 URI。可选参数。此摘要算法用于计算输入消息摘要。如果没有指定此摘要算法,则会从签名算法计算摘要算法。示例 :http://www.w3.org/2001/04/xmlenc#sha256

 

字符串

camel.component.xmlsecurity.signer-configuration.disallow-doctype-decl

不允许传入的 XML 文档包含 DTD DOCTYPE 声明。默认值为 boolean#TRUE。

true

布尔值

camel.component.xmlsecurity.signer-configuration.key-accessor

对于签名过程,需要私钥。您可以指定提供此私钥的密钥 accessor bean。密钥访问器 Bean 必须实施 KeyAccessor 接口。软件包 org.apache.camel.component.xmlsecurity.api 包含从 Java 密钥存储读取私钥的默认实施类 DefaultKeyAccessor。

 

KeyAccessor

camel.component.xmlsecurity.signer-configuration.key-accessor-name

  

字符串

camel.component.xmlsecurity.signer-configuration.omit-xml-declaration

指示是否应省略传出消息正文中的 XML 声明。默认值为 false。可以被标头 XmlSignatureConstants#HEADER_OMIT_XML_DECLARATION 覆盖。

false

布尔值

camel.component.xmlsecurity.signer-configuration.output-xml-encoding

生成的签名 XML 文档中的字符编码。如果为 null,则使用原始 XML 文档的编码。

 

字符串

camel.component.xmlsecurity.signer-configuration.parent-local-name

将添加到 XML 签名元素的父元素的本地名称。仅适用于信封的 XML 签名。或者,您也可以使用 setParentXpath (XPathFilterParameterSpec)。默认值为 null。对于信封和分离的 XML 签名,该值必须是 null。这个参数或参数 setParentXpath (XPathFilterParameterSpec)用于 enveloped 签名,参数 setXpathsToIdAttributes (List)不得在同一配置中设置。如果在同一配置中指定了 parentXpath 和 parentLocalName 参数,则会抛出异常。

 

字符串

camel.component.xmlsecurity.signer-configuration.parent-namespace

将添加到 XML 签名元素的 parent 元素的命名空间。

 

字符串

camel.component.xmlsecurity.signer-configuration.parent-xpath

将 XPath 设置为在信封问题单中查找父节点。您可以通过此方法指定父节点,或使用方法 setParentLocalName (String)和 setParentNamespace (String)指定父节点。默认值为 null。对于信封和分离的 XML 签名,该值必须是 null。如果在同一配置中指定了 parentXpath 和 parentLocalName 参数,则会抛出异常。

 

XPathFilterParameter Spec

camel.component.xmlsecurity.signer-configuration.plain-text

指示消息正文是否包含纯文本。默认值为 false,表示消息正文包含 XML。该值可以被标头 XmlSignatureConstants#HEADER_MESSAGE_IS_PLAIN_TEXT 覆盖。

false

布尔值

camel.component.xmlsecurity.signer-configuration.plain-text-encoding

纯文本编码。仅在消息正文是纯文本时相关(请参阅参数 plainText)。默认值为 UTF-8。

UTF-8

字符串

camel.component.xmlsecurity.signer-configuration.prefix-for-xml-signature-namespace

XML 签名命名空间 http://www.w3.org/2000/09/xmldsig# 的命名空间前缀。默认值为 ds。如果设置了 null 或空值,则不会将前缀用于 XML 签名命名空间。查看没有命名空间的最佳实践 http://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-

ds

字符串

camel.component.xmlsecurity.signer-configuration.properties

要在包含额外属性的 XML 签名中添加其他参考和对象,您可以提供一个实现 XmlSignatureProperties 接口的 bean。

 

XmlSignatureProperties

camel.component.xmlsecurity.signer-configuration.properties-name

  

字符串

camel.component.xmlsecurity.signer-configuration.schema-resource-uri

到 XML 架构的类别路径。必须在分离的 XML 签名案例中指定,以确定 ID 属性,可以在信封和信封情况下设置。如果设置,则使用指定的 XML 模式验证 XML 文档。模式资源 URI 可以被标头 XmlSignatureConstantsAllHEADER_SCHEMA_RESOURCE_URI 覆盖。

 

字符串

camel.component.xmlsecurity.signer-configuration.signature-algorithm

签名算法.默认值为 http://www.w3.org/2000/09/xmldsig#rsa-sha1

http://www.w3.org/2000/09/xmldsig#rsa-sha1

字符串

camel.component.xmlsecurity.signer-configuration.signature-id

设置签名 Id。如果没有设置此参数(null 值),则会为签名 ID (默认)生成唯一的 ID。如果此参数设为 (空字符串),则在 signature 元素中不会创建 Id 属性。

 

字符串

camel.component.xmlsecurity.signer-configuration.transform-methods

在计算摘要之前,在消息正文上执行转换。默认情况下,添加了 C14n,如果信封签名(请参阅选项 parentLocalName), http://www.w3.org/2000/09/xmldsig#enveloped-signature 也添加到列表的位置 0 中。使用 XmlSignatureHelper 中的方法创建转换方法。

 

list

camel.component.xmlsecurity.signer-configuration.transform-methods-name

  

字符串

camel.component.xmlsecurity.signer-configuration.uri-dereferencer

如果要通过引用 URI 限制远程访问,您可以设置自己的 dereferencer。可选参数。如果没有设置供应商默认解引用器,则会使用它解析 URI 片段、HTTP、文件和 XPpointer URI。注意:该实施依赖于供应商!

 

URIDereferencer

camel.component.xmlsecurity.signer-configuration.xpaths-to-id-attributes

通过 XPATH 表达式将分离问题单中签名的元素定义为 ID 属性(类型为 ID 的属性)。对于通过 XPATH 表达式发现的每个元素,会创建一个分离的签名,其引用 URI 包含对应的属性值(使用 ':')。签名成为已签名元素的最后同级数据。首先对具有更深层次的元素进行签名。您还可以通过标头 XmlSignatureConstants SerialHEADER_XPATHS_TO_ID_ATTRIBUTES 动态设置 XPATH 列表。用于 enveloped 签名的参数 setParentLocalName (String)或 setParentXpath (XPathFilterParameterSpec),对于分离签名的此参数不能在同一配置中设置。

 

list

camel.component.xmlsecurity.verifier-configuration.base-uri

您可以设置一个在 URI 解引用中使用的基本 URI。然后,相对 URI 与基础 URI 进行连接。

 

字符串

camel.component.xmlsecurity.verifier-configuration.clear-headers

确定在签名和验证后是否清除特定 XML 签名的标头。默认值为 true。

true

布尔值

camel.component.xmlsecurity.verifier-configuration.crypto-context-properties

设置加密策略属性。请参阅 link XMLCryptoContext SerialsetProperty (String, Object)。可能的属性在 XMLSignContext 中定义(请参阅支持的属性)。对于 XML 验证,以下属性默认设置为 XML 验证的值 Boolean#TRUE。如果要关闭这些功能,您必须将属性值设置为 Boolean failingFALSE. org.jcp.xml.dsig.validateManifests javax.xml.crypto.dsig.cacheReference

 

Map

camel.component.xmlsecurity.verifier-configuration.disallow-doctype-decl

不允许传入的 XML 文档包含 DTD DOCTYPE 声明。默认值为 boolean#TRUE。

true

布尔值

camel.component.xmlsecurity.verifier-configuration.key-selector

提供验证 XML 签名的密钥。

 

KeySelector

camel.component.xmlsecurity.verifier-configuration.omit-xml-declaration

指示是否应省略传出消息正文中的 XML 声明。默认值为 false。可以被标头 XmlSignatureConstants#HEADER_OMIT_XML_DECLARATION 覆盖。

false

布尔值

camel.component.xmlsecurity.verifier-configuration.output-node-search

设置输出节点搜索值,以确定 XML 签名文档中应设置为输出消息正文的节点。值的类取决于输出节点搜索的类型。输出节点搜索转发到 XmlSignature2Message。

 

对象

camel.component.xmlsecurity.verifier-configuration.output-node-search-type

确定用于确定在输出消息 bodyF 中序列化的输出节点的搜索类型。请参阅 setOutputNodeSearch (Object)。您可以在 DefaultXmlSignature2Message 中找到的默认搜索类型。

default

字符串

camel.component.xmlsecurity.verifier-configuration.output-xml-encoding

生成的签名 XML 文档中的字符编码。如果为 null,则使用原始 XML 文档的编码。

 

字符串

camel.component.xmlsecurity.verifier-configuration.remove-signature-elements

指示 XML 签名元素(带有本地名称签名和名称sapce http://www.w3.org/2000/09/xmldsig#的元素)是否应该从文档设置为输出消息。通常,只有当 XML 签名被接收时,才需要这样做。默认值为 boolean#FALSE。这个参数被转发到 XmlSignature2Message。如果输出节点搜索类型为 DefaultXmlSignature2Message helloOUTPUT_NODE_SEARCH_TYPE_DEFAULT.F,则此指标无效

false

布尔值

camel.component.xmlsecurity.verifier-configuration.schema-resource-uri

到 XML 架构的类别路径。必须在分离的 XML 签名案例中指定,以确定 ID 属性,可以在信封和信封情况下设置。如果设置,则使用指定的 XML 模式验证 XML 文档。模式资源 URI 可以被标头 XmlSignatureConstantsAllHEADER_SCHEMA_RESOURCE_URI 覆盖。

 

字符串

camel.component.xmlsecurity.verifier-configuration.secure-validation

启用安全验证。如果为 true,则启用安全验证。

true

布尔值

camel.component.xmlsecurity.verifier-configuration.uri-dereferencer

如果要通过引用 URI 限制远程访问,您可以设置自己的 dereferencer。可选参数。如果没有设置供应商默认解引用器,则会使用它解析 URI 片段、HTTP、文件和 XPpointer URI。注意:该实施依赖于供应商!

 

URIDereferencer

camel.component.xmlsecurity.verifier-configuration.validation-failed-handler

处理不同的验证失败情况。默认实施会针对不同的情况抛出特定的例外(所有例外情况都有软件包名称 org.apache.camel.component.xmlsecurity.api,它是 XmlSignatureInvalidException 的子类。如果签名值验证失败,则会抛出 XmlSignatureInvalidValueException。如果引用验证失败,则会抛出 XmlSignatureInvalidContentHashException。如需更多信息,请参阅 JavaDoc。

 

ValidationFailedHandler

camel.component.xmlsecurity.verifier-configuration.validation-failed-handler-name

处理程序的名称为 @param validationFailedHandlerName

 

字符串

camel.component.xmlsecurity.verifier-configuration.xml-signature-checker

此接口允许应用程序在执行验证前检查 XML 签名。建议在 http://www.w3.org/TR/xmldsig-bestpractices/#check-what-is-signed中执行此步骤

 

XmlSignatureChecker

camel.component.xmlsecurity.verifier-configuration.xml-signature2-message

在验证后将 XML 签名映射到 output-message 的 bean。应该如何通过选项 outputNodeSearchType、outputNodeSearch 和 removeSignatureElements 来配置此映射。默认实现提供了三种与三种输出节点搜索类型 Default, ElementName, 和 XPath 相关的可能性。默认实现决定了一个节点,它被序列化并设置为输出消息的正文(如果搜索类型是 ElementName),则输出节点(在这种情况下,一个元素)由搜索值中定义的本地名称和命名空间决定(请参阅选项 outputNodeSearch)。如果搜索类型是 XPath,则输出节点由搜索值中指定的 XPath 决定(本例中为输出节点可以是 type Element, TextNode 或 Document)。如果输出节点搜索类型是 Default,则应用以下规则: 在信封的 XML 签名案例中(使用 URI= 的引用并转换 http://www.w3.org/2000/09/xmldsig#enveloped-signature),如果没有 Signature 元素将传入的 XML 文档设置为输出消息正文。在非嵌套的 XML 签名案例中,消息正文由引用的对象决定;这在输出节点在 Enveloping XML 签名问题单中进行了更详细的说明。

 

XmlSignature2Message

camel.dataformat.securexml.add-key-value-for-encrypted-key

是否在 EncryptedKey 结构中将用于加密会话密钥的公钥添加为 KeyValue。

true

布尔值

camel.dataformat.securexml.content-type-header

如果数据格式可以这样做,则数据格式是否应使用 data 格式的类型设置 Content-Type 标头。例如,用于数据格式的 application/xml 放入 XML 或用于数据格式的 application/json,如 JSon 等。

false

布尔值

camel.dataformat.securexml.digest-algorithm

与 RSA OAEP 算法一起使用的摘要算法。可用的选择有:XMLCipher.SHA1 XMLCipher.SHA256 XMLCipher.SHA512 默认值是 XMLCipher.SHA1

SHA1

字符串

camel.dataformat.securexml.enabled

启用 securexml dataformat

true

布尔值

camel.dataformat.securexml.key-cipher-algorithm

用于加密/解密非对称密钥的密码算法。可用的选择包括: XMLCipher.RSA_v1dot5 XMLCipher.RSA_OAEP XMLCipher.RSA_OAEP_11,默认值为 XMLCipher.RSA_OAEP

RSA_OAEP

字符串

camel.dataformat.securexml.key-or-trust-store-parameters-id

代表 registry 中的 KeyStore 实例,用于创建和加载代表发件人 trustStore 或接收者的 keyStore 的 KeyStore 实例的配置选项。

 

字符串

camel.dataformat.securexml.key-password

用于从 KeyStore 检索私钥的密码。此密钥用于非对称解密。

 

字符串

camel.dataformat.securexml.mgf-algorithm

用于 RSA OAEP 算法的 MGF Algorithm。可用的选择包括: EncryptionConstants.MGF1_SHA1 EncryptionConstants.MGF1_SHA256 EncryptionConstants.MGF1_SHA512,默认值为 EncryptionConstants.MGF1_SHA1

MGF1_SHA1

字符串

camel.dataformat.securexml.pass-phrase

用作 passPhrase 用于加密/解密内容的字符串。必须提供 passPhrase。如果没有指定 passPhrase,则使用默认 passPhrase。passPhrase 需要与适当的加密算法一起使用。例如,使用 TRIPLEDES passPhase 只能是一个 24 个字节键

 

字符串

camel.dataformat.securexml.pass-phrase-byte

用作 passPhrase 用于加密/解密内容的字节。必须提供 passPhrase。如果没有指定 passPhrase,则使用默认 passPhrase。passPhrase 需要与适当的加密算法一起使用。例如,使用 TRIPLEDES passPhase 只能是一个 24 个字节键

 

Byte[]

camel.dataformat.securexml.recipient-key-alias

执行非对称密钥加密或解密时从 KeyStore 检索收件人的公钥或私钥时使用的密钥别名。

 

字符串

camel.dataformat.securexml.secure-tag

XPath 引用所选的用于加密/解密的 XML 元素。如果没有指定标签,则整个有效负载会被加密/解密。

 

字符串

camel.dataformat.securexml.secure-tag-contents

一个布尔值,用于指定 XML 元素是否被加密或者 XML Element false 的内容 = Element Level true = Element Content Level

false

布尔值

camel.dataformat.securexml.xml-cipher-algorithm

用于加密/解密 XML 消息内容的密码算法。可用的选择包括: XMLCipher.TRIPLEDES XMLCipher.AES_128 XMLCipher.AES_128_GCM XMLCipher.AES_192 XMLCipher.AES_192_GCM XMLCipher.AES_256 XMLCipher.AES_256_GCM XMLCipher.SEED_128 XMLCipher.CAMELLIA_128 XMLCipher.CAMELLIA_192 XMLCipher.CAMELLIA_256_256_256_ARCipher.SEED_128 XMLCipher.CAMELLIA_192 XMLCipher.CAMELLIA_256_256_256_256_GCM是 MLCipher.TRIPLEDES。

TRIPLEDES

字符串

验证节点从 XML 签名文档中提取后,该文档最后返回到 output-message 正文。在信封 XML 签名案例中,XmlSignature2Message 的默认实现 DefaultXmlSignature2Message 以下列方式为节点搜索类型 Default (请参阅选项 xmlSignature2Message):

  • 首先决定对象引用:

    • 只考虑相同的文档引用(URI 必须以 #开头)
    • 另外,还考虑通过清单对对象进行间接相同的文档引用。
    • 生成的对象引用数量必须为 1。
  • 然后,对象被解引用,对象必须只包含一个 XML 元素。这个元素作为输出节点返回。

这意味着信封 XML 签名必须具有该结构之一:

<Signature>
      <SignedInfo>
         <Reference URI="#object"/>
         <!-- further references possible but they must not point to an Object or Manifest containing an object reference -->
         ...
      </SignedInfo>

      <Object Id="object">
           <!-- contains one XML element which is extracted to the message body -->
      <Object>
      <!-- further object elements possible which are not referenced-->
      ...
      (<KeyInfo>)?
</Signature>

或结构:

<Signature>
      <SignedInfo>
         <Reference URI="#manifest"/>
         <!-- further references  are possible but they must not point to an Object or other manifest containing an object reference -->
         ...
      </SignedInfo>

      <Object >
         <Manifest Id="manifest">
            <Reference URI=#object/>
         </Manifest>
      </Objet>
      <Object Id="object">
          <!-- contains the DOM node which is extracted to the message body -->
      </Object>
       <!-- further object elements possible which are not referenced -->
      ...
      (<KeyInfo>)?
</Signature>
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部