CredentialBackingStore.h [plain text]
#ifndef CredentialBackingStore_h
#define CredentialBackingStore_h
#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
#include "Credential.h"
#include "SQLiteDatabase.h"
namespace WebCore {
class KURL;
class ProtectionSpace;
class CredentialBackingStore {
public:
static CredentialBackingStore* instance();
~CredentialBackingStore();
bool open(const String& dbPath);
void close();
bool addLogin(const KURL&, const ProtectionSpace&, const Credential&);
bool updateLogin(const KURL&, const ProtectionSpace&, const Credential&);
bool hasLogin(const KURL&, const ProtectionSpace&);
Credential getLogin(const ProtectionSpace&);
Credential getLogin(const KURL&);
bool removeLogin(const KURL&, const ProtectionSpace&);
bool addNeverRemember(const KURL&, const ProtectionSpace&);
bool hasNeverRemember(const ProtectionSpace&);
KURL getNeverRemember(const ProtectionSpace&);
bool removeNeverRemember(const ProtectionSpace&);
bool clearLogins();
bool clearNeverRemember();
private:
CredentialBackingStore();
String encryptedString(const String& plainText) const;
String decryptedString(const String& cipherText) const;
SQLiteDatabase m_database;
SQLiteStatement* m_addLoginStatement;
SQLiteStatement* m_updateLoginStatement;
SQLiteStatement* m_hasLoginStatement;
SQLiteStatement* m_getLoginStatement;
SQLiteStatement* m_getLoginByURLStatement;
SQLiteStatement* m_removeLoginStatement;
SQLiteStatement* m_addNeverRememberStatement;
SQLiteStatement* m_hasNeverRememberStatement;
SQLiteStatement* m_getNeverRememberStatement;
SQLiteStatement* m_removeNeverRememberStatement;
};
}
#endif // ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
#endif // CredentialBackingStore_h