Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

SignXML.LoadXML failes with unknown transformation

$
0
0

I am working with VS 2010 / .NET 4 to implement a simple XMLdSig verification. The signature is created by a webservice provider and out of my control. As far as I could examine, the structure of the signature is valid. Hours of googling gave my the impression that xmlenc#256 may be a problem, but before that I even cannot load the XML document.

Can anyone help and tell me whats going wrong resp. where/how to find a solution?

Here is my code snippet:

DialogResult rc = oFDXML.ShowDialog();if (rc!=DialogResult.OK)

{

return;

}



XmlDocument xdoc = new XmlDocument();

xdoc.PreserveWhitespace = true;

xdoc.Load(oFDXML.FileName);

XmlNamespaceManager ebMgr = new XmlNamespaceManager(xdoc.NameTable);string PrefixURLeb = http://www.ebinterface.at/schema/3p0/;string PrefixURLsig = http://www.w3.org/2000/09/xmldsig#;

ebMgr.AddNamespace("eb", PrefixURLeb);

ebMgr.AddNamespace("dsig", PrefixURLsig);

SignedXml sXdoc = new SignedXml(xdoc);

XmlNodeList nodelist = xdoc.GetElementsByTagName("dsig:Signature");

sXdoc.LoadXml((XmlElement)nodelist.Item(0));

if (sXdoc.CheckSignature())

{

 MessageBox.Show("Signature OK");

}

else

{

MessageBox.Show("Signature not OK");

}



Here is the XML File:

