374.6. Spring Boot Auto-Configuration
组件支持 63 选项,它们如下所列。
| 名称 | 描述 | 默认 | 类型 |
|---|---|---|---|
| camel.component.xmlsecurity.enabled | 启用 xmlsecurity 组件 | true | 布尔值 |
| camel.component.xmlsecurity.resolve-property-placeholders | 启动时,组件是否应自行解析属性占位符。只有 String 类型的属性才能使用属性占位符。 | true | 布尔值 |
| camel.component.xmlsecurity.signer-configuration.add-key-info-reference | 为了保护 KeyInfo 元素不受篡改,您可以添加对签名信息元素的引用,以便它通过签名值进行保护。默认值为 true。只有 KeyAccessor 返回的 KeyInfo 和 KeyInfo#getId ()不是 null 时才相关。 | true | 布尔值 |
| camel.component.xmlsecurity.signer-configuration.base-uri | 您可以设置 URI 解引用中使用的基本 URI。然后,相对 URI 与基本 URI 串联。 | 字符串 | |
| camel.component.xmlsecurity.signer-configuration.canonicalization-method | 在计算摘要前,规范性方法用于规范 SignedInfo 元素。您可以使用 helper 方法 XmlSignatureHelper.getCanonicalizationMethod (字符串算法)或 getCanonicalizationMethod (String 算法,ListinclusiveNamespacePrefixes)来创建规范方法。 | 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 属性值,则还必须设置资源 schema URI ( setSchemaResourceUri (String)),因为 schema 验证器将找到哪个属性是 ID 属性。在信封或分离的情况下将被忽略。 | 字符串 | |
| camel.component.xmlsecurity.signer-configuration.crypto-context-properties | 设置加密上下文属性。请参阅链接 XMLCryptoContext#setProperty (String, Object)。在 XMLSignContext a XMLValidateContext 中定义了可能的属性(请参阅支持的属性)。以下属性默认为 XML 验证的值为值#TRUE。如果要关闭这些功能,您必须将属性值设置为 Boolean#FALSE. org.jcp.xml.dsig.validateManifests javax.xml.crypto.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 必须实施 KeyAccessor 接口。软件包 org.apache.camel.component.xmlsecurity.api 包含默认的实施类 DefaultKeyAccessor,它从 Java 密钥存储读取私钥。 | 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。该值必须为 null,以用于信封和分离 XML 签名。用于 enveloped signature 的此参数或参数 setParentXpath (XPathFilterParameterSpec)和参数 setXpathsToIdAttributes (List)不能在同一个配置中设置。如果在同一配置中指定了参数 parentXpath 和 parentLocalName,则会抛出异常。 | 字符串 | |
| camel.component.xmlsecurity.signer-configuration.parent-namespace | 添加 XML 签名元素的父元素的命名空间。 | 字符串 | |
| camel.component.xmlsecurity.signer-configuration.parent-xpath | 在信封问题单中设置 XPath 以查找父节点。您可以通过此方法或父项的本地名称和命名空间来指定父节点,方法为 setParentLocalName (String)和 setParentNamespace (String)。默认值为 null。该值必须为 null,以用于信封和分离 XML 签名。如果在同一配置中指定了参数 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- without-namespaces | 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 Schema 的类路径。在用于决定 ID 属性的分离 XML 签名案例中指定,可以在信封和信封问题单中设置。如果设置,则使用指定的 XML 模式验证 XML 文档。架构资源 URI 可以被标头 XmlSignatureConstants#HEADER_SCHEMA_RESOURCE_URI 覆盖。 | 字符串 | |
| camel.component.xmlsecurity.signer-configuration.signature-algorithm | 签名算法.默认值为 http://www.w3.org/2000/09/xmldsig#rsa-sha1。 | 字符串 | |
| camel.component.xmlsecurity.signer-configuration.signature-id | 设置签名 Id。如果没有设置此参数(null 值),则会为签名 ID (默认)生成唯一的 ID。如果此参数设为 (空字符串),则在签名元素中不会创建 Id 属性。 | 字符串 | |
| camel.component.xmlsecurity.signer-configuration.transform-methods | 在计算摘要之前,在消息正文上执行的转换。默认情况下,添加了 C14n,如果被信封签名(请参阅选项父LocalName)也会在列表的位置 0 中添加了。http://www.w3.org/2000/09/xmldsig#enveloped-signature使用 XmlSignatureHelper 中的方法创建转换方法。 | list | |
| camel.component.xmlsecurity.signer-configuration.transform-methods-name | 字符串 | ||
| camel.component.xmlsecurity.signer-configuration.uri-dereferencer | 如果要通过参考 URI 限制远程访问,您可以设置自己的解引用器。可选参数。如果没有设置提供程序默认解引用器,可以使用该引用程序解析 URI 片段、HTTP、文件和 XPpointer URI。注意:实施是供应商依赖的! | URIDereferencer | |
| camel.component.xmlsecurity.signer-configuration.xpaths-to-id-attributes | 通过 XPATH 表达式,定义在分离中签署的元素到 ID 属性(类型为 ID 的attributes)。对于通过 XPATH 表达式找到的每个元素,会创建分离的签名,其引用 URI 包含对应的属性值(由 '#' 提供)。签名会成为签名元素的最后同级。层次层次层次的元素首先进行签名。您还可以通过标头 XmlSignatureConstants#HEADER_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 | 设置加密上下文属性。请参阅链接 XMLCryptoContext#setProperty (String, Object)。在 XMLSignContext a XMLValidateContext 中定义了可能的属性(请参阅支持的属性)。以下属性默认为 XML 验证的值为值#TRUE。如果要关闭这些功能,您必须将属性值设置为 Boolean#FALSE. org.jcp.xml.dsig.validateManifests javax.xml.crypto.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 | 决定用于决定输出消息正文输出节点的搜索类型。请参阅 setOutputNodeSearch (Object)。您可以在 DefaultXmlSignature2Message 中找到支持的默认搜索类型。 | 默认 | 字符串 |
| 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#OUTPUT_NODE_SEARCH_TYPE_DEFAULT.F | false | 布尔值 |
| camel.component.xmlsecurity.verifier-configuration.schema-resource-uri | XML Schema 的类路径。在用于决定 ID 属性的分离 XML 签名案例中指定,可以在信封和信封问题单中设置。如果设置,则使用指定的 XML 模式验证 XML 文档。架构资源 URI 可以被标头 XmlSignatureConstants#HEADER_SCHEMA_RESOURCE_URI 覆盖。 | 字符串 | |
| camel.component.xmlsecurity.verifier-configuration.secure-validation | 启用安全验证。如果为 true,则启用了安全验证。 | true | 布尔值 |
| camel.component.xmlsecurity.verifier-configuration.uri-dereferencer | 如果要通过参考 URI 限制远程访问,您可以设置自己的解引用器。可选参数。如果没有设置提供程序默认解引用器,可以使用该引用程序解析 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),则输出节点(在本例中为某一元素)由搜索值中定义的本地名称和命名空间(请参阅输出输出NodeSearch)决定。如果搜索类型是 XPath,则输出节点由搜索值中指定的 XPath 决定(本例中为输出节点可以是 Element, TextNode 或 Document)。如果输出节点搜索类型是 Default,则应用以下规则: 在信封 XML 签名案例中(使用 URI= 的引用并转换 http://www.w3.org/2000/09/xmldsig#enveloped-signature),没有 Signature 元素的传入 XML 文档设置为输出消息正文。在非envoped 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 (数据格式)或 application/json 用于数据格式 marshalling to JSon etc。 | 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_OAEPCipher.RSA_OAEP_11 默认值为 XMLCipher.RSA_OAEP | RSA_OAEP | 字符串 |
| camel.dataformat.securexml.key-or-trust-store-parameters-id | 请参考 registry 中的 KeyStore 实例,它用于创建和加载一个代表发件人的信任Store 或收件人的 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 Phase 只能是一个 24 Byte 键 | 字符串 | |
| camel.dataformat.securexml.pass-phrase-byte | 字节用作加密/解密内容的 passPhrase。必须提供 passPhrase。如果没有指定 passPhrase,则使用默认的 passPhrase。passPhrase 需要与相应的加密算法结合使用。例如,使用 TRIPLEDES Phase 只能是一个 24 Byte 键 | 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.AES_192 XMLCipher. .CAMELLIA_128 XMLCipher.CAMELLIA_192 XMLCipher.CAMELLIA_256 的默认值为 MLCipher.TRIPLEDES | TRIPLEDES | 字符串 |
374.6.1. 输出节点确定在 Enveloping XML 签名问题单中 复制链接链接已复制到粘贴板!
在从 XML 签名文档中提取节点验证后,该文档最终返回到 output-message 正文。在信封 XML 签名案例中,默认的实施 DefaultXmlSignature2Message of XmlSignature2Message 对节点搜索类型 Default 进行了这一操作(请参阅选项 xmlSignature2Message):
首先决定对象引用:
-
帐户只考虑相同的文档参考(URI 必须以
#开始) - 另外,将考虑通过清单对对象进行间接相同的文档引用。
- 由此产生的对象引用数量必须是 1。
-
帐户只考虑相同的文档参考(URI 必须以
- 然后,对象会被解引用,对象必须仅包含一个 XML 元素。此元素返回为输出节点。
这意味着,信封 XML 签名必须采用以下结构:
或结构: