439
edits
(→FAQ) |
|||
| Line 43: | Line 43: | ||
3. NSS_ShutdownContext() can be called once per context. If NSS_ShutdownContext is called a second time on the same context, an error is returned. NSS_ShutdownContext() will shut down NSS if there are no more active contexts returned by NSS_InitContext() and NSS_Init() has not been called. | 3. NSS_ShutdownContext() can be called once per context. If NSS_ShutdownContext is called a second time on the same context, an error is returned. NSS_ShutdownContext() will shut down NSS if there are no more active contexts returned by NSS_InitContext() and NSS_Init() has not been called. | ||
4. An application that initialized NSS with NSS_Init() can call NSS_LibraryShutdown() with NULL. This will close out the NSS_Init() call, but will only shutdown NSS if all the active contexts are also closed. | 4. An application that initialized NSS with NSS_Init() can call NSS_LibraryShutdown() with NULL. This will close out the NSS_Init() call, but will only shutdown NSS if all the active contexts are also closed. (Note that NSS_Init() is still idempotent. This means that multiple calls to NSS_Init() before an NSS_Shutdown or and NSS_LibraryShutdown will still only result in a single NSS_Init call as far as shutdowns are concerned). | ||
5. NSS_Shutdown() will operate as it does today. NSS will completely shutdown, all active contexts will be closed. | |||
Signature for the new functions: | Signature for the new functions: | ||
typedef struct NSSInitContextStr NSSInitContext; /* opaque */ | typedef struct NSSInitContextStr NSSInitContext; /* opaque */ | ||
typedef struct NSSInitStringStr NSSInitString; | |||
struct NSSInitStringStr { | |||
int len; /* must be set to the length of NSSInitString. future versions. | |||
* of NSS may allow longer versions of this context, but need to | |||
* work with existing apps. */ | |||
PRBool passwordRequired; | |||
int minimumPasswordLength; | |||
char * manufactureID; /* variable names for strings match the */ | |||
char * libraryDescription; /* parameter name in softoken */ | |||
char * cryptoTokenDescription; | |||
char * dbTokenDescription; | |||
char * FIPSTokenDescription; | |||
char * cryptoSlotDescription; | |||
char * dbSlotDescription; | |||
char * FIPSSlotDescription; | |||
}; | |||
NSSInitContext *NSS_InitContext(const char *configdir, | NSSInitContext *NSS_InitContext(const char *configdir, | ||
const char *certPrefix, const char *keyPrefix, | const char *certPrefix, const char *keyPrefix, | ||
const char *secmodName, PRUint32 flags); | const char *secmodName, NSSInitStrings *initStrings, PRUint32 flags); | ||
SECStatus NSS_ShutdownContext(NSSInitContext *); | SECStatus NSS_ShutdownContext(NSSInitContext *); | ||
| Line 67: | Line 83: | ||
#Application calls NSS_Init(). NSS_Init uses configdir to decide what PKCS #11 modules to load and what databases softoken opens. | #Application calls NSS_Init(). NSS_Init uses configdir to decide what PKCS #11 modules to load and what databases softoken opens. | ||
#Library then calls NSS_Init(). Library ends up using whatever application already | #Library then calls NSS_Init(). Library ends up using whatever application already opened (in general, this ok, it make sense the the application controls what databases are used by all libraries it uses). | ||
#*at this point only the application specified databases are open | #*at this point only the application specified databases are open | ||
#Library noticed that NSS was initializied already and does not call shutdown (hopefully). | #Library noticed that NSS was initializied already and does not call shutdown (hopefully). | ||
edits