FC_InitToken()
- initialize or re-initialize a token.
CK_RV FC_InitToken( CK_SLOT_ID slotID, CK_CHAR_PTR pPin, CK_ULONG ulPinLen, CK_CHAR_PTR pLabel );
FC_InitToken()
has the following parameters:
slotID
pPin
ulPinLen
pLabel
FC_InitToken()
initializes a brand new token or re-initializes a token that was initialized before.
Specifically, FC_InitToken()
initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (User certs are the certificates that have their associated private keys in the key database.)
A user must be able to call FC_InitToken()
without logging into the token (to assume the NSS User role) because either the user's password hasn't been set yet or the user forgets the password and needs to blow away the password-encrypted private key database and start over.
Note: The SO password should be the empty string, i.e., ulPinLen
argument should be 0. FC_InitToken()
ignores the pLabel
argument.
FC_InitToken()
returns the following return codes.
CKR_OK
: token initialization succeeded.
CKR_SLOT_ID_INVALID
: slot ID is invalid.
CKR_TOKEN_WRITE_PROTECTED
CKR_DEVICE_ERROR
: failed to reset the key database.
FC_InitToken()
is used to reset the password for the key database when the user forgets the password.
FC_InitToken()
.
certutil
calls FC_InitToken()
.