summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/helper/documentsignaturemanager.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-10-20 13:44:03 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-10-20 13:44:26 +0200
commite2b6ab0bb25deb9feb4f01c26bacf1c482329c62 (patch)
tree38433ba2ae83f7703a5b226dedccfb060d36b07d /xmlsecurity/source/helper/documentsignaturemanager.cxx
parent77e89962a2518962284c76da4d3339a9cd7b4ccb (diff)
xmlsecurity: add initial PDF sign UI
An unsigned PDF can be signed now, but the stream still gets truncated on closing the dialog. Change-Id: I12dd50bf577cd23b3355f6c6d03e71a9c0dbcfab
Diffstat (limited to 'xmlsecurity/source/helper/documentsignaturemanager.cxx')
-rw-r--r--xmlsecurity/source/helper/documentsignaturemanager.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index 5fa5f170027f..05fbf3d0f5a7 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -209,6 +209,21 @@ bool DocumentSignatureManager::add(const uno::Reference<security::XCertificate>&
return false;
}
+ if (!mxStore.is())
+ {
+ // Something not ZIP based, try PDF.
+ nSecurityId = getPDFSignatureHelper().GetNewSecurityId();
+ getPDFSignatureHelper().SetX509Certificate(xCert);
+ getPDFSignatureHelper().SetDescription(rDescription);
+ uno::Reference<io::XInputStream> xInputStream(mxSignatureStream, uno::UNO_QUERY);
+ if (!getPDFSignatureHelper().Sign(xInputStream))
+ {
+ SAL_WARN("xmlsecurity.helper", "PDFSignatureHelper::Sign() failed");
+ return false;
+ }
+ return true;
+ }
+
maSignatureHelper.StartMission();
nSecurityId = maSignatureHelper.GetNewSecurityId();