User`s guide
IBM Lotus Notes, Domino, Domino Designer 8 Release Notes
Here is some pseudocode to demonstrate the use of SECManipulateSC. As always, real code should
check for and handle errors.
error = SECManipulateSC (SC_manip_GetVersion,
NULLSCMCTX,
NULL,
&Version,
NULL);
/* SC_manip_PushKyrKey was added in Version 5 of this interface. If Version is
not at least 5, then that operation will fail. */
/* Initialize the PKCS#11 context.
*/
SCMCTX Context = NULLSCMCTX;
error = SECManipulateSC (SC_manip_InitializeContext,
&Context,
NULL, NULL, NULL);
/* Set up the server's ID file
*/
error = SECManipulateSC (SC_manip_EnterIDFile,
&Context,
NULL,
&dwIDLen,
ServerIDPath);
/* Unlock the smartcard
*/
error = SECManipulateSC (SC_manip_EnterPIN,
&Context,
NULL,
&dwPINLen,
PIN);
/* Note -- SC_manip_EnterPIN will use an external authentication path if it
exists. If the token doesn't support a protected authentication path,
SC_manip_EnterPIN will use the supplied PIN if one exists or generate a prompt
if a NULL or zero-length PIN was used. */
/* Smartcard-enable the server's ID file
*/
error = SECManipulateSC (SC_manip_SCEnableID,
&Context,
NULL,
&dwPwdLen,
ServerIDPwd);
/* Push the keyring private key to the token
*/
if (Version >= 5)
error = SECManipulateSC (SC_manip_PushKyrKey,
&Context,
NULL,
&dwKyrLen,
KyrPath);
100