so I generate the file META-INF/documentsignatures.xml in the document archive.
I' ve got two problems with this signature. (Open office says "invalid signature" when opening the signed document.)
1) the document contains entries (declared in the manifest file) with white space like "Object 1/content.xml". These entries have to be signed and so you find references in my xml element signedinfo:
Code: Select all
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="S0">
<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="Object%201/content.xml">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>chCYpSsrB6IHSUg/roWEfZpCyqI=</DigestValue>
</Reference>
....
</SignedInfo>
Illegal character in path at index 25: ObjectReplacements/Object 1
Writer seems to not support this kind of reference. it use white space for the reference.
is it normal ?
2) we could give additional information to the signature with SignatureProperties like the date and time.
if I use xmlns="http://purl.org/dc/elements/1.1/" dublin core namespace. java API can sign the document but core validation failed on this element with id signdatetime.
Writer does not validate the document too.
Code: Select all
<Object>
<SignatureProperties>
<SignatureProperty Id="signdatetime" Target="#S0">
<date xmlns="http://purl.org/dc/elements/1.1/">2008-02-25T10:08:04</date>
</SignatureProperty>
</SignatureProperties>
</Object>
Have you got any ideas on this problem of namespace ?
as an illustration I give a signed document with my java code.
there is no references to entries with white space and there is no namespace for the date.
Only this example seems to work between java api and open office signature.