Name

NSS_Initialize - initialize NSS.

Syntax

SECStatus NSS_Initialize(const char *configdir,
                         const char *certPrefix,
                         const char *keyPrefix,
                         const char *secmodName,
                         PRUint32 flags);

Parameters

NSS_Initialize has five parameters:

configdir
[in] the directory where the certificate, key, and module databases live. To-do: document the "sql:" prefix.
certPrefix
[in] prefix added to the beginning of the certificate database, for example, "https-server1-".
keyPrefix
[in] prefix added to the beginning of the key database, for example, "https-server1-".
secmodName
[in] name of the security module database, usually "secmod.db".
flags
[in] bit flags that specify how NSS should be initialized.

Description

NSS_Initialize initializes NSS. It is more flexible than NSS_Init, NSS_InitReadWrite, and NSS_NoDB_Init. If any of those simpler NSS initialization functions suffices for your needs, call that instead.

The flags parameter is a bitwise OR of the following flags:

Return value

NSS_Initialize returns SECSuccess on success, or SECFailure on failure.

Examples

#include <nss.h>

SECStatus rv;
const char *configdir;

configdir = ...;  /* application-specific */
rv = NSS_Initialize(configdir, "", "", SECMOD_DB, NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE);

See also