KeePass Help Center KeePass Home | Downloads | Translations | Plugins | Donate 
Help Center Home | Forums | Awards | Links 







IKpDatabase Struct Referenceabstract

Interface to a database handling object. More...

#include <IKpDatabase.h>

Inheritance diagram for IKpDatabase:
IKpUnknown

Public Member Functions

virtual HRESULT InitPrimaryInstance ()=0
 Used by KeePass internally, plugins must not call this method. More...
 
virtual INT SetMasterKey (LPCTSTR lpMasterKey, BOOL bDiskDrive, LPCTSTR lpSecondKey)=0
 Set the master key for the database (will be used in the database loading / saving process). More...
 
virtual DWORD GetEntryCount ()=0
 Returns the total number of entries in database. More...
 
virtual DWORD GetGroupCount ()=0
 Returns the total number of groups in database. More...
 
virtual DWORD GetEntryCountInGroup (LPCTSTR lpGroup)=0
 Count entries in a group (identified by its name). More...
 
virtual DWORD GetEntryCountInGroupN (DWORD dwGroupId)=0
 Count entries in a group (identified by its ID). More...
 
virtual PW_ENTRY * GetEntry (DWORD dwIndex)=0
 Get an entry (by index). More...
 
virtual PW_ENTRY * GetEntryByGroup (DWORD dwGroupId, DWORD dwIndex)=0
 Get an entry (by specifying an index of a group). More...
 
virtual DWORD GetEntryByGroupN (DWORD dwGroupId, DWORD dwIndex)=0
 
virtual PW_ENTRY * GetEntryByUuid (const BYTE *pUuid)=0
 Get an entry (by its UUID). More...
 
virtual DWORD GetEntryByUuidN (const BYTE *pUuid)=0
 
virtual DWORD GetEntryPosInGroup (const PW_ENTRY *pEntry)=0
 
virtual PW_ENTRY * GetLastEditedEntry ()=0
 Get the entry that was last modified. More...
 
virtual PW_GROUP * GetGroup (DWORD dwIndex)=0
 Get a group (by index). More...
 
virtual PW_GROUP * GetGroupById (DWORD dwGroupId)=0
 Get a group (by ID). More...
 
virtual DWORD GetGroupByIdN (DWORD dwGroupId)=0
 
virtual DWORD GetGroupId (LPCTSTR lpGroupName)=0
 
virtual DWORD GetGroupIdByIndex (DWORD dwIndex)=0
 
virtual DWORD GetLastChildGroup (DWORD dwParentIndex)=0
 
virtual BOOL GetGroupTree (DWORD dwGroupId, DWORD *pvIndices)=0
 
virtual BOOL AddGroup (const PW_GROUP *pTemplate)=0
 
virtual BOOL AddEntry (const PW_ENTRY *pTemplate)=0
 
virtual BOOL BackupEntry (const PW_ENTRY *pe, BOOL *pbGroupCreated)=0
 
virtual BOOL DeleteEntry (DWORD dwIndex)=0
 
virtual BOOL DeleteGroupById (DWORD dwGroupId, BOOL bCreateBackupEntries)=0
 
virtual BOOL SetGroup (DWORD dwIndex, const PW_GROUP *pTemplate)=0
 
virtual BOOL SetEntry (DWORD dwIndex, const PW_ENTRY *pTemplate)=0
 
virtual HRESULT LockEntryPassword (PW_ENTRY *pEntry)=0
 In-memory protection: encrypt the password of an entry. More...
 
virtual HRESULT UnlockEntryPassword (PW_ENTRY *pEntry)=0
 In-memory protection: decrypt the password of an entry. More...
 
virtual HRESULT NewDatabase ()=0
 
virtual INT OpenDatabase (LPCTSTR lpFile, PWDB_REPAIR_INFO *pRepair)=0
 
virtual INT SaveDatabase (LPCTSTR lpFile, BYTE *pWrittenDataHash32)=0
 
virtual HRESULT MoveEntry (DWORD dwGroupId, DWORD dwFrom, DWORD dwTo)=0
 
virtual BOOL MoveGroup (DWORD dwFrom, DWORD dwTo)=0
 
virtual BOOL MoveGroupEx (DWORD dwFromId, DWORD dwToId)=0
 
virtual BOOL MoveGroupExDir (DWORD dwGroupId, INT iDirection)=0
 
virtual HRESULT SortGroup (DWORD dwGroupId, DWORD dwSortByField)=0
 
virtual HRESULT SortGroupList ()=0
 
virtual DWORD Find (LPCTSTR lpFindString, BOOL bCaseSensitive, DWORD dwSearchFlags, DWORD dwStart)=0
 
virtual BOOL SetEncryptionAlgorithm (INT nAlgorithm)=0
 
virtual INT GetEncryptionAlgorithm ()=0
 
virtual DWORD GetKeyEncRounds ()=0
 
virtual HRESULT SetKeyEncRounds (DWORD dwRounds)=0
 
virtual const PW_DBHEADER * GetLastDatabaseHeader ()=0
 Get the last used database header. More...
 
virtual HRESULT FixGroupTree ()=0
 Checks and corrects the group tree (level order, etc). More...
 
virtual HRESULT SubstEntryGroupIds (DWORD dwExistingId, DWORD dwNewId)=0
 
virtual HRESULT GetRawMasterKey (BYTE *pStorage)=0
 
virtual HRESULT SetRawMasterKey (const BYTE *pNewKey)=0
 
virtual HRESULT GetPropertyString (DWORD dwPropertyId, LPTSTR lpBuf, DWORD dwBufMaxChars)=0
 
virtual BOOL SetPropertyString (DWORD dwPropertyId, LPCTSTR lpValue)=0
 
virtual BOOL SetCustomKvp (LPCTSTR lpKey, LPCTSTR lpValue)=0
 Set a custom key-value pair, plugins can use this method to store own data in the database. More...
 
virtual LPCTSTR GetCustomKvp (LPCTSTR lpKey)=0
 Get a custom key-value pair, these are typically set by plugins to store own data in the database. More...
 
virtual LPCTSTR GetBackupGroupName (BOOL bTranslated)=0
 Get the name of the entry backups group. More...
 
- Public Member Functions inherited from IKpUnknown
virtual HRESULT QueryInterface (REFIID riid, void **ppvObject)=0
 COM infrastructure, provides access to all interfaces supported by this object. More...
 
virtual ULONG AddRef ()=0
 COM infrastructure, increments the reference count for this object. More...
 
virtual ULONG Release ()=0
 COM infrastructure, decrements the reference count for this object and eventually deletes it. More...
 

Detailed Description

Interface to a database handling object.

Use IKpAPI::QueryInstance to retrieve an interface to a singleton object in KeePass handling database operations.

Member Function Documentation

◆ AddEntry()

virtual BOOL IKpDatabase::AddEntry ( const PW_ENTRY *  pTemplate)
pure virtual

◆ AddGroup()

virtual BOOL IKpDatabase::AddGroup ( const PW_GROUP *  pTemplate)
pure virtual

◆ BackupEntry()

virtual BOOL IKpDatabase::BackupEntry ( const PW_ENTRY *  pe,
BOOL *  pbGroupCreated 
)
pure virtual

◆ DeleteEntry()

virtual BOOL IKpDatabase::DeleteEntry ( DWORD  dwIndex)
pure virtual

◆ DeleteGroupById()

virtual BOOL IKpDatabase::DeleteGroupById ( DWORD  dwGroupId,
BOOL  bCreateBackupEntries 
)
pure virtual

◆ Find()

virtual DWORD IKpDatabase::Find ( LPCTSTR  lpFindString,
BOOL  bCaseSensitive,
DWORD  dwSearchFlags,
DWORD  dwStart 
)
pure virtual

◆ FixGroupTree()

virtual HRESULT IKpDatabase::FixGroupTree ( )
pure virtual

Checks and corrects the group tree (level order, etc).

◆ GetBackupGroupName()

virtual LPCTSTR IKpDatabase::GetBackupGroupName ( BOOL  bTranslated)
pure virtual

Get the name of the entry backups group.

Returns
This string is static in KeePass, do not delete it.

◆ GetCustomKvp()

virtual LPCTSTR IKpDatabase::GetCustomKvp ( LPCTSTR  lpKey)
pure virtual

Get a custom key-value pair, these are typically set by plugins to store own data in the database.

