Hi Aleksey,
After numerous attempts to verify the Microsoft InfoPath-created dsig
which uses an XSLT transform, I decided to dummy it down and both sign and
verify it with XMLSec, to get some clues.
The attached is the only stylesheet transform technique I can get
working with XMLSec. I verified this from the pre-digest transform put out
by --store-references. That is good. This working approach completely embeds
the entire stylesheet, HTML and all, under the Transform element like this
...
<Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="books">
<html><body>
...
My question: Is there any way that XMLSec (libxslt ?) will honour a
stylesheet "reference" whose body resides outside the XML doc being
transformed ?
Simply adding ...
<?xml-stylesheet type="text/xsl" href="books.xsl"?>
... as the 1st line in books.xml doesn't do it. I also tried a href to the
stylesheet in several places both in the template and in the doc without
success.
Is this possible ?
Thanks,
Ed
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="urn:envelope">
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="inout/books.xml">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="books">
<html><body>
<h1>A list of books</h1>
<table width="640">
<xsl:apply-templates/>
</table>
</body></html>
</xsl:template>
<xsl:template match="book">
<tr>
<td><xsl:number/></td>
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="author | title | price">
<td><xsl:value-of select="."/></td>
</xsl:template>
</xsl:stylesheet>
</Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue></DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>
</SignatureValue>
<KeyInfo>
<X509Data>
<X509SubjectName>
</X509SubjectName>
<X509Certificate>
</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
</Envelope>