<?xmlversion="1.0"encoding="UTF-8"standalone="no"?><eb:Invoicexmlns:eb="http://www.ebinterface.at/schema/3p0/"eb:DocumentTitle="Beispiel-Rechnung"eb:DocumentType="Invoice"eb:GeneratingSystem="ebInterface 3.0 Word Formular Vorlage Version 2.0.0 RC2 SVN Rev:149"eb:InvoiceCurrency="EUR"eb:Language="ger"xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.ebinterface.at/schema/3p0/ http://www.ebinterface.at/schema/3p0/Invoice.xsd"><dsig:SignatureId="signature-1-1"xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethodAlgorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethodAlgorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><dsig:ReferenceId="reference-1-1" URI=""><dsig:Transforms><dsig:TransformAlgorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></dsig:Transforms><dsig:DigestMethodAlgorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><dsig:DigestValue>RJc1W6Us9foLWNdOAbOud69orIFo+lOq6TpWN/Pqk94=</dsig:DigestValue></dsig:Reference><dsig:ReferenceId="etsi-data-reference-1-1"Type="http://uri.etsi.org/01903/v1.1.1#SignedProperties" URI=""><dsig:Transforms><dsig:TransformAlgorithm="http://www.w3.org/2002/06/xmldsig-filter2"><xpf:XPathFilter="intersect"xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#"xmlns:xpf="http://www.w3.org/2002/06/xmldsig-filter2">//*[@Id='etsi-signed-1-1']/etsi:QualifyingProperties/etsi:SignedProperties</xpf:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethodAlgorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><dsig:DigestValue>JKUoHDJjvrkPxk2Scd81nNzn6tE2ThyKF56Z7oMXIMs=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>SsdpxgvP74sXBW2f3yKJbkTBdsVTwHzc1R3CE7iQoUzmwkzXymCkV3Su/qUZqQh57nEJ4LovN2iCiQ/7ptM3wj4MlQ68soPHZGCjfdVL8X1+3HWXlw//e/1hW3HuIa5nFNaA82qzFqVAp4cMkT6c7YM74g7kmZ/wtVkwP8VonysCXv3w5T8T9ur+nnAbqKYp9114GTbwi0NHMASk+vpEZdK9tDF4ZBNWsckZpKYI9m30atdoGqnifHFEa8deQCapp66rH8ckrjikDGf4R8ogDlchDGzhSTMUxqKJ99P+zyLTvw0VNQZ2OnYs13jlHyLnGP0xquMkgu+kq3JYJ4AQKg==</dsig:SignatureValue><dsig:KeyInfo><dsig:X509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F0L2NlcnRzL2Etc2lnbi1QcmVtaXVtLVRlc3QtU2lnLTAyLmNydDCBnQYDVR0gBIGVMIGSMIGFBgYqKAARAQMwezA9BggrBgEFBQcCARYxaHR0cDovL3d3dy5hLXRydXN0LmF0L2RvY3MvY3AvYS1zaWduLXByZW1pdW0tdGVzdDA6BggrBgEFBQcCAjAuGixEaWVzZXMgWmVydGlmaWthdCBkaWVudCBudXIgenUgVGVzdHp3ZWNrZW4gITAIBgYEAIswAQEwgaQGA1UdHwSBnDCBmTCBlqCBk6CBkIaBjWxkYXA6Ly9sZGFwLXRlc3QuYS10cnVzdC5hdC9vdT1hLXNpZ24tUHJlbWl1bS1UZXN0LVNpZy0wMixvPUEtVHJ1c3QsYz1BVD9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0P2Jhc2U/b2JqZWN0Y2xhc3M9ZWlkQ2VydGlmaWNhdGlvbkF1dGhvcml0eTARBgNVHQ4ECgQIRab5APeSgo4wDgYDVR0PAQH/BAQDAgbAMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQEFBQADggEBAE/ddaBuS612hnSahFxDPebxOWSeghmG88NPUQEbLcbHM4pLkreN+4PaE9epOUbvSABC+TCT9BHdv+1MerlHMy5pnfwGsrS/vg++Lnj4el3LNt6XboDKJCCyKzzJpa/69rdYTVE96DHUFKnyt7CdbeXfWNmZjWoOf40vSizhqVh9keFsE8JPp+tirO7EqqEHHq1uX+0YTFE1M/yhMCSX8mcOSCZGs6wKyMZxRiQx8tHcEVwRELBqqvzF2AI3VKVpKM2UthZmEG5HSRcABefdmiMGbgRdbsApwYMdIzZqrO/mwcEx2PEXt3Mwm6mgEZIcIqsMmRQv/MyPWMb2AN+MF28=</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo><dsig:ObjectId="etsi-signed-1-1"><etsi:QualifyingPropertiesTarget="#signature-1-1"xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#"><etsi:SignedProperties><etsi:SignedSignatureProperties><etsi:SigningTime>2011-01-20T14:04:29Z</etsi:SigningTime><etsi:SigningCertificate><etsi:Cert><etsi:CertDigest><etsi:DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><etsi:DigestValue>wP7ZNWqi88yJSGzB9QL//0S+ajc=</etsi:DigestValue></etsi:CertDigest><etsi:IssuerSerial><dsig:X509IssuerName>CN=a-sign-Premium-Test-Sig-02,OU=a-sign-Premium-Test-Sig-02,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT</dsig:X509IssuerName><dsig:X509SerialNumber>151209</dsig:X509SerialNumber></etsi:IssuerSerial></etsi:Cert></etsi:SigningCertificate><etsi:SignaturePolicyIdentifier><etsi:SignaturePolicyImplied/></etsi:SignaturePolicyIdentifier></etsi:SignedSignatureProperties><etsi:SignedDataObjectProperties><etsi:DataObjectFormatObjectReference="#reference-1-1"><etsi:MimeType>text/xml</etsi:MimeType></etsi:DataObjectFormat></etsi:SignedDataObjectProperties></etsi:SignedProperties></etsi:QualifyingProperties></dsig:Object></dsig:Signature><eb:InvoiceNumber>20110001</eb:InvoiceNumber><eb:InvoiceDate>2011-01-13</eb:InvoiceDate><eb:Delivery><eb:Date>2011-01-13</eb:Date></eb:Delivery><eb:Biller><eb:VATIdentificationNumber>ATU123456</eb:VATIdentificationNumber><eb:Address><eb:Name>Bogad &amp; Partner Consulting OG</eb:Name><eb:Street>Steinbachstrasse 17</eb:Street><eb:Town>Mauerbach</eb:Town><eb:ZIP>3001</eb:ZIP><eb:Country>AT </eb:Country></eb:Address></eb:Biller><eb:InvoiceRecipient><eb:VATIdentificationNumber>00000000</eb:VATIdentificationNumber><eb:BillersInvoiceRecipientID>111111</eb:BillersInvoiceRecipientID><eb:OrderReference><eb:OrderID>444444</eb:OrderID><eb:ReferenceDate>2010-12-01</eb:ReferenceDate></eb:OrderReference><eb:Address><eb:Name>BRZ</eb:Name><eb:Street>Hintere Zollamtsstrasse 4</eb:Street><eb:Town>Wien</eb:Town><eb:ZIP>1030</eb:ZIP><eb:Country>AT </eb:Country></eb:Address></eb:InvoiceRecipient><eb:Details><eb:HeaderDescription>Wir erlauben uns wie folgt zu verrechnen.</eb:HeaderDescription><eb:ItemList><eb:ListLineItem><eb:PositionNumber>1</eb:PositionNumber><eb:Description>Tagsatz</eb:Description><eb:BillersArticleNumber>0000</eb:BillersArticleNumber><eb:Quantityeb:Unit="Tag">5.00</eb:Quantity><eb:UnitPrice>970.00</eb:UnitPrice><eb:TaxRate>20.00</eb:TaxRate><eb:DiscountFlag>false</eb:DiscountFlag><eb:ReductionRate>0.00</eb:ReductionRate><eb:LineItemAmount>4850.00</eb:LineItemAmount></eb:ListLineItem></eb:ItemList><eb:FooterDescription>Wir danken für Ihren Auftrag.</eb:FooterDescription></eb:Details><eb:Tax><eb:VAT><eb:Item><eb:TaxedAmount>4850.00</eb:TaxedAmount><eb:TaxRate>20.00</eb:TaxRate><eb:Amount>970.00</eb:Amount></eb:Item></eb:VAT></eb:Tax><eb:TotalGrossAmount>5820.00</eb:TotalGrossAmount><eb:PaymentMethodeb:ConsolidatorPayable="false"xsi:type="eb:UniversalBankTransactionType"><eb:BeneficiaryAccount><eb:BankName>Volksbank Wien</eb:BankName><eb:BankCodeeb:BankCodeType="AT">43000</eb:BankCode><eb:BankAccountNr>1234567890</eb:BankAccountNr><eb:IBAN>1234567890</eb:IBAN><eb:BankAccountOwner>Bogad &amp; Partner Consulting OG</eb:BankAccountOwner></eb:BeneficiaryAccount></eb:PaymentMethod><eb:PaymentConditions><eb:DueDate>2011-01-13</eb:DueDate></eb:PaymentConditions><eb:PresentationDetails><eb:URL>www.austriapro.at</eb:URL><eb:SuppressZero>true</eb:SuppressZero></eb:PresentationDetails></eb:Invoice>

 


Spezialist für Verschlüsselung, Digitale Signatur, Smart Card, elektronische Rechnung, Liquiditätssteuerung,VSTO Entwicklung, http://www.bogad.at

Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>