Returns
This string is static in KeePass, do not delete it.

◆ GetEncryptionAlgorithm()

virtual INT IKpDatabase::GetEncryptionAlgorithm ( )
pure virtual

◆ GetEntry()

virtual PW_ENTRY* IKpDatabase::GetEntry ( DWORD  dwIndex)
pure virtual

Get an entry (by index).

Returns
The referenced object is managed by KeePass, do not delete the pointer.

◆ GetEntryByGroup()

virtual PW_ENTRY* IKpDatabase::GetEntryByGroup ( DWORD  dwGroupId,
DWORD  dwIndex 
)
pure virtual

Get an entry (by specifying an index of a group).

Returns
The referenced object is managed by KeePass, do not delete the pointer.

◆ GetEntryByGroupN()

virtual DWORD IKpDatabase::GetEntryByGroupN ( DWORD  dwGroupId,
DWORD  dwIndex 
)
pure virtual

◆ GetEntryByUuid()

virtual PW_ENTRY* IKpDatabase::GetEntryByUuid ( const BYTE *  pUuid)
pure virtual

Get an entry (by its UUID).

Returns
The referenced object is managed by KeePass, do not delete the pointer.

◆ GetEntryByUuidN()

virtual DWORD IKpDatabase::GetEntryByUuidN ( const BYTE *  pUuid)
pure virtual

◆ GetEntryCount()

virtual DWORD IKpDatabase::GetEntryCount ( )
pure virtual

Returns the total number of entries in database.

◆ GetEntryCountInGroup()

virtual DWORD IKpDatabase::GetEntryCountInGroup ( LPCTSTR  lpGroup)
pure virtual

Count entries in a group (identified by its name).

◆ GetEntryCountInGroupN()

virtual DWORD IKpDatabase::GetEntryCountInGroupN ( DWORD  dwGroupId)
pure virtual

Count entries in a group (identified by its ID).

◆ GetEntryPosInGroup()

virtual DWORD IKpDatabase::GetEntryPosInGroup ( const PW_ENTRY *  pEntry)
pure virtual

◆ GetGroup()

virtual PW_GROUP* IKpDatabase::GetGroup ( DWORD  dwIndex)
pure virtual

Get a group (by index).

Returns
The referenced object is managed by KeePass, do not delete the pointer.

◆ GetGroupById()

virtual PW_GROUP* IKpDatabase::GetGroupById ( DWORD  dwGroupId)
pure virtual

Get a group (by ID).

Returns
The referenced object is managed by KeePass, do not delete the pointer.

◆ GetGroupByIdN()

virtual DWORD IKpDatabase::GetGroupByIdN ( DWORD  dwGroupId)
pure virtual

◆ GetGroupCount()

virtual DWORD IKpDatabase::GetGroupCount ( )
pure virtual

Returns the total number of groups in database.

◆ GetGroupId()

virtual DWORD IKpDatabase::GetGroupId ( LPCTSTR  lpGroupName)
pure virtual

◆ GetGroupIdByIndex()

virtual DWORD IKpDatabase::GetGroupIdByIndex ( DWORD  dwIndex)
pure virtual

◆ GetGroupTree()

virtual BOOL IKpDatabase::GetGroupTree ( DWORD  dwGroupId,
DWORD *  pvIndices 
)
pure virtual

◆ GetKeyEncRounds()

virtual DWORD IKpDatabase::GetKeyEncRounds ( )
pure virtual

◆ GetLastChildGroup()

virtual DWORD IKpDatabase::GetLastChildGroup ( DWORD  dwParentIndex)
pure virtual

◆ GetLastDatabaseHeader()

virtual const PW_DBHEADER* IKpDatabase::GetLastDatabaseHeader ( )
pure virtual

Get the last used database header.

Returns
The referenced object is managed by KeePass, do not delete the pointer.

◆ GetLastEditedEntry()

virtual PW_ENTRY* IKpDatabase::GetLastEditedEntry ( )
pure virtual

Get the entry that was last modified.

Returns
The referenced object is managed by KeePass, do not delete the pointer.

◆ GetPropertyString()

virtual HRESULT IKpDatabase::GetPropertyString ( DWORD  dwPropertyId,
LPTSTR  lpBuf,
DWORD  dwBufMaxChars 
)
pure virtual

◆ GetRawMasterKey()

virtual HRESULT IKpDatabase::GetRawMasterKey ( BYTE *  pStorage)
pure virtual

◆ InitPrimaryInstance()

virtual HRESULT IKpDatabase::InitPrimaryInstance ( )
pure virtual

Used by KeePass internally, plugins must not call this method.

◆ LockEntryPassword()

virtual HRESULT IKpDatabase::LockEntryPassword ( PW_ENTRY *  pEntry)
pure virtual

In-memory protection: encrypt the password of an entry.

See also
UnlockEntryPassword

◆ MoveEntry()

virtual HRESULT IKpDatabase::MoveEntry ( DWORD  dwGroupId,
DWORD  dwFrom,
DWORD  dwTo 
)
pure virtual

◆ MoveGroup()

virtual BOOL IKpDatabase::MoveGroup ( DWORD  dwFrom,
DWORD  dwTo 
)
pure virtual

◆ MoveGroupEx()

virtual BOOL IKpDatabase::MoveGroupEx ( DWORD  dwFromId,
DWORD  dwToId 
)
pure virtual

◆ MoveGroupExDir()

virtual BOOL IKpDatabase::MoveGroupExDir ( DWORD  dwGroupId,
INT  iDirection 
)
pure virtual

◆ NewDatabase()

virtual HRESULT IKpDatabase::NewDatabase ( )
pure virtual

◆ OpenDatabase()

virtual INT IKpDatabase::OpenDatabase ( LPCTSTR  lpFile,
PWDB_REPAIR_INFO *  pRepair 
)
pure virtual

◆ SaveDatabase()

virtual INT IKpDatabase::SaveDatabase ( LPCTSTR  lpFile,
BYTE *  pWrittenDataHash32 
)
pure virtual

◆ SetCustomKvp()

virtual BOOL IKpDatabase::SetCustomKvp ( LPCTSTR  lpKey,
LPCTSTR  lpValue 
)
pure virtual

Set a custom key-value pair, plugins can use this method to store own data in the database.

◆ SetEncryptionAlgorithm()

virtual BOOL IKpDatabase::SetEncryptionAlgorithm ( INT  nAlgorithm)
pure virtual

◆ SetEntry()

virtual BOOL IKpDatabase::SetEntry ( DWORD  dwIndex,
const PW_ENTRY *  pTemplate 
)
pure virtual

◆ SetGroup()

virtual BOOL IKpDatabase::SetGroup ( DWORD  dwIndex,
const PW_GROUP *  pTemplate 
)
pure virtual

◆ SetKeyEncRounds()

virtual HRESULT IKpDatabase::SetKeyEncRounds ( DWORD  dwRounds)
pure virtual

◆ SetMasterKey()

virtual INT IKpDatabase::SetMasterKey ( LPCTSTR  lpMasterKey,
BOOL  bDiskDrive,
LPCTSTR  lpSecondKey 
)
pure virtual

Set the master key for the database (will be used in the database loading / saving process).

◆ SetPropertyString()

virtual BOOL IKpDatabase::SetPropertyString ( DWORD  dwPropertyId,
LPCTSTR  lpValue 
)
pure virtual

◆ SetRawMasterKey()

virtual HRESULT IKpDatabase::SetRawMasterKey ( const BYTE *  pNewKey)
pure virtual

◆ SortGroup()

virtual HRESULT IKpDatabase::SortGroup ( DWORD  dwGroupId,
DWORD  dwSortByField 
)
pure virtual

◆ SortGroupList()

virtual HRESULT IKpDatabase::SortGroupList ( )
pure virtual

◆ SubstEntryGroupIds()

virtual HRESULT IKpDatabase::SubstEntryGroupIds ( DWORD  dwExistingId,
DWORD  dwNewId 
)
pure virtual

◆ UnlockEntryPassword()

virtual HRESULT IKpDatabase::UnlockEntryPassword ( PW_ENTRY *  pEntry)
pure virtual

In-memory protection: decrypt the password of an entry.

Passwords of all entries are by default encrypted. In order to make them readable, use this method. After you've finished using the password, immediately encrypt it again using the LockEntryPassword method.

See also
LockEntryPassword

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

Documentation generated with Doxygen.





Get KeePass