From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- include/oox/crypto/StrongEncryptionDataSpace.hxx | 76 ++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 include/oox/crypto/StrongEncryptionDataSpace.hxx (limited to 'include/oox/crypto/StrongEncryptionDataSpace.hxx') diff --git a/include/oox/crypto/StrongEncryptionDataSpace.hxx b/include/oox/crypto/StrongEncryptionDataSpace.hxx new file mode 100644 index 0000000000..cd7156515a --- /dev/null +++ b/include/oox/crypto/StrongEncryptionDataSpace.hxx @@ -0,0 +1,76 @@ +/* -*- 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_OOX_CRYPTO_STRONGENCRYPTINDATASPACE_HXX +#define INCLUDED_OOX_CRYPTO_STRONGENCRYPTINDATASPACE_HXX + +#include + +#include + +#include +#include +#include +#include +#include + +namespace com::sun::star::uno +{ +class XComponentContext; +} + +namespace oox::crypto +{ +class StrongEncryptionDataSpace final + : public cppu::WeakImplHelper +{ + css::uno::Reference mxContext; + std::unique_ptr mCryptoEngine; + + css::uno::Reference + getStream(const css::uno::Sequence& rStreams, + std::u16string_view sStreamName); + +public: + StrongEncryptionDataSpace(const css::uno::Reference& rxContext); + + // Decryption + + virtual sal_Bool SAL_CALL generateEncryptionKey(const OUString& rPassword) override; + virtual sal_Bool SAL_CALL + readEncryptionInfo(const css::uno::Sequence& aStreams) override; + virtual sal_Bool SAL_CALL + decrypt(const css::uno::Reference& rxInputStream, + css::uno::Reference& rxOutputStream) override; + + virtual sal_Bool SAL_CALL checkDataIntegrity() override; + + // Encryption + + virtual css::uno::Sequence + SAL_CALL encrypt(const css::uno::Reference& rxInputStream) override; + + virtual sal_Bool SAL_CALL + setupEncryption(const css::uno::Sequence& rMediaEncData) override; + + virtual css::uno::Sequence + SAL_CALL createEncryptionData(const OUString& rPassword) override; + + // com.sun.star.lang.XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; +}; + +} // namespace oox::crypto + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3