1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #ifndef INCLUDED_OOX_CRYPTO_DOCUMENTDECRYPTION_HXX
12 #define INCLUDED_OOX_CRYPTO_DOCUMENTDECRYPTION_HXX
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>
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
; }
27 namespace oox::ole
{ class OleStorage
; }
29 namespace oox::crypto
{
31 class DocumentDecryption
34 css::uno::Reference
< css::uno::XComponentContext
> mxContext
;
35 oox::ole::OleStorage
& mrOleStorage
;
36 css::uno::Sequence
<css::beans::NamedValue
> maStreamsSequence
;
37 css::uno::Reference
< css::packages::XPackageEncryption
> mxPackageEncryption
;
40 DocumentDecryption(css::uno::Reference
< css::uno::XComponentContext
> xContext
, oox::ole::OleStorage
& rOleStorage
);
42 bool decrypt(const css::uno::Reference
< css::io::XStream
>& xDocumentStream
);
43 bool readEncryptionInfo();
44 bool generateEncryptionKey(const OUString
& rPassword
);
46 css::uno::Sequence
< css::beans::NamedValue
> createEncryptionData(const OUString
& rPassword
);
50 } // namespace oox::crypto
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */