使用 ws-security 签署消息时要签署什么
我正在向我的 Web 服务添加安全性,并选择签署 Timestamp
和 Token
。
在阅读文档时,我发现了很多示例,其中他们对 SOAP
消息的 Body
进行签名。
我的问题是:什么是最好的签名?
据我了解,如果 Body
非常大,则签署 Body
可能会导致性能问题。
谢谢。
I am adding security to my web service and chose to sign the Timestamp
and Token
.
While reading docs I found a lot of examples where they sign the Body
of the SOAP
message.
My question is: what is best to sign?
From what I understand signing the Body
could lead to performance issues if the Body
is pretty large.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您绝对应该签署整个消息正文。
XMLDSIG 对中定义的引用部分的摘要执行。与 PKI 操作相比,在大型主体中运行 SHA1 等哈希算法只需很少的时间。您不应该担心性能。
You should definitely sign the whole message body.
XMLDSIG is performed on the digests of referenced parts defined in <SignedInfo>. Running a hash algorithm like SHA1 through a large body takes very little time compared with the PKI operations. You shouldn't worry about performance.
如果客户端通过 HTTPS 向服务器发送 WS-Secure SOAP 请求,我的理解是,即使有人嗅探流量,他们也无法解密以查看 SOAP 消息,因此无法对其进行修改。所以我认为没有必要使用双向 SSL。
当通过 HTTPS 使用 WS-Secure 时,我们是否可以不让 HTTPS 负责加密,而只使用 WS-Secure 进行身份验证(即签署 SOAP 消息的某些部分,时间戳、正文或其他内容)?
If a client sends a WS-Secure SOAP request to the server over HTTPS my understanding is that even if someone sniffed the traffic they cannot decrypt it to look at the SOAP message and therefore cannot tinker with it. So I don't see the need for two-way SSL.
When using WS-Secure over HTTPS can we not let the HTTPS take care of encryption and simply use WS-Secure for authentication (ie signing some part of the SOAP message either timestamp or body or something else) ?