Unanswered Xmldsig validation question

  • Wednesday, November 09, 2011 7:35 AM
     
      Has Code

    I have a xml signature that needs to be validated. It has the following SignatureInfo:

    <SignedInfo>
            <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
            <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
            <Reference URI="#id25a415d3-0a11-11e1-8266-00016c9cc847" Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties">
              <Transforms>
                <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
              </Transforms>
              <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
              <DigestValue>zaDeegM89/0QicIjiiBKKjCs3oA=</DigestValue>
            </Reference>
            <Reference URI="">
              <Transforms>
                <Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2">
                  <XPath Filter="intersect" xmlns="http://www.w3.org/2002/06/xmldsig-filter2" xmlns:a="http://e-porezna.porezna-uprava.hr/sheme/zahtjevi/ObrazacTZ/v1-1" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">here()/ancestor::dsig:Signature[1]/../../a:ObrazacTZ[1]//. | here()/ancestor::dsig:Signature[1]/../../a:ObrazacTZ[1]//@* | here()/ancestor::dsig:Signature[1]/../../a:ObrazacTZ[1]//namespace::*</XPath>
                </Transform>
                <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
              </Transforms>
              <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
              <DigestValue>oSUPjbPFV8PyhQN/Sp3k2LHgd8o=</DigestValue>
            </Reference>
     </SignedInfo><br/><br/><br/>
    


    Can this be validated in .NET 2.0 (or higher)?

    It seems that "xml-exc-c14n#WithComments" and "http://www.w3.org/2002/06/xmldsig-filter2" transforms are not supported.

    If they are, how can I do the validation? 

    If not, are there any external tools, classes etc. ?

    Any help appreciated.

     

All Replies

  • Wednesday, November 30, 2011 7:55 AM
    Moderator
     
     

    Are you going to validate the XML file against a schema?

    Which schema technology are you using?

     

    Thanks,
    Ming.
    XML Team, Microsoft.

     


    Pak-Ming Cheung - MSFT
  • Wednesday, January 18, 2012 2:57 PM
     
     

    Validating against schema is not problematic.

    I have it, and I made it work.

    But verifying signature is another problem.

    xml-exc-c14n#WithComments" and "http://www.w3.org/2002/06/xmldsig-filter2" are not supported in .NET

    Of course, I have some Java wrapping possibility.

    Have you got any another suggestion?