wxSQLite3  5.0.1
Loading...
Searching...
No Matches
wxSQLite3::Cipher Class Reference

Cipher base class. More...

#include <wxsqlite3.h>

Inheritance diagram for wxSQLite3::Cipher:
wxSQLite3::CipherAegis wxSQLite3::CipherAes128 wxSQLite3::CipherAes256 wxSQLite3::CipherAscon128 wxSQLite3::CipherChaCha20 wxSQLite3::CipherRC4 wxSQLite3::CipherSQLCipher

Public Member Functions

 Cipher ()
 Constructor.
virtual ~Cipher ()
 Destructor.
virtual bool InitializeFromGlobalDefault ()
 Initialize the cipher instance based on global default settings.
virtual bool InitializeFromCurrent (Database &db)
 Initialize the cipher instance based on current settings.
virtual bool InitializeFromCurrentDefault (Database &db)
 Initialize the cipher instance based on current default settings.
virtual bool Apply (Database &db) const
 Apply the cipher parameters to a database connection.
virtual bool Apply (void *dbHandle) const
void SetLegacyPageSize (int pageSize)
int GetLegacyPageSize () const
CipherType 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 (CipherType cipherType)
 Convert cipher type to string representation.
static CipherType GetCipherType (const wxString &cipherName)
 Convert string representation to cipher type.
static bool SetCipher (Database &db, CipherType cipherType)
 Set the current cipher type for a database connection.
static bool SetCipherDefault (Database &db, CipherType cipherType)
 Set the default cipher type for a database connection.
static CipherType GetCipher (Database &db)
 Get the current cipher type of a database connection.
static CipherType GetCipherDefault (Database &db)
 Get the default cipher type of a database connection.
static CipherType 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

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

Static Protected Member Functions

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

Detailed Description

Cipher base class.

Constructor & Destructor Documentation

◆ Cipher() [1/3]

wxSQLite3::Cipher::Cipher ( )

Constructor.

◆ ~Cipher()

virtual wxSQLite3::Cipher::~Cipher ( )
virtual

Destructor.

◆ Cipher() [2/3]

wxSQLite3::Cipher::Cipher ( CipherType cipherType)
protected

Constructor.

Parameters
cipherTypethe type of the cipher

◆ Cipher() [3/3]

wxSQLite3::Cipher::Cipher ( const Cipher & cipher)
protected

Copy constructor.

Member Function Documentation

◆ Apply() [1/2]

virtual bool wxSQLite3::Cipher::Apply ( Database & 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 wxSQLite3::CipherAegis, wxSQLite3::CipherAes128, wxSQLite3::CipherAes256, wxSQLite3::CipherAscon128, wxSQLite3::CipherChaCha20, wxSQLite3::CipherRC4, and wxSQLite3::CipherSQLCipher.

◆ Apply() [2/2]

◆ GetCipher()

CipherType wxSQLite3::Cipher::GetCipher ( Database & db)
static

Get the current cipher type of a database connection.

Parameters
dbdatabase instance
Returns
the enum representation of the cipher type

◆ GetCipherDefault()

CipherType wxSQLite3::Cipher::GetCipherDefault ( Database & 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 wxSQLite3::Cipher::GetCipherName ( CipherType 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 wxSQLite3::Cipher::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 wxSQLite3::Cipher::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]

CipherType wxSQLite3::Cipher::GetCipherType ( ) const

Get the type of this cipher instance.

The type of the cipher instance is returned.

Returns
the cipher type

◆ GetCipherType() [2/2]

CipherType wxSQLite3::Cipher::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 * wxSQLite3::Cipher::GetDatabaseHandle ( Database & db)
staticprotected

Get the SQLite3 database handle of a database instance.

Parameters
dbdatabase instance
Returns
SQLite3 database handle

◆ GetGlobalCipherDefault()

CipherType wxSQLite3::Cipher::GetGlobalCipherDefault ( )
static

Get the globally defined default cipher type.

Returns
the enum representation of the cipher type

◆ GetLegacyPageSize()

int wxSQLite3::Cipher::GetLegacyPageSize ( ) const

◆ InitializeFromCurrent()

virtual bool wxSQLite3::Cipher::InitializeFromCurrent ( Database & 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 wxSQLite3::CipherAegis, wxSQLite3::CipherAes128, wxSQLite3::CipherAes256, wxSQLite3::CipherAscon128, wxSQLite3::CipherChaCha20, wxSQLite3::CipherRC4, and wxSQLite3::CipherSQLCipher.

◆ InitializeFromCurrentDefault()

virtual bool wxSQLite3::Cipher::InitializeFromCurrentDefault ( Database & 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 wxSQLite3::CipherAegis, wxSQLite3::CipherAes128, wxSQLite3::CipherAes256, wxSQLite3::CipherAscon128, wxSQLite3::CipherChaCha20, wxSQLite3::CipherRC4, and wxSQLite3::CipherSQLCipher.

◆ InitializeFromGlobalDefault()

virtual bool wxSQLite3::Cipher::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 wxSQLite3::CipherAegis, wxSQLite3::CipherAes128, wxSQLite3::CipherAes256, wxSQLite3::CipherAscon128, wxSQLite3::CipherChaCha20, wxSQLite3::CipherRC4, and wxSQLite3::CipherSQLCipher.

◆ IsOk()

bool wxSQLite3::Cipher::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 wxSQLite3::Cipher::SetCipher ( Database & db,
CipherType 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 wxSQLite3::Cipher::SetCipherDefault ( Database & db,
CipherType 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 wxSQLite3::Cipher::SetCipherType ( CipherType cipherType)
protected

Set type of the cipher instance.

Parameters
cipherTypethe cipher type to be set

◆ SetInitialized()

void wxSQLite3::Cipher::SetInitialized ( bool initialized)
protected

Set initialization status of the cipher instance.

Parameters
initializedthe initialization status

◆ SetLegacyPageSize()

void wxSQLite3::Cipher::SetLegacyPageSize ( int pageSize)

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