LibreOffice Module oox (master)  1
DocumentDecryption.hxx
Go to the documentation of this file.
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_DOCUMENTDECRYPTION_HXX
12 #define INCLUDED_OOX_CRYPTO_DOCUMENTDECRYPTION_HXX
13 
14 #include <com/sun/star/beans/NamedValue.hpp>
15 #include <com/sun/star/uno/Reference.hxx>
16 #include <com/sun/star/uno/Sequence.hxx>
17 #include <rtl/ustring.hxx>
18 
19 namespace com::sun::star {
20  namespace beans { struct NamedValue; }
21  namespace io { class XInputStream; }
22  namespace io { class XStream; }
23  namespace uno { class XComponentContext; }
24  namespace packages { class XPackageEncryption; }
25 }
26 
27 namespace oox::ole { class OleStorage; }
28 
29 namespace oox::crypto {
30 
32 {
33 private:
34  css::uno::Reference< css::uno::XComponentContext > mxContext;
36  css::uno::Sequence<css::beans::NamedValue> maStreamsSequence;
37  css::uno::Reference< css::packages::XPackageEncryption > mxPackageEncryption;
38 
39 public:
40  DocumentDecryption(const css::uno::Reference< css::uno::XComponentContext >& rxContext, oox::ole::OleStorage& rOleStorage);
41 
42  bool decrypt(const css::uno::Reference< css::io::XStream >& xDocumentStream);
43  bool readEncryptionInfo();
44  bool generateEncryptionKey(const OUString& rPassword);
45 
46  css::uno::Sequence< css::beans::NamedValue > createEncryptionData(const OUString& rPassword);
47 
48 };
49 
50 } // namespace oox::crypto
51 
52 #endif
53 
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DocumentDecryption(const css::uno::Reference< css::uno::XComponentContext > &rxContext, oox::ole::OleStorage &rOleStorage)
exports com.sun.star. io
exports com.sun.star. packages
css::uno::Reference< css::uno::XComponentContext > mxContext
Implements stream access for binary OLE storages.
Definition: olestorage.hxx:43
oox::ole::OleStorage & mrOleStorage
css::uno::Reference< css::packages::XPackageEncryption > mxPackageEncryption
css::uno::Sequence< css::beans::NamedValue > createEncryptionData(const OUString &rPassword)
bool decrypt(const css::uno::Reference< css::io::XStream > &xDocumentStream)
bool generateEncryptionKey(const OUString &rPassword)
exports com.sun.star. beans
css::uno::Sequence< css::beans::NamedValue > maStreamsSequence