【发布时间】:2016-11-30 08:30:54
【问题描述】:
我是一名 SP,最近需要与 IDP 集成。在 IDP 的文档中,它会向我发送一个 http post 响应。在响应中,有 ds:SignatureValue 和 ds:X509Certificate。有一个类似SAML: Why is the certificate within the Signature?的线程,线程只回答如何检查消息是来自它所说的是谁。
1) ds:SignatureValue 和 ds:X509Certificate 是什么意思?
2) 如何确保回复来自我的 IDP?我的意思是,如果黑客知道我的 http post 地址,他们可以轻松地向我的应用程序发送类似的 http post 请求。我发现http请求头中有一个referer,这样可以安全地验证来自我的IDP的请求吗?
3) IDP 要求我发送 SP 公共签名证书,格式应为 DER 编码的二进制 X.509 (*.CER)。如何创建公开的公开签名证书?
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
<ds:Reference URI="#_2152811999472b94a0e9644dbc932cc3" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:Transforms xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ec:InclusiveNamespaces PrefixList="ds saml samlp xs" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
<ds:DigestValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#">bW1Os7+WykqRt5h0mdv9o3ZF0JI=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
SignatureValue </ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>X509 certification</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
【问题讨论】: