summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/pdfio/pdfdocument.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-04 09:13:02 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-04 09:13:32 +0100
commit3e610f8496a0b6ef126426b807e0af366a98b8f3 (patch)
tree52728e32275a50b2d9f61f9febb99fda49f4b9a9 /xmlsecurity/source/pdfio/pdfdocument.cxx
parentf0167eced77657190226d24a19005a66ff7e739e (diff)
vcl: extract PDFWriter::GetDateTime() from PDFWriterImpl
And use it in xmlsecurity when signing an existing PDF. This is especially important on Windows, where the PKCS#7 blob doesn't have an (unsigned) timestamp. Change-Id: I4051dc19a43f8f8114d9f4d02309f28d6754e9ae
Diffstat (limited to 'xmlsecurity/source/pdfio/pdfdocument.cxx')
-rw-r--r--xmlsecurity/source/pdfio/pdfdocument.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx
index 31ac58576469..6822e149c47b 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -356,6 +356,12 @@ bool PDFDocument::Sign(const uno::Reference<security::XCertificate>& xCertificat
comphelper::string::padToLength(aContentFiller, MAX_SIGNATURE_CONTENT_LENGTH, '0');
aSigBuffer.append(aContentFiller.makeStringAndClear());
aSigBuffer.append(">\n/Type/Sig/SubFilter/adbe.pkcs7.detached");
+
+ // Time of signing.
+ aSigBuffer.append(" /M (");
+ aSigBuffer.append(vcl::PDFWriter::GetDateTime());
+ aSigBuffer.append(")");
+
// Byte range: we can write offset1-length1 and offset2 right now, will
// write length2 later.
aSigBuffer.append(" /ByteRange [ 0 ");