[xmlsec] Encrypt only sections/Dont write plain to HD.

Aleksey Sanin aleksey at aleksey.com
Wed Dec 20 08:28:09 PST 2006

> 1. The writer example of Libxml2 (testWriter.c) shows how to write XML 
> tags directly to a file or into the RAM. Is it possible to use XMLSec to 
> encrypt the XML file in the RAM? Because the plain text should never be 
> written to harddisk. Is an example available?

Sure :) In these examples, one of the very first step is to load XML
from disk into memory :)

> 2. How can I encrypt only some parts of an XML file? Is there a way to 
> use the LibXml2 write commands through the XmlSec Api? (There is a 
> LibXml2 function xmlTextWriterStartElement, than XmlSec could provide a 
> function xmlTextWriterStartElementSec that saves the next element only 
> encrypted to HD and all necessary encryption elemens like 
> EncryptionMethod, KeyInfo, ... with them.)

Well, you will need to encrypt each peace separately. See spec
for details:



More information about the xmlsec mailing list