Main Page
Namespaces
Classes
Files
File List
File Members
WPXEncryption.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* libwpd
3
* Version: MPL 2.0 / LGPLv2.1+
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
* Major Contributor(s):
10
* Copyright (C) 2007 Jaroslav Fojtik (JaFojtik@seznam.cz)
11
* Copyright (C) 2007 Fridrich Strba (fridrich.strba@bluewin.ch)
12
*
13
* For minor contributions see the git repository.
14
*
15
* Alternatively, the contents of this file may be used under the terms
16
* of the GNU Lesser General Public License Version 2.1 or later
17
* (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18
* applicable instead of those above.
19
*
20
* For further information visit http://libwpd.sourceforge.net
21
*/
22
23
/* "This product is not manufactured, approved, or supported by
24
* Corel Corporation or Corel Corporation Limited."
25
*/
26
27
#ifndef WPXENCRYPTION_H
28
#define WPXENCRYPTION_H
29
30
#include <
libwpd/libwpd.h
>
31
#include "
libwpd_types.h
"
32
33
class
WPXInputStream
;
34
35
class
WPXEncryption
36
{
37
public
:
38
WPXEncryption
(
const
char
*password,
const
unsigned
long
encryptionStartOffset = 0);
39
~WPXEncryption
();
40
41
const
unsigned
char
*
readAndDecrypt
(
WPXInputStream
*input,
unsigned
long
numBytes,
unsigned
long
&numBytesRead);
42
uint16_t
getCheckSum
()
const
;
43
44
void
setEncryptionStartOffset
(
unsigned
long
encryptionStartOffset)
45
{
46
m_encryptionStartOffset
= encryptionStartOffset;
47
}
48
unsigned
long
getEncryptionStartOffset
()
const
49
{
50
return
m_encryptionStartOffset
;
51
}
52
53
void
setEncryptionMaskBase
(
unsigned
char
encryptionMaskBase)
54
{
55
m_encryptionMaskBase
= encryptionMaskBase;
56
}
57
unsigned
char
getEncryptionMaskBase
()
const
58
{
59
return
m_encryptionMaskBase
;
60
}
61
62
const
WPXString
&
getEncryptionPassword
()
const
63
{
64
return
m_password
;
65
}
66
67
private
:
68
unsigned
char
*
m_buffer
;
69
WPXString
m_password
;
70
unsigned
long
m_encryptionStartOffset
;
71
unsigned
char
m_encryptionMaskBase
;
72
// Unimplemented to prevent compiler from creating crasher ones
73
WPXEncryption
(
const
WPXEncryption
&);
74
WPXEncryption
&
operator=
(
const
WPXEncryption
&);
75
};
76
77
#endif
/* WPXENCRYPTION_H */
78
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Generated for libwpd by
doxygen
1.8.4