diff options
Diffstat (limited to 'src/lib/SDWEncryption.h')
-rw-r--r-- | src/lib/SDWEncryption.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/SDWEncryption.h b/src/lib/SDWEncryption.h new file mode 100644 index 0000000..99aa592 --- /dev/null +++ b/src/lib/SDWEncryption.h @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* Version: MPL 2.0 / LGPLv2.1+ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU Lesser General Public License Version 2.1 or later + * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are + * applicable instead of those above. + */ + +#ifndef SDWENCRYPTION_H +#define SDWENCRYPTION_H + +#include <libwpd-stream/libwpd-stream.h> +#include "libsdw_internal.h" + +namespace libsdw { + +class SDWEncryption +{ +public: + SDWEncryption(const char *password); + ~SDWEncryption(); + bool verifyPassword(const uint8_t *filePass, uint32_t date, uint32_t time); + const unsigned char *decrypt(const unsigned char *cryptBuffer, unsigned long numBytes); + +private: + unsigned char *m_buffer; + WPXString m_password; + // Unimplemented to prevent compiler from creating crasher ones + SDWEncryption(const SDWEncryption &); + SDWEncryption &operator=(const SDWEncryption &); +}; + +} // namespace libsdw + +#endif /* SDWENCRYPTION_H */ +/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */ |