From 08c3c504644ee978c2ec75ba083765b6ffddf08c Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Wed, 24 Oct 2018 10:56:15 +0200 Subject: lok: new function to add certificate to certificate DB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also needed to extend XCertificateCreator with a new method "addDERCertificateToTheDatabase". Change-Id: I7b4df65365893bd5a0628aeec30b3156584849fe Reviewed-on: https://gerrit.libreoffice.org/62273 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/LibreOfficeKit/LibreOfficeKit.h | 5 +++++ include/LibreOfficeKit/LibreOfficeKit.hxx | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'include/LibreOfficeKit') diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 238d93f162db..e052765ac794 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -330,6 +330,11 @@ struct _LibreOfficeKitDocumentClass const unsigned char* pPrivateKeyBinary, const int nPrivateKeyBinarySize); + /// @see lok::Document::addCertificate(). + bool (*addCertificate) (LibreOfficeKitDocument* pThis, + const unsigned char* pCertificateBinary, + const int nCertificateBinarySize); + /// @see lok::Document::getSignatureState(). int (*getSignatureState) (LibreOfficeKitDocument* pThis); diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 829751f2efa9..c238d507c183 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -586,11 +586,22 @@ public: const unsigned char* pPrivateKeyBinary, const int nPrivateKeyBinarySize) { - return mpDoc->pClass->insertCertificate(mpDoc, - pCertificateBinary, pCertificateBinarySize, + return mpDoc->pClass->insertCertificate(mpDoc, + pCertificateBinary, pCertificateBinarySize, pPrivateKeyBinary, nPrivateKeyBinarySize); } + /** + * Add the certificate (in binary form) to the certificate store. + * + */ + bool addCertificate(const unsigned char* pCertificateBinary, + const int pCertificateBinarySize) + { + return mpDoc->pClass->addCertificate(mpDoc, + pCertificateBinary, pCertificateBinarySize); + } + /** * Verify signature of the document. * -- cgit