wxSQLite3  4.4.6
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
wxSQLite3Cipher Class Reference

Cipher base class. More...

#include <wxsqlite3.h>

Inheritance diagram for wxSQLite3Cipher:
wxSQLite3CipherAes128 wxSQLite3CipherAes256 wxSQLite3CipherChaCha20 wxSQLite3CipherSQLCipher

Public Member Functions

 wxSQLite3Cipher ()
 Constructor. More...
 
virtual ~wxSQLite3Cipher ()
 Destructor. More...
 
virtual bool InitializeFromGlobalDefault ()
 Initialize the cipher instance based on global default settings. More...
 
virtual bool InitializeFromCurrent (wxSQLite3Database &db)
 Initialize the cipher instance based on current settings. More...
 
virtual bool InitializeFromCurrentDefault (wxSQLite3Database &db)
 Initialize the cipher instance based on current default settings. More...
 
virtual bool Apply (wxSQLite3Database &db) const
 Apply the cipher parameters to a database connection. More...
 
virtual bool Apply (void *dbHandle) const
 
void SetLegacyPageSize (int pageSize)
 
int GetLegacyPageSize () const
 
wxSQLite3CipherType GetCipherType () const
 Get the type of this cipher instance. More...
 
bool IsOk () const
 Check whether the cipher instance is valid. More...
 

Static Public Member Functions

static const wxString GetCipherName (wxSQLite3CipherType cipherType)
 Convert cipher type to string representation. More...
 
static wxSQLite3CipherType GetCipherType (const wxString &cipherName)
 Convert string representation to cipher type. More...
 
static bool SetCipher (wxSQLite3Database &db, wxSQLite3CipherType cipherType)
 Set the current cipher type for a database connection. More...
 
static bool SetCipherDefault (wxSQLite3Database &db, wxSQLite3CipherType cipherType)
 Set the default cipher type for a database connection. More...
 
static wxSQLite3CipherType GetCipher (wxSQLite3Database &db)
 Get the current cipher type of a database connection. More...
 
static wxSQLite3CipherType GetCipherDefault (wxSQLite3Database &db)
 Get the default cipher type of a database connection. More...
 
static wxSQLite3CipherType GetGlobalCipherDefault ()
 Get the globally defined default cipher type. More...
 
static int GetCipherParameterMin (const wxString &cipherName, const wxString &paramName)
 Get minimum allowed cipher parameter value. More...
 
static int GetCipherParameterMax (const wxString &cipherName, const wxString &paramName)
 Get maximum allowed cipher parameter value. More...
 

Protected Member Functions

 wxSQLite3Cipher (wxSQLite3CipherType cipherType)
 Constructor. More...
 
 wxSQLite3Cipher (const wxSQLite3Cipher &cipher)
 Copy constructor. More...
 
void SetInitialized (bool initialized)
 Set initialization status of the cipher instance. More...
 
void SetCipherType (wxSQLite3CipherType cipherType)
 Set type of the cipher instance. More...
 

Static Protected Member Functions

static void * GetDatabaseHandle (wxSQLite3Database &db)
 Get the SQLite3 database handle of a database instance. More...
 

Detailed Description

Cipher base class.

Constructor & Destructor Documentation

◆ wxSQLite3Cipher() [1/3]

wxSQLite3Cipher::wxSQLite3Cipher ( )

Constructor.

◆ ~wxSQLite3Cipher()

wxSQLite3Cipher::~wxSQLite3Cipher ( )
virtual

Destructor.

◆ wxSQLite3Cipher() [2/3]

wxSQLite3Cipher::wxSQLite3Cipher ( wxSQLite3CipherType  cipherType)
protected

Constructor.

Parameters
cipherTypethe type of the cipher

◆ wxSQLite3Cipher() [3/3]

wxSQLite3Cipher::wxSQLite3Cipher ( const wxSQLite3Cipher cipher)
protected

Copy constructor.

Member Function Documentation

◆ Apply() [1/2]

bool wxSQLite3Cipher::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 in wxSQLite3CipherSQLCipher, wxSQLite3CipherChaCha20, wxSQLite3CipherAes256, and wxSQLite3CipherAes128.

◆ Apply() [2/2]

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

◆ GetCipher()

wxSQLite3CipherType wxSQLite3Cipher::GetCipher ( wxSQLite3Database db)
static

Get the current cipher type of a database connection.

Parameters
dbdatabase instance
Returns
the enum representation of the cipher type

◆ GetCipherDefault()

wxSQLite3CipherType wxSQLite3Cipher::GetCipherDefault ( wxSQLite3Database db)
static

