summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx40
-rw-r--r--xmlsecurity/source/helper/xsecctl.hxx3
2 files changed, 43 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index 79581a103856..afe28cd7644e 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -1177,6 +1177,46 @@ void XSecController::exportOOXMLSignature(const uno::Reference<embed::XStorage>&
}
}
xDocumentHandler->endElement(TAG_MANIFEST);
+
+ // SignatureProperties
+ xDocumentHandler->startElement(TAG_SIGNATUREPROPERTIES, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ {
+ rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
+ pAttributeList->AddAttribute(ATTR_ID, "idSignatureTime");
+ pAttributeList->AddAttribute(ATTR_TARGET, "#idPackageSignature");
+ xDocumentHandler->startElement(TAG_SIGNATUREPROPERTY, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ }
+ {
+ rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
+ pAttributeList->AddAttribute(ATTR_XMLNS ":" NSTAG_MDSSI, NS_MDSSI);
+ xDocumentHandler->startElement(NSTAG_MDSSI ":" TAG_SIGNATURETIME, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ }
+ xDocumentHandler->startElement(NSTAG_MDSSI ":" TAG_FORMAT, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters("YYYY-MM-DDThh:mm:ssTZD");
+ xDocumentHandler->endElement(NSTAG_MDSSI ":" TAG_FORMAT);
+
+ xDocumentHandler->startElement(NSTAG_MDSSI ":" TAG_VALUE, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ OUString aSignatureTimeValue;
+ if (!rInformation.ouDateTime.isEmpty())
+ aSignatureTimeValue = rInformation.ouDateTime;
+ else
+ {
+ aSignatureTimeValue = utl::toISO8601(rInformation.stDateTime);
+ // Ignore sub-seconds.
+ sal_Int32 nCommaPos = aSignatureTimeValue.indexOf(',');
+ if (nCommaPos != -1)
+ {
+ aSignatureTimeValue = aSignatureTimeValue.copy(0, nCommaPos);
+ aSignatureTimeValue += "Z";
+ }
+ }
+ xDocumentHandler->characters(aSignatureTimeValue);
+ xDocumentHandler->endElement(NSTAG_MDSSI ":" TAG_VALUE);
+
+ xDocumentHandler->endElement(NSTAG_MDSSI ":" TAG_SIGNATURETIME);
+ xDocumentHandler->endElement(TAG_SIGNATUREPROPERTY);
+ xDocumentHandler->endElement(TAG_SIGNATUREPROPERTIES);
+
xDocumentHandler->endElement(TAG_OBJECT);
{
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index d2af2459fb5f..7146d886047e 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -85,6 +85,9 @@
#define TAG_QUALIFYINGPROPERTIES "QualifyingProperties"
#define TAG_SIGNEDPROPERTIES "SignedProperties"
#define TAG_RELATIONSHIPREFERENCE "RelationshipReference"
+#define TAG_SIGNATURETIME "SignatureTime"
+#define TAG_FORMAT "Format"
+#define TAG_VALUE "Value"
#define ATTR_XMLNS "xmlns"
#define ATTR_ALGORITHM "Algorithm"