Files
sqlitebrowser/src/CipherSettings.cpp
Tellow Krinkle 6b8fb51f04 Support custom cipher_plaintext_header_size
For all those people loading databases from their iOS devices
2019-11-13 20:57:56 +01:00

27 lines
590 B
C++

#include "CipherSettings.h"
#include "sqlitedb.h"
CipherSettings::CipherSettings()
: keyFormat(Passphrase),
pageSize(0),
kdfIterations(0),
plaintextHeaderSize(0)
{
}
std::string CipherSettings::getPassword() const
{
if(keyFormat == Passphrase)
{
return sqlb::escapeString(password);
} else {
// Remove the '0x' part at the beginning
return "\"x'" + password.substr(2) + "'\"";
}
}
CipherSettings::KeyFormats CipherSettings::getKeyFormat(int rawKeyFormat)
{
return static_cast<CipherSettings::KeyFormats>(rawKeyFormat);
}