santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mathew_pl <>
Subject Re: Apache XML Security Encoding problem in encrypting/decrypting XML
Date Mon, 05 Feb 2007 11:30:39 GMT

Ok, that's all. I finally solved that problem so a few words below...

Generally there are two ways to fix this issue:

1) Just use xmlsec-1.3.0.jar instead of xmlsec-1.4.0.jar. It seems to me
that everything works fine with v.1.3.0 and no further changes are required.

2) If someone has to use xmlsec-1.4.0.jar, you have to download sources
(here:, and open and in package

You have to change lines:

=> <=

line 696: if( (c & 0x80) ==0) {    into    if(c < 0x80) {
line 731: if( (c & 0x80) ==0) {    into    if(c < 0x80) {
line 783: if( (c & 0x80) ==0) {    into    if(c < 0x80) {

=> <=

line 21: if ( (c & 0x80) ==0) {    into    if(c < 0x80) {
line 56: if ((c & 0x80) == 0) {    into    if(c < 0x80) {
line 96:  if ((c & 0x80) == 0) {   into    if(c < 0x80) {

Be aware of some extra spaces between "(" so don't use Find function in your
editor, and change every line manually.

After making changes in those two files you compile them by:


Now you should get xmlsec-1.4.0.jar end extract it using following command
from your command line:

jar -xvf xmlsec-1.4.0.jar

You should recieve three folders: org, jawax and META-INF. 
Get two compiled files (CanonicalizerBase.class UtfHelpper.class) and put
them in org/apache/xml/security/c14n/implementations.

Finally, let's build fixed xmlsec-1.4.0.jar library by putting in a cmd:

jar -cvf xmlsec-1.4.0-utf_bug_fixed.jar META-INF\MANIFEST.MF *.class org/

That's all folks. Everything you have to do is to remove xmlsec-1.4.0.jar
and replace it with xmlsec-1.4.0-utf_bug_fixed.jar (Remember about new
filename of your .jar )

Thanks guys for your help!


View this message in context:
Sent from the Apache XML - Security - Dev mailing list archive at

View raw message