diff --git a/include/SQLiteCpp/Database.h b/include/SQLiteCpp/Database.h index 293c330..4044a61 100644 --- a/include/SQLiteCpp/Database.h +++ b/include/SQLiteCpp/Database.h @@ -373,10 +373,8 @@ public: * @brief Set the key for the current sqlite database instance. * * This is the equivalent of the sqlite3_key call and should thus be called - * directly after opening the database. If the database is unencrypted, - * this methods encrypts it immediately. - * Normal database -> call db.key("secret") -> encrypted database, database ready - * Encrypted database -> call db.key("secret") -> database ready + * directly after opening the database. + * Open encrypted database -> call db.key("secret") -> database ready * * @param[in] aKey Key to decode/encode the database * @@ -390,8 +388,9 @@ public: * This is the equivalent of the sqlite3_rekey call and should thus be called * after the database has been opened with a valid key. To decrypt a * database, call this method with an empty string. - * Encrypted database -> call db.key("secret") -> call db.rekey("newsecret") -> change key, database ready - * Encrypted database -> call db.key("secret") -> call db.rekey("") -> decrypted database, database ready + * Open normal database -> call db.rekey("secret") -> encrypted database, database ready + * Open encrypted database -> call db.key("secret") -> call db.rekey("newsecret") -> change key, database ready + * Open encrypted database -> call db.key("secret") -> call db.rekey("") -> decrypted database, database ready * * @param[in] aNewKey New key to encode the database * @@ -413,7 +412,7 @@ public: * * @throw SQLite::Exception in case of error */ - const bool isUnencrypted(const std::string& aFilename) const; + static const bool isUnencrypted(const std::string& aFilename); private: /// @{ Database must be non-copyable diff --git a/src/Database.cpp b/src/Database.cpp index f24a7fd..7102444 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -264,7 +264,7 @@ void Database::rekey(const std::string& aNewKey) const } //Test if a file contains an unencrypted database. -const bool Database::isUnencrypted(const std::string& aFilename) const +const bool Database::isUnencrypted(const std::string& aFilename) { if (aFilename.length() > 0) { std::ifstream fileBuffer(aFilename, std::ios::in | std::ios::binary);