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 元素免受篡改,您可以添加对已签名 info 元素的引用,以便通过签名值进行保护。默认值为 true。只有 KeyInfo 被 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 元素的规范方法。您可以使用帮助程序方法 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 属性值,则必须设置资源 schema URI (setSchemaResourceUri (String)),因为 schema 验证器会找出哪些属性是 ID 属性。在信封或分离的情况下将忽略。 | 字符串 | |
camel.component.xmlsecurity.signer-configuration.crypto-context-properties | 设置加密上下文属性。请参阅链接 XMLCryptoContext#setProperty (String, Object)。可能的属性在 XMLSignContext 中定义,一个 XMLValidateContext (请参阅支持的属性)。默认情况下,将以下属性设置为 XML 验证的布尔值 .TRUE。如果要关闭这些功能,您必须将属性值设置为 boolean#FALSE. 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 | 对于签名过程,需要一个私钥。您可以指定一个提供此私钥的密钥访问器 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。对于 enveloped 签名的参数 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。对于信封和分离的 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 架构的 classpath。必须在分离的 XML 签名问题单中指定,以确定 ID 属性,可以在信封和信封案例中设置。如果设置,则使用指定的 XML 模式验证 XML 文档。schema 资源 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。如果此参数设为 (空字符串),则在 signature 元素中不会创建 Id 属性。 | 字符串 | |
camel.component.xmlsecurity.signer-configuration.transform-methods | 在计算摘要前,转换在消息正文上执行的信息。默认情况下,会添加 C14n,并在信封签名的情况下(请参阅选项 parentLocalName)也添加到列表的位置 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 限制远程访问,您可以设置自己的 dereferencer。可选参数。如果没有设置提供程序默认解引用器,则使用它来解决 URI 片段、HTTP、文件和 XPpointer URI。注意:实现依赖于供应商! | URIDereferencer | |
camel.component.xmlsecurity.signer-configuration.xpaths-to-id-attributes | 定义在分离的情况下通过 XPATH 表达式到 ID 属性签名的元素(类型 ID 的属性)。对于通过 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 中定义,一个 XMLValidateContext (请参阅支持的属性)。默认情况下,将以下属性设置为 XML 验证的布尔值 .TRUE。如果要关闭这些功能,您必须将属性值设置为 boolean#FALSE. 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 签名元素(带有本地名称 Signature 和 namesapce 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 架构的 classpath。必须在分离的 XML 签名问题单中指定,以确定 ID 属性,可以在信封和信封案例中设置。如果设置,则使用指定的 XML 模式验证 XML 文档。schema 资源 URI 可以被标头 XmlSignatureConstants#HEADER_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 | Bean,在验证后将 XML 签名映射到 output-message。应该如何通过选项 outputNodeSearchType、outputNodeSearch 和 removeSignatureElements 来配置此映射。默认实现提供了三种可能性,它们与三个输出节点搜索类型 Default、ElementName 和 XPath 相关。默认实现决定了节点,然后被序列化并设置为输出消息的正文(如果搜索类型为 ElementName),则输出节点(本例中为元素)由搜索值中定义的本地名称和命名空间决定(请参阅 outputNodeSearch)。如果搜索类型是 XPath,则输出节点由搜索值中指定的 XPath 决定(在这种情况下,输出节点可以是 Element、TextNode 或 Document 类型)。如果输出节点搜索类型是 Default,则应用以下规则: 在信封 XML 签名案例中(这是 URI= 的引用并转换 http://www.w3.org/2000/09/xmldsig#enveloped-signature),则传入的 XML 文档,但没有 Signature 元素的 Signature 元素被设置为输出消息正文。在非enveloped XML 签名问题单中,消息正文由引用的对象决定;这在 Enveloping XML Signature Case 中的 Output Node Determination in Enveloping XML 签名问题单中进行了更详细的说明。 | XmlSignature2Message | |
camel.dataformat.securexml.add-key-value-for-encrypted-key | 是否在 EncryptedKey 结构中添加用于加密会话密钥的公钥作为 KeyValue。 | true | 布尔值 |
camel.dataformat.securexml.content-type-header | 如果数据格式能够这样做,则数据格式是否应该使用 data 格式的类型设置 Content-Type 标头。例如,用于数据格式到 XML 的 application/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 的 KeyStore 实例的配置选项。 | 字符串 | |
camel.dataformat.securexml.key-password | 要从 KeyStore 检索私钥的密码。此密钥用于非对称解密。 | 字符串 | |
camel.dataformat.securexml.mgf-algorithm | 用于 RSA OAEP 算法的 MGF 算法。可用的选择有: 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 Byte 键 | 字符串 | |
camel.dataformat.securexml.pass-phrase-byte | 用作 passPhrase 的字节来加密/解密内容。必须提供 passPhrase。如果没有指定 passPhrase,则使用默认的 passPhrase。passPhrase 需要与适当的加密算法一起放置。例如,使用 TRIPLEDES,passPhase 只能是另一个 24 Byte 键 | Byte[] | |
camel.dataformat.securexml.recipient-key-alias | 在执行非对称密钥加密或解密时,用于从 KeyStore 检索接收者的公钥或私钥时使用的密钥别名。 | 字符串 | |
camel.dataformat.securexml.secure-tag | XPath 引用为加密/解密所选的 XML Element。如果没有指定标签,则整个有效负载都会加密/解密。 | 字符串 | |
camel.dataformat.securexml.secure-tag-contents | 用于指定 XML Element 是否要加密的布尔值,或者 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_192 XMLCipher.CAMELLIA_256 XMLCipher.SEED_128 XMLCipher. | TRIPLEDES | 字符串 |
374.6.1. 输出节点确定在 Enveloping XML 签名问题单中 复制链接链接已复制到粘贴板!
验证节点后,从 XML 签名文档中提取节点,该文档最终会返回到 output-message 正文。在信封 XML 签名问题单中,XmlSignature2Message
的默认实现 DefaultXmlSignature2Message
会通过以下方式为节点搜索类型 Default
(请参阅选项 xmlSignature2Message
):
首先确定对象引用:
-
仅考虑相同的文档引用(URI 必须以
#
开头) - 另外,还考虑通过清单对对象的间接引用。
- 生成的对象引用数量必须是 1。
-
仅考虑相同的文档引用(URI 必须以
- 然后,对象被解引用,对象必须仅包含一个 XML 元素。此元素返回为输出节点。
这意味着信封 XML 签名必须具有任一结构:
或结构: