michael@0: /* michael@0: * private.h - Private data structures for the software token library michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef _KEYDBI_H_ michael@0: #define _KEYDBI_H_ michael@0: michael@0: #include "nspr.h" michael@0: #include "seccomon.h" michael@0: #include "mcom_db.h" michael@0: michael@0: /* michael@0: * Handle structure for open key databases michael@0: */ michael@0: struct NSSLOWKEYDBHandleStr { michael@0: DB *db; michael@0: DB *updatedb; /* used when updating an old version */ michael@0: SECItem *global_salt; /* password hashing salt for this db */ michael@0: int version; /* version of the database */ michael@0: char *appname; /* multiaccess app name */ michael@0: char *dbname; /* name of the openned DB */ michael@0: PRBool readOnly; /* is the DB read only */ michael@0: PRLock *lock; michael@0: PRInt32 ref; /* reference count */ michael@0: }; michael@0: michael@0: /* michael@0: ** Typedef for callback for traversing key database. michael@0: ** "key" is the key used to index the data in the database (nickname) michael@0: ** "data" is the key data michael@0: ** "pdata" is the user's data michael@0: */ michael@0: typedef SECStatus (* NSSLOWKEYTraverseKeysFunc)(DBT *key, DBT *data, void *pdata); michael@0: michael@0: michael@0: SEC_BEGIN_PROTOS michael@0: michael@0: /* michael@0: ** Traverse the entire key database, and pass the nicknames and keys to a michael@0: ** user supplied function. michael@0: ** "f" is the user function to call for each key michael@0: ** "udata" is the user's data, which is passed through to "f" michael@0: */ michael@0: extern SECStatus nsslowkey_TraverseKeys(NSSLOWKEYDBHandle *handle, michael@0: NSSLOWKEYTraverseKeysFunc f, michael@0: void *udata); michael@0: michael@0: SEC_END_PROTOS michael@0: michael@0: #endif /* _KEYDBI_H_ */