wxSQLite3 4.9.12
Loading...
Searching...
No Matches
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 wxSQLite3CipherAscon128 wxSQLite3CipherChaCha20 wxSQLite3CipherRC4 wxSQLite3CipherSQLCipher

Public Member Functions

 wxSQLite3Cipher ()
 Constructor.
 
virtual ~wxSQLite3Cipher ()
 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 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.
 

Static Public Member Functions

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

 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

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

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 ( void * dbHandle) const
virtual

◆ Apply() [2/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 wxSQLite3CipherAes128, wxSQLite3CipherAes256, wxSQLite3CipherChaCha20, wxSQLite3CipherSQLCipher, wxSQLite3CipherRC4, and wxSQLite3CipherAscon128.

◆ 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 wxSQLite3CipherAes128, wxSQLite3CipherAes256, wxSQLite3CipherChaCha20, wxSQLite3CipherSQLCipher, wxSQLite3CipherRC4, and wxSQLite3CipherAscon128.

◆ 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 wxSQLite3CipherAes128, wxSQLite3CipherAes256, wxSQLite3CipherChaCha20, wxSQLite3CipherSQLCipher, wxSQLite3CipherRC4, and wxSQLite3CipherAscon128.

◆ 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 wxSQLite3CipherAes128, wxSQLite3CipherAes256, wxSQLite3CipherChaCha20, wxSQLite3CipherSQLCipher, wxSQLite3CipherRC4, and wxSQLite3CipherAscon128.

◆ 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: