Sha256: 74ce0f70d1b7304697913eeb24c4f7b86f59dc18e44441063a3fa24917cd6d18
Contents?: true
Size: 1.23 KB
Versions: 32
Compression:
Stored size: 1.23 KB
Contents
#pragma once #include "logging/RhoLog.h" #include "common/IRhoCrypt.h" #include <wincrypt.h> namespace rho{ namespace common{ class CRhoCryptImpl : public IRhoCrypt { DEFINE_LOGCLASS; HCRYPTPROV m_hCryptProv; HCRYPTKEY m_hKey; DWORD m_dwLastError; StringW m_strDBPartition; public: CRhoCryptImpl(void); ~CRhoCryptImpl(void); virtual int db_decrypt( const char* szPartition, int size, unsigned char* data ); virtual int db_encrypt( const char* szPartition, int size, unsigned char* data, unsigned char* dataOut ); virtual int set_db_CryptKey( const char* szPartition, const char* szKey, bool bPersistent ); private: bool _checkError( BOOL bRes, const char* szFunc ); unsigned int getErrorCode(){ return m_dwLastError; } void initContext(const char* szPartition); void initCryptProvider(); void readKeyFromStorage(DATA_BLOB& blobKey); void writeKeyToStorage(); void saveKeyToStorage(DATA_BLOB& blobKey); }; } } #ifdef __cplusplus extern "C" { #endif //__cplusplus void rho_crypt_aes_256_encrypt(int size, unsigned char *in, unsigned char *out); void rho_crypt_aes_256_decrypt(int size, unsigned char *in, unsigned char *out); #ifdef __cplusplus }; #endif //__cplusplus
Version data entries
32 entries across 32 versions & 1 rubygems