Предоставление запроса SOAP с запросом PKCS10 и шифрование с помощью сертификата в интерфейсе SOAP - PullRequest
0 голосов
/ 07 ноября 2018

Я нахожусь в процессе отправки соглашения об активации против веб-службы SOAP, чтобы получить сертификат клиента в ответ.

Запрос должен быть снабжен запросом PKCS10 и зашифрован сгенерированным нами сертификатом.

Файл примера, приведенный в документации, содержит много информации, которой у нас нет на данный момент (или которую мы еще не создали).

Сертификат был предоставлен нам из того же веб-сервиса после того, как мы сгенерировали пару ключей с помощью инструмента ключей JDK.

Этот сертификат должен использоваться для шифрования содержимого запроса соглашения об активации.

Мы используем SOAP UI 5.4 для отправки запросов.

Пример SOAP-запроса соглашения об активации выглядит следующим образом:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <wsse:Security 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" soap:mustUnderstand="1">
      <xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="EK-1B758D26C51BFCD86614340101135741">
        <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
        <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
          <wsse:SecurityTokenReference>
            <wsse:KeyIdentifier EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">value</wsse:KeyIdentifier>
          </wsse:SecurityTokenReference>
        </ds:KeyInfo>
        <xenc:CipherData>
          <xenc:CipherValue>value</xenc:CipherValue>
        </xenc:CipherData>
        <xenc:ReferenceList>
          <xenc:DataReference URI="#ED-1B758D26C51BFCD86614340101135852"/>
        </xenc:ReferenceList>
      </xenc:EncryptedKey>
    </wsse:Security>
    <technicalAddress xmlns="http://bankconnect.dk/schema/2014" xmlns:ns2="http://www.w3.org/2000/09/xmldsig#"/>
    <activationHeader xmlns="http://bankconnect.dk/schema/2014" xmlns:ns2="http://www.w3.org/2000/09/xmldsig#">
      <organisationIdentification>
        <mainRegistrationNumber>8079</mainRegistrationNumber>
        <isoCountryCode>DK</isoCountryCode>
      </organisationIdentification>
      <functionIdentification>112233445566778899</functionIdentification>
      <erpInformation/>
      <endToEndMessageId>d28b6a7dad414014a59029ef1a7e84d4</endToEndMessageId>
      <createDateTime>2015-06-11T10:08:33.258+02:00</createDateTime>
    </activationHeader>
  </soap:Header>
  <soap:Body>
    <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="ED-1B758D26C51BFCD86614340101135852" Type="http://www.w3.org/2001/04/xmlenc#Content">
      <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
      <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey">
          <wsse:Reference URI="#EK-1B758D26C51BFCD86614340101135741"/>
        </wsse:SecurityTokenReference>
      </ds:KeyInfo>
      <xenc:CipherData>
        <xenc:CipherValue>value</xenc:CipherValue>
      </xenc:CipherData>
    </xenc:EncryptedData>
  </soap:Body>
</soap:Envelope>

Казалось бы, нам не хватает некоторых значений шифра и ключевого идентификатора. Мы не уверены, где / как получить эти значения в процессе. Любой вклад будет оценен.

...