- 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 <librevenge/librevenge.h>
31 #include <libwpd/libwpd.h>
32
33 class WPXEncryption
34 {
35 public:
36 WPXEncryption(const char *password, const unsigned long encryptionStartOffset = 0);
37 ~WPXEncryption();
38
39 const unsigned char *readAndDecrypt(librevenge::RVNGInputStream *input, unsigned long numBytes, unsigned long &numBytesRead);
40 unsigned short getCheckSum() const;
41
42 void setEncryptionStartOffset(unsigned long encryptionStartOffset)
43 {
44 m_encryptionStartOffset = encryptionStartOffset;
45 }
46 unsigned long getEncryptionStartOffset() const
47 {
48 return m_encryptionStartOffset;
49 }
50
51 void setEncryptionMaskBase(unsigned char encryptionMaskBase)
52 {
53 m_encryptionMaskBase = encryptionMaskBase;
54 }
55 unsigned char getEncryptionMaskBase() const
56 {
57 return m_encryptionMaskBase;
58 }
59
60 const librevenge::RVNGString &getEncryptionPassword() const
61 {
62 return m_password;
63 }
64
65 private:
66 unsigned char *m_buffer;
67 librevenge::RVNGString m_password;
68 unsigned long m_encryptionStartOffset;
69 unsigned char m_encryptionMaskBase;
70 // Unimplemented to prevent compiler from creating crasher ones
71 WPXEncryption(const WPXEncryption &);
72 WPXEncryption &operator=(const WPXEncryption &);
73 };
74
75 #endif /* WPXENCRYPTION_H */
76 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPXEncryption::getEncryptionPassword
const librevenge::RVNGString & getEncryptionPassword() const
Definition: WPXEncryption.h:60
WPXEncryption::getCheckSum
unsigned short getCheckSum() const
Definition: WPXEncryption.cpp:54
libwpd.h
WPXEncryption::operator=
WPXEncryption & operator=(const WPXEncryption &)
WPXEncryption::setEncryptionMaskBase
void setEncryptionMaskBase(unsigned char encryptionMaskBase)
Definition: WPXEncryption.h:51
WPXEncryption::WPXEncryption
WPXEncryption(const char *password, const unsigned long encryptionStartOffset=0)
Definition: WPXEncryption.cpp:30
WPXEncryption::m_encryptionStartOffset
unsigned long m_encryptionStartOffset
Definition: WPXEncryption.h:68
WPXEncryption::~WPXEncryption
~WPXEncryption()
Definition: WPXEncryption.cpp:47
WPXEncryption
Definition: WPXEncryption.h:33
WPXEncryption::m_buffer
unsigned char * m_buffer
Definition: WPXEncryption.h:66
WPXEncryption::setEncryptionStartOffset
void setEncryptionStartOffset(unsigned long encryptionStartOffset)
Definition: WPXEncryption.h:42
WPXEncryption::m_password
librevenge::RVNGString m_password
Definition: WPXEncryption.h:67
WPXEncryption::getEncryptionMaskBase
unsigned char getEncryptionMaskBase() const
Definition: WPXEncryption.h:55
WPXEncryption::readAndDecrypt
const unsigned char * readAndDecrypt(librevenge::RVNGInputStream *input, unsigned long numBytes, unsigned long &numBytesRead)
Definition: WPXEncryption.cpp:66
WPXEncryption::getEncryptionStartOffset
unsigned long getEncryptionStartOffset() const
Definition: WPXEncryption.h:46
WPXEncryption::m_encryptionMaskBase
unsigned char m_encryptionMaskBase
Definition: WPXEncryption.h:69