Sha256: 7bb4f3c7c59a0d4c1902a982a366144e0379789c782da165313bc6a6a5f30ed9

Contents?: true

Size: 1.11 KB

Versions: 32

Compression:

Stored size: 1.11 KB

Contents

#pragma once

#include "logging/RhoLog.h"
#include "common/IRhoCrypt.h"

namespace rho{
namespace common{

class CRhoCryptImpl : public IRhoCrypt
{
    DEFINE_LOGCLASS;

	unsigned char *  m_dbKeyData;
    int32_t   m_dwLastError;
    String    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( int32_t status, const char* szFunc );
    int32_t getErrorCode(){ return m_dwLastError; }

    void initContext(const char* szPartition);

	void generateNewKey();
    void readKeyFromStorage();
    void writeKeyToStorage();
};

}
}

#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

Version Path
rhodes-3.0.2 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.2.beta.1 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.1 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.1.beta.8 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.1.beta.7 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.1.beta.6 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.1.beta.5 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.1.beta.4 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.1.beta.3 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.1.beta.2 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.0 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.0.beta.7 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.0.beta.6 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.0.beta.5 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.0.beta.4 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.0.beta.3 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.0.beta.2 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-3.0.0.beta.1 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-2.4.1 platform/shared/common/iphone/RhoCryptImpl.h
rhodes-2.4.1.beta.1 platform/shared/common/iphone/RhoCryptImpl.h