summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h10
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx12
-rw-r--r--include/sfx2/DocumentSigner.hxx41
3 files changed, 63 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 4dd23a2cbc7a..2df1cea6dd31 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -94,6 +94,16 @@ struct _LibreOfficeKitClass
@since LibreOffice 6.0
*/
int (*runMacro) (LibreOfficeKit *pThis, const char* pURL);
+
+ /** @see lok::Office::signDocument().
+ @since LibreOffice 6.2
+ */
+ bool (*signDocument) (LibreOfficeKit* pThis,
+ const char* pUrl,
+ const unsigned char* pCertificateBinary,
+ const int nCertificateBinarySize,
+ const unsigned char* pPrivateKeyBinary,
+ const int nPrivateKeyBinarySize);
};
#define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 5d7771cf80b0..31e95a09c0ec 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -791,6 +791,18 @@ public:
{
return mpThis->pClass->runMacro( mpThis, pURL );
}
+
+ /**
+ * Exports the document and signes its content.
+ */
+ bool signDocument(const char* pURL,
+ const unsigned char* pCertificateBinary, const int nCertificateBinarySize,
+ const unsigned char* pPrivateKeyBinary, const int nPrivateKeyBinarySize)
+ {
+ return mpThis->pClass->signDocument(mpThis, pURL,
+ pCertificateBinary, nCertificateBinarySize,
+ pPrivateKeyBinary, nPrivateKeyBinarySize);
+ }
};
/// Factory method to create a lok::Office instance.
diff --git a/include/sfx2/DocumentSigner.hxx b/include/sfx2/DocumentSigner.hxx
new file mode 100644
index 000000000000..1f4326ef3976
--- /dev/null
+++ b/include/sfx2/DocumentSigner.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef INCLUDED_SFX2_DOCUMENTSIGNER_HXX
+#define INCLUDED_SFX2_DOCUMENTSIGNER_HXX
+
+#include <sal/config.h>
+#include <sfx2/dllapi.h>
+
+#include <memory>
+
+#include <com/sun/star/security/XCertificate.hpp>
+
+namespace sfx2
+{
+class SFX2_DLLPUBLIC DocumentSigner
+{
+private:
+ OUString m_aUrl;
+
+public:
+ DocumentSigner(OUString const& rUrl)
+ : m_aUrl(rUrl)
+ {
+ }
+
+ bool signDocument(css::uno::Reference<css::security::XCertificate> const& rxCertificate);
+};
+
+} // namespace sfx2
+
+#endif // INCLUDED_SFX2_DOCUMENTSIGNER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */