santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milan Tomic <tomicmi...@yahoo.com>
Subject Re: Problem XML encryption and Decryption
Date Fri, 28 Apr 2006 08:42:35 GMT

It seems that your document was "changed/modified" a little bit (after decryption). By modified,
I
mean, that it was "pretty printed". This:

<a><b>some text</b></a>

was changed into:

<a>
  <b>some text</b>
</a>

Code "getElementsbyTagName.item(0).getFirstChild().getValue()" returns first node and in your
case
it is (node type is "text") space (32 in ASCII table), tab (9 in ASCII table), new line character
(10 in ASCII table) or carriage return (13 in ASCII table).

Your problem have nothing to do with XML decryption. You need to set preserveWhiteSpace(true)
or
something similar to your XML parser (Xerces, MSXML...) and force it not to do pretty printing.

Hope it helps,
Milan


--- Ramanathan Palaniappan <ramwisc@gmail.com> wrote:

> Hi,
> 
> I have an application which sends an encrypted XML document (only a single
> element is encrypted) to another process over SSL. I am able to encrypt,
> decrypt and recover data as long as I am within the same application but
> when I trasnmit the file over SSL, problems arise.
> 
> The other end decrypts the document and prints it properly.  But when I try
> to recover the decrypted element's value using 
> "getElementsbyTagName.item(0).getFirstChild().getValue()"
> the value returned is an empty string. But indeed, I could see the value
> being printed out at the receiver end if I print the entire docment by
> serializing it.
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> Ram
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message