bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / oox / crypto / DocumentDecryption.hxx
blobe32667760c9fb1bd20088d5ac6901e7cd4a92287
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_DOCUMENTDECRYPTION_HXX
12 #define INCLUDED_OOX_CRYPTO_DOCUMENTDECRYPTION_HXX
14 #include <oox/dllapi.h>
16 #include <memory>
18 #include <com/sun/star/uno/Reference.hxx>
19 #include <com/sun/star/uno/Sequence.hxx>
20 #include <oox/crypto/CryptoEngine.hxx>
21 #include <rtl/ustring.hxx>
23 namespace com { namespace sun { namespace star {
24 namespace beans { struct NamedValue; }
25 namespace io { class XInputStream; }
26 namespace io { class XStream; }
27 namespace uno { class XComponentContext; }
28 } } }
30 namespace oox { namespace ole { class OleStorage; } }
32 namespace oox {
33 namespace core {
35 class OOX_DLLPUBLIC DocumentDecryption
37 private:
38 enum CryptoType
40 UNKNOWN,
41 STANDARD_2007,
42 AGILE
45 oox::ole::OleStorage& mrOleStorage;
46 std::unique_ptr<CryptoEngine> mEngine;
47 CryptoType mCryptoType;
49 public:
50 DocumentDecryption(oox::ole::OleStorage& rOleStorage);
52 bool decrypt(const css::uno::Reference< css::io::XStream >& xDocumentStream);
53 bool readEncryptionInfo();
54 bool generateEncryptionKey(const OUString& rPassword);
56 css::uno::Sequence< css::beans::NamedValue > createEncryptionData(const OUString& rPassword);
60 } // namespace core
61 } // namespace oox
63 #endif
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */