santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ralph-xmlsecur...@ralphholz.de
Subject Re: Signature breaks during I/O and parsing, but cannot resolve with canonicalisation
Date Wed, 05 Dec 2007 21:53:49 GMT
Hi,

> > Looking at my document with kdiff3, I can see that only one line is
> > different:
>
> And there are no whitespace differences?

The only difference that I can see are the missing namespaces.

> > <write out>
> > File file = new File(filename);
> > FileOutputStream f = new FileOutputStream(file);
> > TransformerFactory factory = TransformerFactory.newInstance();
> > Transformer transformer = factory.newTransformer();
> > transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
> > "yes");
> > transformer.setOutputProperty("indent", "yes");
>
> Ummm....I'd say that's your problem right there. You can't pretty print
> signed XML, not unless you print it first, parse it back in, then sign it.

No, the problem also occurs if I drop that line (and every other output 
property). Or do you mean the whole transformer approach will not work?

In any case, if I use a parser to read the file back in and apply a C14N 
transform, the signature should be valid again?

Ralph

-- 
For contact details, please see www.ralphholz.de.

Mime
View raw message