1
我一直在尋找這方面的東西,目前看起來並不看好,試圖獲得一個正在使用第三方服務(下面的示例請求,來自java客戶端)的客戶端應用程序。一個問題是,它期望一個元素在身體被加密。WCF - 實現需要加密一個soap:body元素的客戶端,怎麼樣?
理想情況下,這將是一個WCF解決方案,儘管我已經讀了一些關於使用WSE1/2/3來接近這個(WSE停滯不前的人)的地方,有沒有人需要解決這種類型的問題?
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://editedURL">
<soap:Header>
<wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Timestamp-2d960151-fc35-4522-a8cd-b463025209d8">
<wsu:Created>2010-11-23T16:17:36Z</wsu:Created>
</wsu:Timestamp>
<wsse:BinarySecurityToken ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="SecurityToken-68e70781-8ff5-4e08-b066-8b9c6badef37"><!--token was here --></wsse:BinarySecurityToken>
<xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:Reference URI="#SecurityToken-68e70781-8ff5-4e08-b066-8b9c6badef37"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
</wsse:SecurityTokenReference>
</KeyInfo>
<xenc:CipherData>
<xenc:CipherValue><!--cypher was here --></xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI="#Enc-5293b4f0-9aa5-4c37-ad1c-7c55c7d9ded1"/>
</xenc:ReferenceList>
</xenc:EncryptedKey>
</wsse:Security>
</soap:Header>
<soap:Body>
<tns:Authenticate>
<authIn>
<authID><!-- user id was here plaintext --></authID>
<authPwd wsu:Id="Id-8bac7fa6-fac9-4ce4-8a5e-3b221c64ca76"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<xenc:EncryptedData Id="Enc-5293b4f0-9aa5-4c37-ad1c-7c55c7d9ded1" Type="http://www.w3.org/2001/04/xmlenc#Content"
mlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<xenc:CipherData>
<xenc:CipherValue><!-- encrypted password was here --></xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</authPwd>
<authServer><!-- domain was here plaintext --></authServer>
</authIn>
</tns:Authenticate>
</soap:Body>
</soap:Envelope>
的痛點是在肥皂authPwd元素:身體,感謝任何見解
謝謝,你剛纔提到的密封類是我以前發現的,它在這個意義上有點令人失望。就服務而言,它不是我們的,但我可能會嘗試傳遞一些想法(我們也有它們),這項服務也在ssl下託管......我想我們必須嘗試哄騙提供商修改服務 – curtisk
如果您有HTTPS,則通信是安全的。 HTTPS將添加傳輸級別簽名和加密。在這種情況下,問題就是爲什麼你也有消息安全?除了整個消息傳遞的性能下降之外,它可能沒有任何意義。 –
我不知道,我同意......不得不與提供者談論它,我認爲這只是一個謹慎的過度 – curtisk