使用自定义绑定签名标头肥皂请求

时间:2018-04-10 09:36:45

标签: c# soap

我正在使用Java编写的WebServices。我发送了一个XML,我需要在我的计算机上安装了一个certficate的标题头。

我正在尝试配置自定义绑定以对标头进行签名,但我不知道这样做会很热。

标题的示例可能类似于this

我创建了这个XML

<Solicitud_Registro_Entrada version="3.0"><Datos_Firmados><Datos_Genericos> <Remitente> <Nombre>ALD AUTOMOTIVE, S.A.</Nombre> <Apellidos></Apellidos> <Documento_Identificacion> <Numero>A80292667</Numero> </Documento_Identificacion> <Correo_Electronico /> </Remitente> <Interesados> <Interesado>  <Nombre>Huntsman Advanced Materials Spain S.L.</Nombre> <Apellidos /> <Documento_Identificacion> <Numero>B62096177</Numero> </Documento_Identificacion> <Correo_Electronico /> </Interesado> </Interesados> <Asunto> <Codigo>SAA</Codigo> <Descripcion>Solicitud de Anotacion de Arrendatario</Descripcion> </Asunto> <Destino> <Codigo>101001</Codigo> <Descripcion>DGT - Vehículos</Descripcion> </Destino> </Datos_Genericos> <Datos_Especificos> <MATRICULA>6953JRL</MATRICULA> <BASTIDOR>258022</BASTIDOR> </Datos_Especificos> </Datos_Firmados> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo Id="Signature-SignedInfo-201804100805390"><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><ds:Reference Id="Reference-ID--201804100805481" URI="" Type="http://uri.etsi.org/01903#SignedProperties"><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><ds:DigestValue>IKv29cMFm1fDD1yKjOriTmOZoQM=</ds:DigestValue></ds:Reference><ds:Reference URI=""><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><ds:DigestValue>IKv29cMFm1fDD1yKjOriTmOZoQM=</ds:DigestValue></ds:Reference><ds:Reference Id="Reference-ID--201804100805481" URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><ds:DigestValue>IKv29cMFm1fDD1yKjOriTmOZoQM=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Ln0CnFJXi7azy+qZ/SoOCu7z5qMxvpjByABS/jW9sn/YgnxzgtdgnmZQUlbwtJavTkN+jMuoxkbbjo1Okq8/T0wyixZWuVuSrHiOuAbpVva2HSHY4Y/ZjGhq01NkAJ6jO+2KnIWDCz2MMn5w8106kNa529vZkhHJDWSnvIMTXZBG1i9QEMQaT/v8jvUbQ4fo/9aP/c76kcAJMbyqAnDg6CCbM6FlCzr/yiHE8TmpTgUG1TznqQJdsn6GtH59VDcxIBmDZaiHQGLmUBe7QHsoRODoHz1Y5B9huS2foBw7nl6jCBHHKfLisPale8dpqoXOnQ/6q/bdPH/dtnpmrANlNw==</ds:SignatureValue><ds:KeyInfo Id="Certificate-201804100805481"><ds:X509Data><ds:X509Certificate>MIIIcDCCB1igAwIBAgIQY5VR5+a0m7JY63Ir1ZZPPDANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQGEwJFUzERMA8GA1UECgwIRk5NVC1SQ00xDjAMBgNVBAsMBUNFUkVTMRswGQYDVQQDDBJBQyBSZXByZXNlbnRhY2nDs24wHhcNMTcwNDEwMTE1MzE1WhcNMTkwNDEwMTE1MzE1WjCCAQIxODA2BgNVBA0ML1JlZjpBRUFUL0FFQVQwMDMwL1BVRVNUTyAxLzQ0NzE0LzEwMDQyMDE3MTM0OTI5MRgwFgYDVQQFEw9JRENFUy0wNzIyMDAwM0cxGTAXBgNVBCoMEE1BUklBIERFTCBDQVJNRU4xFDASBgNVBAQMC0xPUEVaIFNBTEFTMTgwNgYDVQQDDC8wNzIyMDAwM0cgTUFSSUEgREVMIENBUk1FTiBMT1BFWiAoUjogQTgwMjkyNjY3KTEYMBYGA1UEYQw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uTQb0P1cV9QRl0FMDFY8T8g+4uI+TvCjrdSKuED+0OrdyaFWvHdwNK4kPynKRK8aaiRd+yZiKECIHFeuV/xXH59w+GRu3jLPmNd+mVLYiRFeXPGMuq56CSKZpsDPbGVx/Q4lqf6/O2LfIwyKRuDn4RJt9e8hAR/c2x4hIRUGxx1RYd2h74JJYLj9jmjqR/hUwPgwnSfM22Pu7fZB9nwY/XBhMZpgNKEqDCVNmIr231yolLstyJPeAY7Ekwo2SPFoSs6b6P5d1LPaQZ34f8RxzGSiGP8FHaA==</ds:X509Certificate></ds:X509Data><ds:KeyValue><ds:RSAKeyValue><ds:Modulus>pqYQ6UUpqB2doP6PCdeh7oZsXGCPdG1uQ6SV0f8D2m/LLBvKwkvqFwa1WqG10OgQBTbX3Dp1tpd065Ju7LakJPfaMIY5qQAQoLykWR5AFYwyJ0VIVSgpvd6htac+5WueqLZzWz+25lRCBNZsQKA6ytS0WiDk0iY7ZI2cFNOwhJs=</ds:Modulus><ds:Exponent>AQAB</ds:Exponent></ds:RSAKeyValue></ds:KeyValue></ds:KeyInfo><ds:Object><etsi:QualifyingProperties xmlns:etsi="http://uri.etsi.org/01903/v1.3.2#"><etsi:SignedProperties><etsi:SignedSignatureProperties><etsi:SigningTime>2018-04-10T12:08:05.481Z</etsi:SigningTime><etsi:SigningCertificate><etsi:Cert><etsi:CertDigest><etsi:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><etsi:DigestValue>C7gvOSNU2Ql1T2flHv36K9zcnks=</etsi:DigestValue></etsi:CertDigest><etsi:IssuerSerial><X509IssuerName>CN=AC Representación, OU=CERES, O=FNMT-RCM, C=ES</X509IssuerName><X509SerialNumber>639551E7E6B49BB258EB722BD5964F3C</X509SerialNumber></etsi:IssuerSerial></etsi:Cert></etsi:SigningCertificate></etsi:SignedSignatureProperties><etsi:SignedDataObjectProperties><etsi:DataObjectFormat ObjectReference="#Reference-ID-893712"><etsi:Description>Proteccion global</etsi:Description><etsi:MimeType>text/xml</etsi:MimeType></etsi:DataObjectFormat></etsi:SignedDataObjectProperties></etsi:SignedProperties></etsi:QualifyingProperties></ds:Object></ds:Signature></Solicitud_Registro_Entrada>

