【问题标题】:xmlsec1 sign failed - idxmlsec1 签名失败 - id
【发布时间】:2018-06-03 16:13:59
【问题描述】:

在我的 SignInfo 节点中

<ds:Reference URI="#Id-132">...

指的是下面的节点:

<soapenv:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Id-132">

命令:

xmlsec1 --sign --output request-signed.xml --privkey-pem privatekey.pem raw_message.xml

我有这个错误: func=xmlSecXPathDataExecute:file=xpath.c:line=273:obj=unknown:subj=xmlXPtrEval:error=5:libxml2 库函数失败:expr=xpointer(id('Id-132'))

【问题讨论】:

  • 可能与作为 wsu 命名空间一部分的 ID 有关?

标签: xml-signature xmlsec xmlsec1


【解决方案1】:

使用 ids 引用签名是必需的 --id-attr: 参数。示例:

<ds:Reference URI="#Id-132">

<soapenv:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Id-132">

命令:xmlsec1 --sign --output request-signed.xml --privkey-pem privatekey.pem --id-attr:Id raw_message.xml

更多信息:https://snippets.aktagon.com/snippets/758-how-to-sign-xml-documents-using-xmldsig-xml-signature-

【讨论】:

    猜你喜欢
    • 2018-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-02
    • 2018-09-20
    • 2017-11-28
    • 2020-02-17
    相关资源
    最近更新 更多