Get the default cipher type of a database connection.

Parameters
dbdatabase instance
Returns
the enum representation of the cipher type

◆ GetCipherName()

const wxString wxSQLite3Cipher::GetCipherName ( wxSQLite3CipherType  cipherType)
static

Convert cipher type to string representation.

The given cipher type is converted to a string representation.

Parameters
cipherTypethe type of a cipher
Returns
string representation of the given cipher type

◆ GetCipherParameterMax()

int wxSQLite3Cipher::GetCipherParameterMax ( const wxString &  cipherName,
const wxString &  paramName 
)
static

Get maximum allowed cipher parameter value.

Parameters
cipherNamethe name of the cipher to be queried
paramNamethe name of the parameter to be queried
Returns
the maximum value for the given cipher parameter

◆ GetCipherParameterMin()

int wxSQLite3Cipher::GetCipherParameterMin ( const wxString &  cipherName,
const wxString &  paramName 
)
static

Get minimum allowed cipher parameter value.

Parameters
cipherNamethe name of the cipher to be queried
paramNamethe name of the parameter to be queried
Returns
the minimum value for the given cipher parameter

◆ GetCipherType() [1/2]

wxSQLite3CipherType wxSQLite3Cipher::GetCipherType ( ) const

Get the type of this cipher instance.

The type of the cipher instance is returned.

Returns
the cipher type

◆ GetCipherType() [2/2]

wxSQLite3CipherType wxSQLite3Cipher::GetCipherType ( const wxString &  cipherName)
static

Convert string representation to cipher type.

The given string representation of a cipher is converted to the corresponding cipher type.. The parameters of the cipher instance are applied to the given database connection. WXSQLITE_CIPHER_UNKNOWN will be returned if the string representation is invalid.

Parameters
cipherNamethe string representation of a cipher type
Returns
cipher type corresponding to the given string representation

◆ GetDatabaseHandle()

void * wxSQLite3Cipher::GetDatabaseHandle ( wxSQLite3Database db)
staticprotected

Get the SQLite3 database handle of a database instance.

Parameters
dbdatabase instance
Returns
SQLite3 database handle

◆ GetGlobalCipherDefault()

wxSQLite3CipherType wxSQLite3Cipher::GetGlobalCipherDefault ( )
static

Get the globally defined default cipher type.

Returns
the enum representation of the cipher type

◆ GetLegacyPageSize()

int wxSQLite3Cipher::GetLegacyPageSize ( ) const

◆ InitializeFromCurrent()

bool wxSQLite3Cipher::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 in wxSQLite3CipherSQLCipher, wxSQLite3CipherChaCha20, wxSQLite3CipherAes256, and wxSQLite3CipherAes128.

◆ InitializeFromCurrentDefault()

bool wxSQLite3Cipher::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 in wxSQLite3CipherSQLCipher, wxSQLite3CipherChaCha20, wxSQLite3CipherAes256, and wxSQLite3CipherAes128.

◆ InitializeFromGlobalDefault()

bool wxSQLite3Cipher::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 in wxSQLite3CipherSQLCipher, wxSQLite3CipherChaCha20, wxSQLite3CipherAes256, and wxSQLite3CipherAes128.

◆ IsOk()

bool wxSQLite3Cipher::IsOk ( ) const

Check whether the cipher instance is valid.

The method checks whether the cipher instance is initialized correctly.

Returns
true if the cipher instance is valid, false otherwise

◆ SetCipher()

bool wxSQLite3Cipher::SetCipher ( wxSQLite3Database db,
wxSQLite3CipherType  cipherType 
)
static

Set the current cipher type for a database connection.

Parameters
dbdatabase instance
cipherTypethe cipher type to be set
Returns
true if the cipher type could be set, false otherwise

◆ SetCipherDefault()

bool wxSQLite3Cipher::SetCipherDefault ( wxSQLite3Database db,
wxSQLite3CipherType  cipherType 
)
static

Set the default cipher type for a database connection.

Parameters
dbdatabase instance
cipherTypethe cipher type to be set
Returns
true if the cipher type could be set, false otherwise

◆ SetCipherType()

void wxSQLite3Cipher::SetCipherType ( wxSQLite3CipherType  cipherType)
protected

Set type of the cipher instance.

Parameters
cipherTypethe cipher type to be set

◆ SetInitialized()

void wxSQLite3Cipher::SetInitialized ( bool  initialized)
protected

Set initialization status of the cipher instance.

Parameters
initializedthe initialization status

◆ SetLegacyPageSize()

void wxSQLite3Cipher::SetLegacyPageSize ( int  pageSize)

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