Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / oox / crypto / Standard2007Engine.hxx
blob40aba8137161a06b5bcc076281d50b8ab6dcdd7e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 */
11 #ifndef INCLUDED_OOX_CRYPTO_STANDARD2007ENGINE_HXX
12 #define INCLUDED_OOX_CRYPTO_STANDARD2007ENGINE_HXX
14 #include <filter/msfilter/mscodec.hxx>
15 #include <oox/crypto/CryptoEngine.hxx>
16 #include <rtl/digest.h>
17 #include <rtl/ustring.hxx>
18 #include <sal/types.h>
20 namespace oox {
21 class BinaryXInputStream;
22 class BinaryXOutputStream;
25 namespace oox {
26 namespace core {
28 class Standard2007Engine : public CryptoEngine
30 msfilter::StandardEncryptionInfo mInfo;
32 bool generateVerifier();
33 bool calculateEncryptionKey(const OUString& rPassword);
35 public:
36 Standard2007Engine() = default;
38 msfilter::StandardEncryptionInfo& getInfo() { return mInfo;}
40 virtual bool generateEncryptionKey(const OUString& rPassword) override;
42 virtual void writeEncryptionInfo(
43 const OUString& rPassword,
44 BinaryXOutputStream& rStream) override;
46 virtual bool decrypt(
47 BinaryXInputStream& aInputStream,
48 BinaryXOutputStream& aOutputStream) override;
50 virtual void encrypt(
51 BinaryXInputStream& aInputStream,
52 BinaryXOutputStream& aOutputStream) override;
56 } // namespace core
57 } // namespace oox
59 #endif
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */