Версия для печати
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум на Исходниках.RU > .NET: Распределенные приложения > Реализация клиента веб-сервиса через защищённый протокол


Автор: sergushkin 06.06.14, 11:51
Народ помогите с реализацией кода клиента веб-сервиса на C# через защищенный протокол.
В наличае есть два сертификата и два приватных ключа.

алгоритм ключа RSA дина 2048.

Требуется получить подписанный soap запрос

<{CODE_COLLAPSE_OFF}><{CODE_WRAP_OFF}>
    <?xml version="1.0"?>
    <soapenv:Envelope xmlns:web="http://webservices.api.a3.ru/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
    <wsse:Security xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-CFFA27F7B4C5B9DC4E140083810889510">
    <ds:SignedInfo>
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/>
    <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
    <ds:Reference URI="#UsernameToken-CFFA27F7B4C5B9DC4E14008381086861">
    <ds:Transforms>
    <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
    <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soapenv web"/>
    </ds:Transform>
    </ds:Transforms>
    <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    <ds:DigestValue>2eUWadefu7togWEvO6Vs9P/Iunw=</ds:DigestValue>
    </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>A2EgegYwgPaGZYG7yCVzsnm0fSdR9ZxfpK8cBy2g6hnhnUKTnTW2AwfIJWsh3A51d2AmnfCt1z3c kJVyKQ4/M5dgg6hbRc0aABWHzUhzI9PPgsKevj31sPwuqZKb7iMQcmJfzKJz/7ksldB7ZA3p55v7 Kc7BElmykUZ/ol9Un4p5DCyS8jGHtuELFDZ4n8oqE/E5DR0bVqqBQxVG/rXAxnwzCGilTsIJS3rI HvX9Nr/fzrKdoYovybDQ05ZAPmalrWd998EO5KEc5pfW/zKYE6UthoRxvfHiw2rf9/r9u8+Dxpfr fW1YXp6EQrayW9b3f1P5XUX3/B4AFISPYTlUMg==</ds:SignatureValue>
    <ds:KeyInfo Id="KI-CFFA27F7B4C5B9DC4E14008381088958">
    <wsse:SecurityTokenReference wsu:Id="STR-CFFA27F7B4C5B9DC4E14008381088959">
    <wsse:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">Weg7vtB4sWO/BOPediZFPVQBVPg=</wsse:KeyIdentifier>
    </wsse:SecurityTokenReference>
    </ds:KeyInfo>
    </ds:Signature>
    <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-CFFA27F7B4C5B9DC4E14008381087986">
    <ds:SignedInfo>
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/>
    <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
    <ds:Reference URI="#id-CFFA27F7B4C5B9DC4E14008381087935">
    <ds:Transforms>
    <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
    <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="web"/>
    </ds:Transform>
    </ds:Transforms>
    <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    <ds:DigestValue>AALOJxDI4FUNEuKne1uZ8AZRxAM=</ds:DigestValue>
    </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>ISBC+wAqYTwPl4rXCxqoM/DLOPjkf7zbYy1Zu7phZJ7WziLImorKRG1mzYlMNp9rfi4irYP+/r3L Ej7rUDYMfV408osL6HpSW0Eyq3Zay7zELtue0VzRoSpQ1VPYEJ9qbsvlP5z3vcUvbNEURf79xlX9 UuT8/J4oIUeV2/KVnfFI388wrQHR9KxYdVWSd62XSpIe+FEDB77nDetEtcUtz/0sa748uMrLQz5k x1JcXnQOE+53JU501ujEShGfYpII2dprza5pVQdICtxW228jI53xfNdASWXltW7E8QGJ956tXHbk EsewKIG94AiTYbkuK5vMfoLsQC6O3sqP3cCq+A==</ds:SignatureValue>
    <ds:KeyInfo Id="KI-CFFA27F7B4C5B9DC4E14008381087703">
    <wsse:SecurityTokenReference wsu:Id="STR-CFFA27F7B4C5B9DC4E14008381087824">
    <wsse:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">Weg7vtB4sWO/BOPediZFPVQBVPg=</wsse:KeyIdentifier>
    </wsse:SecurityTokenReference>
    </ds:KeyInfo>
    </ds:Signature>
    <wsse:UsernameToken wsu:Id="UsernameToken-CFFA27F7B4C5B9DC4E14008381086861">
    <wsse:Username>BelMobileSoft</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">bms_code_pass2</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    <soapenv:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-CFFA27F7B4C5B9DC4E14008381087935">
    <web:startWithOpenTemplate>
    <!--Optional:-->
    <recipientId>4159</recipientId>
    </web:startWithOpenTemplate>
    </soapenv:Body>
    </soapenv:Envelope>

Powered by Invision Power Board (https://www.invisionboard.com)
© Invision Power Services (https://www.invisionpower.com)