Hi,

 

I need help solving this one.

 

I'm using the C++ libraries for XML Security and when I call 
XENCCipher::decryptElement(...) I am getting this error thrown from 
..\..\..\..\..\src\xercesc/util/XMLUTF8Transcoder.hpp: - (yes that's coming 
form xerces 2.6)

 

"invalid byte 2 (Í) of a 2-byte sequence."

 

It is reported as a UTF8_FormatError.

 

Just to cut to the chase, are there known issues with this functionality, 
because I have found numerous reports that this was broken in the Java 
implementation for XML Security  version 1.4?

 

I am using version 1.2.1, though, so the issue may be something else.

 

As far as I can see, all of the code leading up to this point is working as 
expected, using the same values for Salts and Keys and so on as were used for 
encryption.

 

The problem seems to be in the XML Security\Xerces code somewhere.

 

I've added encoding to the DOMWriter when I am writing the xml to file so that 
the encoding should be UTF-8 but the error is still being thrown when I read it 
in and try to decrypt it.

 

XMLCh * encoding =  XMLString::transcode("UTF-8");

 

             m_xmlWriter->setEncoding(encoding);

 

             m_xmlWriter->writeNode(formatTarget, *m_xmlDoc);

 

I don't think the problem is with the encrypted text as it has no illegal 
characters and the language used is English - not polish or old French.

 

Can anyone throw any light on this for me?

 

 

 

Thanks

 

PeterE

Reply via email to