Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __ODC_CRYPTO__
00020 #define __ODC_CRYPTO__
00021
00022 #include <string>
00023 #include <gsf/gsf.h>
00024 #include <gsf/gsf-input.h>
00025 #include "ut_types.h"
00026
00027 class ODc_CryptoInfo {
00028 public:
00029
00030 UT_uint32 m_decryptedSize;
00031
00032
00033 std::string m_algorithm;
00034 std::string m_initVector;
00035
00036
00037 std::string m_keyType;
00038 UT_uint32 m_iterCount;
00039 std::string m_salt;
00040 };
00041
00042 class ODc_Crypto {
00043 public:
00044 static UT_Error decrypt(GsfInput* pStream, const ODc_CryptoInfo& cryptInfo,
00045 const std::string& password, GsfInput** pDecryptedInput);
00046
00047 private:
00048 static UT_Error performDecrypt(GsfInput* pStream, unsigned char* salt, UT_uint32 salt_length, UT_uint32 iter_count,
00049 unsigned char* ivec, gsize ivec_length, const std::string& password, UT_uint32 decrypted_size, GsfInput** pDecryptedInput);
00050 };
00051
00052 #endif