然后,当我调用WS的方法时,文件reference.cs会转换此XML并发送此XML。

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">altaArrendamiento</a:Action><a:MessageID>urn:uuid:5cc18906-27a5-40a0-9830-009743279fbe</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://pr-apls-prep.dgt.es:8080/WS_CAYC/ServiciosArrendamiento?wsdl</a:To></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><altaArrendamiento xmlns="http://www.trafico.es/servicios/vehiculos/comunicaciones/webservices"><datosArrendamiento xmlns=""><doi>B62096177</doi></datosArrendamiento><datosPersona xmlns=""><doi>B62096177</doi><nombre/><primerApellido>Huntsman Advanced Ma</primerApellido><segundoApellido>terials Spain S.L.</segundoApellido><razonSocial/><sexo/></datosPersona><datosDomicilio xmlns=""><tipoVia>  </tipoVia><via>Av Arostegui, S/n</via><numero>    </numero><cp>31009</cp><provincia>Navarra</provincia><municipio>Pamplona/Iruña</municipio></datosDomicilio><datosVehiculo xmlns=""><matricula>6953JRL</matricula><bastidor>258022</bastidor></datosVehiculo><solicitud xmlns=""><![CDATA[<Solicitud_Registro_Entrada version="3.0"><Datos_Firmados><Datos_Genericos> <Remitente> <Nombre>ALD AUTOMOTIVE, S.A.</Nombre> <Apellidos></Apellidos> <Documento_Identificacion> <Numero>A80292667</Numero> </Documento_Identificacion> <Correo_Electronico /> </Remitente> <Interesados> <Interesado>  <Nombre>Huntsman Advanced Materials Spain S.L.</Nombre> <Apellidos /> <Documento_Identificacion> <Numero>B62096177</Numero> </Documento_Identificacion> <Correo_Electronico /> </Interesado> </Interesados> <Asunto> <Codigo>SAA</Codigo> <Descripcion>Solicitud de Anotacion de Arrendatario</Descripcion> </Asunto> <Destino> <Codigo>101001</Codigo> <Descripcion>DGT - Vehículos</Descripcion> </Destino> </Datos_Genericos> <Datos_Especificos> <MATRICULA>6953JRL</MATRICULA> <BASTIDOR>258022</BASTIDOR> </Datos_Especificos> </Datos_Firmados> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo Id="Signature-SignedInfo-201804100948426"><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><ds:Reference Id="Reference-ID--201804100948472" URI="" Type="http://uri.etsi.org/01903#SignedProperties"><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><ds:DigestValue>IKv29cMFm1fDD1yKjOriTmOZoQM=</ds:DigestValue></ds:Reference><ds:Reference URI=""><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><ds:DigestValue>IKv29cMFm1fDD1yKjOriTmOZoQM=</ds:DigestValue></ds:Reference><ds:Reference Id="Reference-ID--201804100948472" URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><ds:DigestValue>IKv29cMFm1fDD1yKjOriTmOZoQM=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>sPk2BWwE3H4RqJPUxDjgoNgwxjx2ptDS/iAPJOXYz/ODFU5Hr+uuKR1lkInfuYDJvunvHftfhH6++w4jaX1hR39UXUxKWFyzTM1oxDBl+eLSPq+NPZUtz9XJQ/S3jWLhzfUSR+4VQNfALdDEes/JH+J5MbnSbA5Usozbt75JWpfd6iArvDmdjtqaCC6Lu5xSgfg3rQf7u/m7QErVchy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pc/eZMG7vZPc5armxQ+unCP+Sz9IBJFrnZ2Thxe75XW5klE8IXmZTj1YDvkATAtSZ4DvVjWC6sbhpF0ZN31nFtPhc3ztS75zsvMmuSEMxR3uZTtrm2sM=</ds:Modulus><ds:Exponent>AQAB</ds:Exponent></ds:RSAKeyValue></ds:KeyValue></ds:KeyInfo><ds:Object><etsi:QualifyingProperties xmlns:etsi="http://uri.etsi.org/01903/v1.3.2#"><etsi:SignedProperties><etsi:SignedSignatureProperties><etsi:SigningTime>2018-04-10T12:09:48.472Z</etsi:SigningTime><etsi:SigningCertificate><etsi:Cert><etsi:CertDigest><etsi:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><etsi:DigestValue>C7gvOSNU2Ql1T2flHv36K9zcnks=</etsi:DigestValue></etsi:CertDigest><etsi:IssuerSerial><X509IssuerName>CN=AC Representación, OU=CERES, O=FNMT-RCM, C=ES</X509IssuerName><X509SerialNumber>639551E7E6B49BB258EB722BD5964F3C</X509SerialNumber></etsi:IssuerSerial></etsi:Cert></etsi:SigningCertificate></etsi:SignedSignatureProperties><etsi:SignedDataObjectProperties><etsi:DataObjectFormat ObjectReference="#Reference-ID-893712"><etsi:Description>Proteccion global</etsi:Description><etsi:MimeType>text/xml</etsi:MimeType></etsi:DataObjectFormat></etsi:SignedDataObjectProperties></etsi:SignedProperties></etsi:QualifyingProperties></ds:Object></ds:Signature></Solicitud_Registro_Entrada>]]></solicitud></altaArrendamiento></s:Body></s:Envelope>

当我调用方法时,我需要添加符号标题。

为了配合我有这个代码的绑定

WSHttpBinding bindingDGT = new WSHttpBinding();
bindingDGT.Security.Mode = SecurityMode.Transport;
bindingDGT.Security.Transport.ClientCredentialType = HttpClientCredentialType.Digest;

EndpointAddress endpointDGT = new EndpointAddress("http://pr-apls-prep.dgt.es:8080/WS_CAYC/ServiciosArrendamiento?wsdl");

ArrendamientoServicioWebClient ser = new ArrendamientoServicioWebClient(bindingDGT, endpointDGT);

                    ser.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.CurrentUser, StoreName.My, X509FindType.FindBySubjectName, "07232423G Certificate (R: A846534667)");
                    ser.ClientCredentials.HttpDigest.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Identification;

你能帮我吗?

0 个答案:

没有答案