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 <oox/dllapi.h>
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
; }
30 namespace oox
{ namespace ole
{ class OleStorage
; } }
35 class OOX_DLLPUBLIC DocumentDecryption
45 oox::ole::OleStorage
& mrOleStorage
;
46 std::unique_ptr
<CryptoEngine
> mEngine
;
47 CryptoType mCryptoType
;
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
);
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */