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
{ class BinaryInputStream
; }
31 namespace oox
{ namespace ole
{ class OleStorage
; } }
36 class OOX_DLLPUBLIC DocumentDecryption
39 css::uno::Reference
< css::uno::XComponentContext
> mxContext
;
48 oox::ole::OleStorage
& mrOleStorage
;
49 std::unique_ptr
<CryptoEngine
> mEngine
;
50 CryptoType mCryptoType
;
52 bool readAgileEncryptionInfo( css::uno::Reference
< css::io::XInputStream
>& rStream
);
53 bool readStandard2007EncryptionInfo( BinaryInputStream
& rStream
);
57 oox::ole::OleStorage
& rOleStorage
,
58 css::uno::Reference
< css::uno::XComponentContext
> const & xContext
);
60 bool decrypt(const css::uno::Reference
< css::io::XStream
>& xDocumentStream
);
61 bool readEncryptionInfo();
62 bool generateEncryptionKey(const OUString
& rPassword
);
64 css::uno::Sequence
< css::beans::NamedValue
> createEncryptionData(const OUString
& rPassword
);
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */