diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-10-15 10:09:15 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-10-28 21:29:19 +0100 |
commit | 23a2312344ac961ead9ee14140c0b3e879bb7a41 (patch) | |
tree | 866e85ef63364028cff008f12ad9d520a1f48cc4 /include/LibreOfficeKit | |
parent | 12b9952a9a04341bc41b0a5838bd25cfbb835e62 (diff) |
lokit: add funct. to insert, sign and verify signature
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 <quikee@gmail.com>
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 10 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 19 |
2 files changed, 29 insertions, 0 deletions
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 }; |