EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Including external signed document into XML and sign

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#24797
Posted: 05/02/2013 20:05:25
by Leonardo Herrera (Standard support level)
Joined: 02/14/2011
Posts: 66

Hello,

I have a document that I need to sign. My problem is that I need to include another document that is also signed (I have stored it as a valid text file) as a sub element in my document.

What is the most sensible approach? I need to

1) Generate the document (I'm using TElXMLDOMDocument for this)
2) Normalize, etc.
3) Include an external XML document as a child node - however, I need to lose some attributes from the document element (which, of course, is not the node being signed anyways)
4) Sign the whole doc

I have no problems creating and signing documents, but for some reason when including the external doc something is being lost.

Any hints on how is the best way to include this document?
#24798
Posted: 05/03/2013 00:15:29
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Could you please post here both input and output files with more detailed explanation of what kind of result do you want to achieve.
#24879
Posted: 05/07/2013 15:17:33
by Leonardo Herrera (Standard support level)
Joined: 02/14/2011
Posts: 66

I'll provide the code I'm using, but I'm more interested in knowing what would be the right approach to import an external XML file as a child node in a TElXMLDOMDocument. Right now I'm just not sure the signed information remains valid when importing it.
#24880
Posted: 05/07/2013 15:41:00
by Dmytro Bogatskyy (EldoS Corp.)

To copy content from one XML document to another you may use CloneNode method, see: http://www.eldos.com/documentation/sb...enode.html
For example:
Code
DestElement.AppendChild(SourceDocument.DocumentElement.CloneNode(true, DestDocument));


If a source document is already signed, by copying it under a child element in another document you may invalidate it signature. If it signature uses exclusive canonicalization or destination element and its parents without namespace declaration then everything should be ok.
#24894
Posted: 05/08/2013 10:19:25
by Leonardo Herrera (Standard support level)
Joined: 02/14/2011
Posts: 66

Quote
Dmytro Bogatskyy wrote:
If a source document is already signed, by copying it under a child element in another document you may invalidate it signature. If it signature uses exclusive canonicalization or destination element and its parents without namespace declaration then everything should be ok.


This is interesting. These documents do have namespaces declared but they aren't explicit (there are no prefixes, I mean.) Exclusive canonicalization? I may need to look into that.

Thank you for your prompt response.
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.

Reply

Statistics

Topic viewed 854 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!