Digitally Sign Parts of a XML document

后端 未结 6 1582
无人及你
无人及你 2021-01-03 14:39

I have an XML document having structure similar to the following


    
blaa
blaa blaa
6条回答
  •  醉酒成梦
    2021-01-03 15:14

    You should be able to add an XPath-Transform to the Signature. It should look something like this:

           
             
             ...
             
           
    

    I am not fluent in XPath, but it should be easy to formulate an XPath-expression that excludes the Footer-element. (But note that XPath is an optional part of XML-DSIG, so not all implementations may support it).

    Alternatively, if you could restructure your document to be

    
      
    blaa
    blaa blaa

    or

    
      
        
    blaa
    blaa blaa

    you could handle it by using an Enveloped Signature Transform (first case) or by signing the signedEnvelope element (second case).

提交回复
热议问题