Problem with digital Signature in a Xml document

M

Marco Moioli

Hi, I have a problem with a X509 digital signature.
I want to sign a Word 2003 document saved in .xml format.
the problem is that after the signature, Word 2003 don't want to open the
document.

If I apply a standard W3C signature to an Xml file wrote in Word 2003 I
obtain:

<?mso-application progid="Word.Document"?>
<w:wordDocument
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:w10="urn:schemas-microsoft-com:blush:ffice:word"
xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core"
xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
xmlns:blush:="urn:schemas-microsoft-com:blush:ffice:blush:ffice"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" w:macrosPresent="no"
w:embeddedObjPresent="no" w:blush:cxPresent="no" xml:space="preserve">
.....
.....
.....
</w:body>
<Signature>
<Signed Info>
(CanonicalizationMethod)
(SignatureMethod)
(<Reference (URI=)>
(Transforms)
(DigestMethod)
(DigestValue)
(</Reference>)
</Signed Info>
(SignatureValue)
(KeyInfo)
</Signature>
</w:wordDocument>

After this process, I can't open again the file because Word 2003 say ("The
file could not be opened because an XML element was found in an invalid
location")
Ideas?

Tanks!
Marco
 
N

Nicholas Paldino [.NET/C# MVP]

Marco,

It's exactly right. When you add the signature, there is no more root
element. Therefore, the XML is invalid.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top