/src/libreoffice/include/oox/crypto/Standard2007Engine.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | */ |
10 | | |
11 | | #ifndef INCLUDED_OOX_CRYPTO_STANDARD2007ENGINE_HXX |
12 | | #define INCLUDED_OOX_CRYPTO_STANDARD2007ENGINE_HXX |
13 | | |
14 | | #include <oox/dllapi.h> |
15 | | #include <oox/crypto/CryptoEngine.hxx> |
16 | | #include <filter/msfilter/mscodec.hxx> |
17 | | #include <rtl/ustring.hxx> |
18 | | #include <sal/types.h> |
19 | | |
20 | | namespace oox::crypto { |
21 | | |
22 | | class OOX_DLLPUBLIC Standard2007Engine final : public CryptoEngine |
23 | | { |
24 | | msfilter::StandardEncryptionInfo mInfo; |
25 | | |
26 | | bool generateVerifier(); |
27 | | bool calculateEncryptionKey(std::u16string_view rPassword); |
28 | | |
29 | | public: |
30 | 63 | Standard2007Engine() = default; |
31 | | |
32 | | bool readEncryptionInfo(css::uno::Reference<css::io::XInputStream> & rxInputStream) override; |
33 | | |
34 | | virtual bool generateEncryptionKey(std::u16string_view rPassword) override; |
35 | | |
36 | | virtual bool decrypt( |
37 | | BinaryXInputStream& aInputStream, |
38 | | BinaryXOutputStream& aOutputStream) override; |
39 | | |
40 | | bool checkDataIntegrity() override; |
41 | | |
42 | | void encrypt(const css::uno::Reference<css::io::XInputStream>& rxInputStream, |
43 | | css::uno::Reference<css::io::XOutputStream>& rxOutputStream, |
44 | | sal_uInt32 nSize) override; |
45 | | |
46 | | virtual void writeEncryptionInfo(BinaryXOutputStream& rStream) override; |
47 | | |
48 | | virtual bool setupEncryption(OUString const & rPassword) override; |
49 | | |
50 | | }; |
51 | | |
52 | | } // namespace oox::crypto |
53 | | |
54 | | #endif |
55 | | |
56 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |