Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf 传出的Soap请求未签名_Wcf - Fatal编程技术网

Wcf 传出的Soap请求未签名

Wcf 传出的Soap请求未签名,wcf,Wcf,我的外出soap没有签名。 下面是即将发布的soap的外观 <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/20

我的外出soap没有签名。 下面是即将发布的soap的外观

        <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-c0cc2cd4-cb77-4fa5-abfa-bd485afd1685" 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>gpBAWt91pdwhKva............</xenc:CipherValue>
        </xenc:CipherData>
        <xenc:ReferenceList>
        <xenc:DataReference URI="#Enc-0641b860-b16d-4941-91c0-d60bece67794"/>
        </xenc:ReferenceList>
        </xenc:EncryptedKey>
        <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
        <SignedInfo>
     <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
        <Reference URI="#Id-f10674fd-b999-47c9-9568-c11fa5e5405b">
        <Transforms>
        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
        </Transforms>
        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
        <DigestValue>wRUq.........</DigestValue>
        </Reference>
        </SignedInfo>
        <SignatureValue>tBSsaZi........</SignatureValue>
        <KeyInfo>
        <wsse:SecurityTokenReference>
        <wsse:Reference URI="#SecurityToken-e00c8062-83d2-4f04-88fc-996218e7bb3d" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
        </wsse:SecurityTokenReference>
        </KeyInfo>
        </Signature>
        </wsse:Security>
        </soapenv:Header>
        <soapenv:Body wsu:Id="Id-f10674fd-b999-47c9-9568-c11fa5e5405b" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <xenc:EncryptedData Id="Enc-0641b860-b16d-4941-91c0-d60bece67794" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
        <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
        <xenc:CipherData>
        <xenc:CipherValue>SQsTCAK6ZaVhojB8+Y.........</xenc:CipherValue>
        </xenc:CipherData>
        </xenc:EncryptedData>
        </soapenv:Body>
        </soapenv:Envelope>

This request uses the public key to encrypt 
1) Signature reference URI <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
        <SignedInfo>
     <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
        <Reference URI="#Id-f10674fd-b999-47c9-9568-c11fa5e5405b">
This Reference URI is referenced in the Body wsu:Id="Id-f10674fd-b999-47c9-9568-c11fa5e5405b

2)   <xenc:CipherData>
        <xenc:CipherValue>gpBAWt91pdwhKva............</xenc:CipherValue>
        </xenc:CipherData>
        <xenc:ReferenceList>
        <xenc:DataReference URI="#Enc-0641b860-b16d-4941-91c0-d60bece67794"/>
        </xenc:ReferenceList>
This Enc is also referenced in the Body <xenc:EncryptedData Id="Enc-0641b860-b16d-4941-91c0-d60bece67794" 
这是生成的soap。显然,我没有看到签名节点。此外,主体中引用的Id没有引用

  <e:EncryptedKey Id="_0" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
        <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
        <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
          <o:SecurityTokenReference>
            <o:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" URI="#uuid-711565ff-cd32-4e10-af6d-f84d34b6cb5f-1" />
          </o:SecurityTokenReference>
        </KeyInfo>
        <e:CipherData>
          <e:CipherValue>V+tlheG3BuP8JVPXmz98T0O9dnT5z57U0TqTuPQmb82WiKKDFFDKsGQv/5+lyD5ISRUEr0zlEPRUFCS5ggtSnDWCtOvTcrPMwLNRuz6g7qS/Yx3VFu+h2rfvy2a/LinC7lhmDW0TO6xVoxQCZdLx/rZMh9K5si8JPCelXloZmaA=</e:CipherValue>
        </e:CipherData>
        <e:ReferenceList>
          <e:DataReference URI="#_2" />
          <e:DataReference URI="#_7" />
        </e:ReferenceList>
      </e:EncryptedKey>
      <e:EncryptedData Id="_7" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
        <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
        <e:CipherData>
          <e:CipherValue>4=</e:CipherValue>
        </e:CipherData>
      </e:EncryptedData>
    </o:Security>
  </s:Header>
  <s:Body u:Id="_1" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <e:EncryptedData Id="_2" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
      <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
      <e:CipherData>
        <e:CipherValue>Removed</e:CipherValue>
      </e:CipherData>
    </e:EncryptedData>
  </s:Body>
</s:Envelope>

V+TLHEG3BUP8JVPxMz98T0O9DNT5Z57U0TqtupQMB82WIKKDFDKSGQV/5+LYD5ISRURE0ZLEPRUFCS5GTSNDWCTOVTCRpmwlnruz6G7QS/Yx3VFu+h2rfvy2a/LINC7LHMDW0to6VOXQCZDLX/rZMh9K5si8JPCelXloZmaA=
4=
远离的

请建议谢谢

邮件已签名,但签名已加密,因此您在此处看不到签名

设置:

当然,客户机和服务器都需要在这个值上保持一致

  <e:EncryptedKey Id="_0" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
        <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
        <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
          <o:SecurityTokenReference>
            <o:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" URI="#uuid-711565ff-cd32-4e10-af6d-f84d34b6cb5f-1" />
          </o:SecurityTokenReference>
        </KeyInfo>
        <e:CipherData>
          <e:CipherValue>V+tlheG3BuP8JVPXmz98T0O9dnT5z57U0TqTuPQmb82WiKKDFFDKsGQv/5+lyD5ISRUEr0zlEPRUFCS5ggtSnDWCtOvTcrPMwLNRuz6g7qS/Yx3VFu+h2rfvy2a/LinC7lhmDW0TO6xVoxQCZdLx/rZMh9K5si8JPCelXloZmaA=</e:CipherValue>
        </e:CipherData>
        <e:ReferenceList>
          <e:DataReference URI="#_2" />
          <e:DataReference URI="#_7" />
        </e:ReferenceList>
      </e:EncryptedKey>
      <e:EncryptedData Id="_7" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
        <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
        <e:CipherData>
          <e:CipherValue>4=</e:CipherValue>
        </e:CipherData>
      </e:EncryptedData>
    </o:Security>
  </s:Header>
  <s:Body u:Id="_1" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <e:EncryptedData Id="_2" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
      <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
      <e:CipherData>
        <e:CipherValue>Removed</e:CipherValue>
      </e:CipherData>
    </e:EncryptedData>
  </s:Body>
</s:Envelope>
secBE.MessageProtectionOrder = MessageProtectionOrder.EncryptBeforeSign