Ik moet een soap call doen naar een webservice welke middels ws-security is beveiligd. Helaas heb ik geen standaard library voorhanden waarmee ik dit kan realiseren, dus moet ik zelf de signatures berekeenen.
Nu vraag ik me af over welke octet-stream de signature moet worden berekend als dit bijvoorbeeld de volledige soapcall is:
Op dit moment ga ik ervanuit dat dit onderstaande moet zijn:
De signature die hierover wordt berekend wordt echter niet geaccepteerd door het ontvangende systeem.
Nu vraag ik me af over welke octet-stream de signature moet worden berekend als dit bijvoorbeeld de volledige soapcall is:
XML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
| <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <wsse:Security soap:mustUnderstand="1"> <wsu:Timestamp wsu:Id="Timestamp-123456"> <wsu:Created>2011-02-10T10:00:11Z</wsu:Created> <wsu:Expires>2011-02-10T10:20:11Z</wsu:Expires> </wsu:Timestamp> <wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 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" wsu:Id="SecurityToken-123456"...base64-encoded certificaat....</wsse:BinarySecurityToken> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <ds:CanonicalizationMethod xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <Reference URI="#Timestamp-123456"> <Transforms> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </Transforms> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <DigestValue>Q+YugBHTJ3cR0awbzvXUQ8rpKNE=</DigestValue> </Reference> <Reference URI="#body-123456"> <Transforms> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </Transforms> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <DigestValue>ir0z98d7jmvrASZ81THijYDleI8=</DigestValue> </Reference> </SignedInfo> <SignatureValue>...base64-encoded signature...</SignatureValue> <KeyInfo> <wsse:SecurityTokenReference> <wsse:Reference URI="#SecurityToken-123456" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/> </wsse:SecurityTokenReference> </KeyInfo> </Signature> </wsse:Security> </soap:Header> <soap:Body wsu:Id="body-123456."> <foo xmlns="http://foo.bar"> <bar>123456</bar> </foo> </soap:Body> </soap:Envelope> |
Op dit moment ga ik ervanuit dat dit onderstaande moet zijn:
code:
1
| <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsu="" wsu:Id="Timestamp-123456"><wsu:Created xmlns:wsu="">2011-02-10T10:00:11Z</wsu:Created><wsu:Expires xmlns:wsu="">2011-02-10T10:20:11Z</wsu:Expires></wsu:Timestamp><soap:Body xmlns:soap="" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="body-123456"><foo xmlns="http://foo.bar"><bar>123456</bar></foo></soap:Body> |
De signature die hierover wordt berekend wordt echter niet geaccepteerd door het ontvangende systeem.
Diablo III: <GOT> Pteer#2475 --- POE: Dwergux