wxSQLite3 4.9.12
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
wxSQLite3CipherSQLCipher Class Reference

Cipher class representing SQLCipher encryption (AES 256 bit in CBC mode with SHA1 HMAC) More...

#include <wxsqlite3.h>

Inheritance diagram for wxSQLite3CipherSQLCipher:
wxSQLite3Cipher

Public Types

enum  Algorithm { ALGORITHM_SHA1 , ALGORITHM_SHA256 , ALGORITHM_SHA512 }
 KDF and HMAC algorithm types. More...
 

Public Member Functions

 wxSQLite3CipherSQLCipher ()
 Constructor.
 
 wxSQLite3CipherSQLCipher (const wxSQLite3CipherSQLCipher &cipher)
 Copy constructor.
 
virtual ~wxSQLite3CipherSQLCipher ()
 Destructor.
 
virtual bool InitializeFromGlobalDefault ()
 Initialize the cipher instance based on global default settings.
 
virtual bool InitializeFromCurrent (wxSQLite3Database &db)
 Initialize the cipher instance based on current settings.
 
virtual bool InitializeFromCurrentDefault (wxSQLite3Database &db)
 Initialize the cipher instance based on current default settings.
 
virtual bool Apply (wxSQLite3Database &db) const
 Apply the cipher parameters to a database connection.
 
virtual bool Apply (void *dbHandle) const
 
void InitializeVersionDefault (int version)
 Initialize the cipher instance based on specific SQLCipher version.
 
void SetLegacy (bool legacy)
 Set legacy mode.
 
bool GetLegacy () const
 Get legacy mode.
 
int GetLegacyVersion () const
 Get legacy version.
 
void SetKdfIter (int kdfIter)
 Set iteration count of KDF function for ordinary key.
 
int GetKdfIter () const
 Get iteration count of KDF function for ordinary key.
 
void SetFastKdfIter (int fastKdfIter)
 Set iteration count of KDF function for HMAC key.
 
int GetFastKdfIter () const
 Get iteration count of KDF function for HMAC key.
 
void SetHmacUse (bool hmacUse)
 Set HMAC calculation status.
 
bool GetHmacUse () const
 Get HMAC calculation status.
 
void SetHmacPgNo (int hmacPgNo)
 Set the page number encoding for the HMAC calculation.
 
int GetHmacPgNo () const
 Get the page number encoding of the HMAC calculation.
 
void SetHmacSaltMask (int hmacSaltMask)
 Set the salt mask for the HMAC calculation.
 
int GetHmacSaltMask () const
 Get the salt mask of the HMAC calculation.
 
void SetKdfAlgorithm (Algorithm algorithm)
 Set the algorithm for the KDF function.
 
Algorithm GetKdfAlgorithm () const
 Set the algorithm for the KDF function.
 
void SetHmacAlgorithm (Algorithm algorithm)
 Set the algorithm for the HMAC function.
 
Algorithm GetHmacAlgorithm () const
 Set the algorithm for the HMAC function.
 
- Public Member Functions inherited from wxSQLite3Cipher
 wxSQLite3Cipher ()
 Constructor.
 
virtual ~wxSQLite3Cipher ()
 Destructor.
 
void SetLegacyPageSize (int pageSize)
 
int GetLegacyPageSize () const
 
wxSQLite3CipherType GetCipherType () const
 Get the type of this cipher instance.
 
bool IsOk () const
 Check whether the cipher instance is valid.
 

Additional Inherited Members

- Static Public Member Functions inherited from wxSQLite3Cipher
static const wxString GetCipherName (wxSQLite3CipherType cipherType)
 Convert cipher type to string representation.
 
static wxSQLite3CipherType GetCipherType (const wxString &cipherName)
 Convert string representation to cipher type.
 
static bool SetCipher (wxSQLite3Database &db, wxSQLite3CipherType cipherType)
 Set the current cipher type for a database connection.
 
static bool SetCipherDefault (wxSQLite3Database &db, wxSQLite3CipherType cipherType)
 Set the default cipher type for a database connection.
 
static wxSQLite3CipherType GetCipher (wxSQLite3Database &db)
 Get the current cipher type of a database connection.
 
static wxSQLite3CipherType GetCipherDefault (wxSQLite3Database &db)
 Get the default cipher type of a database connection.
 
static wxSQLite3CipherType GetGlobalCipherDefault ()
 Get the globally defined default cipher type.
 
static int GetCipherParameterMin (const wxString &cipherName, const wxString &paramName)
 Get minimum allowed cipher parameter value.
 
static int GetCipherParameterMax (const wxString &cipherName, const wxString &paramName)
 Get maximum allowed cipher parameter value.
 
- Protected Member Functions inherited from wxSQLite3Cipher
 wxSQLite3Cipher (wxSQLite3CipherType cipherType)
 Constructor.
 
 wxSQLite3Cipher (const wxSQLite3Cipher &cipher)
 Copy constructor.
 
void SetInitialized (bool initialized)
 Set initialization status of the cipher instance.
 
void SetCipherType (wxSQLite3CipherType cipherType)
 Set type of the cipher instance.
 
- Static Protected Member Functions inherited from wxSQLite3Cipher
static void * GetDatabaseHandle (wxSQLite3Database &db)
 Get the SQLite3 database handle of a database instance.
 

Detailed Description

Cipher class representing SQLCipher encryption (AES 256 bit in CBC mode with SHA1 HMAC)

Member Enumeration Documentation

◆ Algorithm

KDF and HMAC algorithm types.

Enumerator
ALGORITHM_SHA1 
ALGORITHM_SHA256 
ALGORITHM_SHA512 

Constructor & Destructor Documentation

◆ wxSQLite3CipherSQLCipher() [1/2]

