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 "ut_compiler.h"
00024 ABI_W_NO_CONST_QUAL
00025 #include <gsf/gsf.h>
00026 #include <gsf/gsf-input.h>
00027 ABI_W_POP
00028 #include "ut_types.h"
00029
00030 class ODc_CryptoInfo {
00031 public:
00032
00033 UT_uint32 m_decryptedSize;
00034
00035
00036 std::string m_algorithm;
00037 std::string m_initVector;
00038
00039
00040 std::string m_keyType;
00041 UT_uint32 m_iterCount;
00042 std::string m_salt;
00043 };
00044
00045 class ODc_Crypto {
00046 public:
00047 static UT_Error decrypt(GsfInput* pStream, const ODc_CryptoInfo& cryptInfo,
00048 const std::string& password, GsfInput** pDecryptedInput);
00049
00050 private:
00051 static UT_Error performDecrypt(GsfInput* pStream, unsigned char* salt, UT_uint32 salt_length, UT_uint32 iter_count,
00052 unsigned char* ivec, gsize ivec_length, const std::string& password, UT_uint32 decrypted_size, GsfInput** pDecryptedInput);
00053 };
00054
00055 #endif