summaryrefslogtreecommitdiff
path: root/xmlsecurity/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-10-18 09:21:05 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-10-18 10:58:57 +0200
commit9a3b752756204307a0439c4e3534c094c6ee979d (patch)
tree09fef1a408e811565df875c22211112df7c4b452 /xmlsecurity/inc
parentc486e875de7c8e845594f5043a37ee8800865782 (diff)
xmlsecurity: initial incremental update support in pdfverify
I plan to use this for signing purposes, but so far what's implemented just writes out an incremental update at the end of the file, without actually updating much (just an unreferenced appearance object). Change-Id: I1cb40430ade6af0a25ff914ba4df670a77fcf457
Diffstat (limited to 'xmlsecurity/inc')
-rw-r--r--xmlsecurity/inc/pdfio/pdfdocument.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmlsecurity/inc/pdfio/pdfdocument.hxx b/xmlsecurity/inc/pdfio/pdfdocument.hxx
index 0eaaa0954801..2f95b7dfce48 100644
--- a/xmlsecurity/inc/pdfio/pdfdocument.hxx
+++ b/xmlsecurity/inc/pdfio/pdfdocument.hxx
@@ -13,6 +13,8 @@
#include <vector>
+#include <com/sun/star/security/XCertificate.hpp>
+
#include <tools/stream.hxx>
#include <xmlsecuritydllapi.h>
@@ -43,6 +45,8 @@ class XMLSECURITY_DLLPUBLIC PDFDocument
// List of object offsets we know.
std::vector<size_t> m_aXRef;
PDFTrailerElement* m_pTrailer;
+ /// All editing takes place in this buffer, if it happens.
+ SvMemoryStream m_aEditBuffer;
static int AsHex(char ch);
/// Decode a hex dump.
@@ -61,6 +65,10 @@ public:
std::vector<PDFObjectElement*> GetPages();
bool Read(SvStream& rStream);
+ /// Sign the read document with xCertificate in the edit buffer.
+ bool Sign(const css::uno::Reference<css::security::XCertificate>& xCertificate);
+ /// Serializes the contents of the edit buffer.
+ bool Write(SvStream& rStream);
std::vector<PDFObjectElement*> GetSignatureWidgets();
/// Return value is about if we can determine a result, rInformation is about the actual result.
static bool ValidateSignature(SvStream& rStream, PDFObjectElement* pSignature, SignatureInformation& rInformation);