wxSQLite3CipherSQLCipher::wxSQLite3CipherSQLCipher ( )

Constructor.

◆ wxSQLite3CipherSQLCipher() [2/2]

wxSQLite3CipherSQLCipher::wxSQLite3CipherSQLCipher ( const wxSQLite3CipherSQLCipher & cipher)

Copy constructor.

◆ ~wxSQLite3CipherSQLCipher()

wxSQLite3CipherSQLCipher::~wxSQLite3CipherSQLCipher ( )
virtual

Destructor.

Member Function Documentation

◆ Apply() [1/2]

bool wxSQLite3CipherSQLCipher::Apply ( void * dbHandle) const
virtual

Reimplemented from wxSQLite3Cipher.

◆ Apply() [2/2]

bool wxSQLite3CipherSQLCipher::Apply ( wxSQLite3Database & db) const
virtual

Apply the cipher parameters to a database connection.

The parameters of the cipher instance are applied to the given database connection.

Parameters
dbdatabase instance representing a database connection
Returns
true if the cipher parameters could be applied successfully, false otherwise

Reimplemented from wxSQLite3Cipher.

◆ GetFastKdfIter()

int wxSQLite3CipherSQLCipher::GetFastKdfIter ( ) const
inline

Get iteration count of KDF function for HMAC key.

◆ GetHmacAlgorithm()

Algorithm wxSQLite3CipherSQLCipher::GetHmacAlgorithm ( ) const
inline

Set the algorithm for the HMAC function.

◆ GetHmacPgNo()

int wxSQLite3CipherSQLCipher::GetHmacPgNo ( ) const
inline

Get the page number encoding of the HMAC calculation.

◆ GetHmacSaltMask()

int wxSQLite3CipherSQLCipher::GetHmacSaltMask ( ) const
inline

Get the salt mask of the HMAC calculation.

◆ GetHmacUse()

bool wxSQLite3CipherSQLCipher::GetHmacUse ( ) const
inline

Get HMAC calculation status.

◆ GetKdfAlgorithm()

Algorithm wxSQLite3CipherSQLCipher::GetKdfAlgorithm ( ) const
inline

Set the algorithm for the KDF function.

◆ GetKdfIter()

int wxSQLite3CipherSQLCipher::GetKdfIter ( ) const
inline

Get iteration count of KDF function for ordinary key.

◆ GetLegacy()

bool wxSQLite3CipherSQLCipher::GetLegacy ( ) const
inline

Get legacy mode.

◆ GetLegacyVersion()

int wxSQLite3CipherSQLCipher::GetLegacyVersion ( ) const
inline

Get legacy version.

◆ InitializeFromCurrent()

bool wxSQLite3CipherSQLCipher::InitializeFromCurrent ( wxSQLite3Database & db)
virtual

Initialize the cipher instance based on current settings.

The parameters of the cipher instance are initialize with the current settings of the associated cipher type as defined in the given database connection.

Parameters
dbdatabase instance representing a database connection
Returns
true if the cipher instance could be initialized successfully, false otherwise

Reimplemented from wxSQLite3Cipher.

◆ InitializeFromCurrentDefault()

bool wxSQLite3CipherSQLCipher::InitializeFromCurrentDefault ( wxSQLite3Database & db)
virtual

Initialize the cipher instance based on current default settings.

The parameters of the cipher instance are initialize with the current default settings of the associated cipher type as defined in the given database connection.

Parameters
dbdatabase instance representing a database connection
Returns
true if the cipher instance could be initialized successfully, false otherwise

Reimplemented from wxSQLite3Cipher.

◆ InitializeFromGlobalDefault()

bool wxSQLite3CipherSQLCipher::InitializeFromGlobalDefault ( )
virtual

Initialize the cipher instance based on global default settings.

The parameters of the cipher instance are initialize with the global default settings of the associated cipher type.

Returns
true if the cipher instance could be initialized successfully, false otherwise

Reimplemented from wxSQLite3Cipher.

◆ InitializeVersionDefault()

void wxSQLite3CipherSQLCipher::InitializeVersionDefault ( int version)

Initialize the cipher instance based on specific SQLCipher version.

The cipher parameters are initialized to the default values of the given SQLCipher version. Currently version 1, 2 and 3 of SQLCipher are supported. If the version number is invalid, version 3 is assumed.

Parameters
versionthe SQLCipher version

◆ SetFastKdfIter()

void wxSQLite3CipherSQLCipher::SetFastKdfIter ( int fastKdfIter)
inline

Set iteration count of KDF function for HMAC key.

◆ SetHmacAlgorithm()

void wxSQLite3CipherSQLCipher::SetHmacAlgorithm ( Algorithm algorithm)
inline

Set the algorithm for the HMAC function.

◆ SetHmacPgNo()

void wxSQLite3CipherSQLCipher::SetHmacPgNo ( int hmacPgNo)
inline

Set the page number encoding for the HMAC calculation.

◆ SetHmacSaltMask()

void wxSQLite3CipherSQLCipher::SetHmacSaltMask ( int hmacSaltMask)
inline

Set the salt mask for the HMAC calculation.

◆ SetHmacUse()

void wxSQLite3CipherSQLCipher::SetHmacUse ( bool hmacUse)
inline

Set HMAC calculation status.

◆ SetKdfAlgorithm()

void wxSQLite3CipherSQLCipher::SetKdfAlgorithm ( Algorithm algorithm)
inline

Set the algorithm for the KDF function.

◆ SetKdfIter()

void wxSQLite3CipherSQLCipher::SetKdfIter ( int kdfIter)
inline

Set iteration count of KDF function for ordinary key.

◆ SetLegacy()

void wxSQLite3CipherSQLCipher::SetLegacy ( bool legacy)
inline

Set legacy mode.


The documentation for this class was generated from the following files: