Kaydet (Commit) 4f17445c authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Ashod Nakashian

svl: move byte-array verification from vcl

Also use comphelper::Base64 and
DateTime::CreateFromUnixTime to avoid depending on sax.

Change-Id: If1853f8d9481c9caa0625a111707531bbc495f75
Reviewed-on: https://gerrit.libreoffice.org/39993Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
üst c76c3655
......@@ -14,8 +14,12 @@
#include <vector>
#include <rtl/strbuf.hxx>
#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <svl/svldllapi.h>
#include "com/sun/star/uno/Reference.hxx"
#include <svl/sigstruct.hxx>
namespace com {
namespace sun {
......@@ -24,6 +28,8 @@ namespace security {
class XCertificate; }
}}}
class SvStream;
namespace svl {
namespace crypto {
......@@ -54,6 +60,13 @@ public:
/// Returns the signature (in PKCS#7 format) as string (hex).
bool Sign(OStringBuffer& rCMSHexBuffer);
/// Verify and get Signature Information given a signature and stream.
static bool Verify(SvStream& rStream,
const std::vector<std::pair<size_t, size_t>>& aByteRanges,
const bool bNonDetached,
const std::vector<unsigned char>& aSignature,
SignatureInformation& rInformation);
private:
/// The certificate to use for signing.
const css::uno::Reference<css::security::XCertificate> m_xCertificate;
......
......@@ -95,6 +95,25 @@ $(eval $(call gb_Library_use_system_win32_libs,svl,\
shlwapi \
))
ifeq ($(OS),WNT)
$(eval $(call gb_Library_add_defs,svl,\
-DSVL_CRYPTO_MSCRYPTO \
))
$(eval $(call gb_Library_use_system_win32_libs,svl,\
crypt32 \
))
else
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Library_add_defs,svl,\
-DSVL_CRYPTO_NSS \
))
$(eval $(call gb_Library_use_externals,svl,\
nss3 \
plc4 \
))
endif # BUILD_TYPE=DESKTOP
endif
$(eval $(call gb_Library_add_exception_objects,svl,\
svl/source/config/asiancfg \
svl/source/config/cjkoptions \
......
......@@ -28,7 +28,7 @@
#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <sigstruct.hxx>
#include <svl/sigstruct.hxx>
namespace com {
......
......@@ -23,7 +23,7 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <rtl/ustring.hxx>
#include "sigstruct.hxx"
#include <svl/sigstruct.hxx>
#include "xmlsecurity/xmlsecuritydllapi.h"
#include <vector>
......
......@@ -24,7 +24,7 @@
#include <memory>
#include <sigstruct.hxx>
#include <svl/sigstruct.hxx>
#include <xmlsignaturehelper.hxx>
#include <pdfsignaturehelper.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
......
......@@ -302,6 +302,5 @@
#include <unotools/readwritemutexguard.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/unotoolsdllapi.h>
#include <sigstruct.hxx>
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,7 +19,7 @@
#include <com/sun/star/xml/crypto/XSEInitializer.hpp>
#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
#include <sigstruct.hxx>
#include <svl/sigstruct.hxx>
/// Handles signatures of a PDF file.
class XMLSECURITY_DLLPUBLIC PDFSignatureHelper
......
......@@ -25,7 +25,7 @@
#include <tools/link.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
#include <sigstruct.hxx>
#include <svl/sigstruct.hxx>
#include <xsecctl.hxx>
#include <xmlsecurity/xmlsecuritydllapi.h>
......
......@@ -20,7 +20,7 @@
#ifndef INCLUDED_XMLSECURITY_SOURCE_HELPER_XSECCTL_HXX
#define INCLUDED_XMLSECURITY_SOURCE_HELPER_XSECCTL_HXX
#include <sigstruct.hxx>
#include <svl/sigstruct.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
......
......@@ -15,7 +15,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <sigstruct.hxx>
#include <svl/sigstruct.hxx>
/// Writes a single OOXML digital signature.
class OOXMLSecExporter
......
......@@ -23,7 +23,7 @@
#include <xmlsecurity/pdfio/pdfdocument.hxx>
#include <sigstruct.hxx>
#include <svl/sigstruct.hxx>
using namespace com::sun::star;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment