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
19namespace 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
27namespace oox::ole { class OleStorage; }
28
29namespace oox::crypto {
30
32{
33private:
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
39public:
40 DocumentDecryption(css::uno::Reference< css::uno::XComponentContext > xContext, 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: */
bool decrypt(const css::uno::Reference< css::io::XStream > &xDocumentStream)
DocumentDecryption(css::uno::Reference< css::uno::XComponentContext > xContext, oox::ole::OleStorage &rOleStorage)
css::uno::Reference< css::packages::XPackageEncryption > mxPackageEncryption
oox::ole::OleStorage & mrOleStorage
css::uno::Sequence< css::beans::NamedValue > createEncryptionData(const OUString &rPassword)
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::Sequence< css::beans::NamedValue > maStreamsSequence
bool generateEncryptionKey(const OUString &rPassword)
Implements stream access for binary OLE storages.
Definition: olestorage.hxx:44