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