From 23a2312344ac961ead9ee14140c0b3e879bb7a41 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 15 Oct 2018 10:09:15 +0200 Subject: lokit: add funct. to insert, sign and verify signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A lot of signing code paths trigger a GUI dialog (to select the certificate for example) which aren't acceptable when triggering through the LOKit. This code paths needed to be duplicated and reworked to not trigger any GUI action. Change-Id: I2f0d6038fb1bcd00adcdf86e432f9df8858cc21c Reviewed-on: https://gerrit.libreoffice.org/61780 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/LibreOfficeKit/LibreOfficeKit.h | 10 ++++++++++ include/LibreOfficeKit/LibreOfficeKit.hxx | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'include/LibreOfficeKit') diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 0ae5c6ff1332..24aa496214a8 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -321,6 +321,16 @@ struct _LibreOfficeKitDocumentClass const int nTileHeight); #endif // IOS +// CERTIFICATE AND SIGNING + + /// @see lok::Document::insertCertificate(). + bool (*insertCertificate) (LibreOfficeKitDocument* pThis, + const unsigned char* pCertificateBinary, + const int pCertificateBinarySize); + + /// @see lok::Document::getSignatureState(). + int (*getSignatureState) (LibreOfficeKitDocument* pThis); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 3568c861f083..d6e4bee6fa8e 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -578,6 +578,25 @@ public: } #endif // IOS + /** + * Insert certificate (in binary form) to the certificate store. + */ + bool insertCertificate(const unsigned char* pCertificateBinary, + const int pCertificateBinarySize) + { + return mpDoc->pClass->insertCertificate(mpDoc, pCertificateBinary, pCertificateBinarySize); + } + + /** + * Verify signature of the document. + * + * Check possible values in include/sfx2/signaturestate.hxx + */ + int getSignatureState() + { + return mpDoc->pClass->getSignatureState(mpDoc); + } + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; -- cgit