Check out how simple adding secondary authentication can be:
Sample Windows® Handler for Verification
This example shows how to use the bioChec Keystroke Biometrics SDK in a normal windows environment to capture a single field for verification. This code snippet assumes a bioChecKey engine has already been instantiated as "bioChecKey myBCK", the window has a message field of IDC_MSG, an entry field of IDC_PASSPHRASE, and a template already loaded into the variable "bpTemplate".
|
LPCTSTR licenseInfo=_T("Populate with a license code ... or NULL for testing");
LPCTSTR debugInfo=_T("Sample Application");
bioChecKey_win32 myBCK(licenseInfo,debugInfo);
|
/* sample to read template from registry */
LPBYTE memoryBuffer = byte stream read from external source;
DWORD nBytes = size of template from external source read;
LPBYTE bpTemplate = myBCK.AllocEmptyTemplate(nBytes);
memcpy(bpTemplate,memoryBuffer,nBytes);
|
BOOL CALLBACK bckVerifyDlgProc
( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
bCkRESULT bpRC = BIOCHEC_OK;
switch (uMsg)
{
case WM_CLOSE:
myBCK.HookStatusMsg(NULL);
myBCK.UnhookAll();
break;
case WM_INITDIALOG:
myBCK.HookField(GetDlgItem(hwndDlg,IDC_PASSPHRASE),_T("Passphrase"));
myBCK.setFieldLen(_T("Passphrase"),8,32);
SetDlgItemText(hwndDlg,IDC_PASSPHRASE,_T(""));
myBCK.HookStatusMsg(GetDlgItem(hwndDlg,IDC_MSG));
SetFocus(GetDlgItem(hwndDlg, IDC_PASSPHRASE));
return FALSE;
case WM_COMMAND:
if (wParam==IDOK)
{
myBCK.HookStatusMsg(NULL);
SetFocus(GetDlgItem(hwndDlg,IDOK)); // necessary for bioChecKey
bpRC = myBCK.StoreSample();
if ( bpRC == BIOCHEC_OK )
{
LPBYTE bpSignature = myBCK.CreateSignature();
if ( bpSignature )
{
double dScore = myBCK.VerifySignature(bpSignature,bpTemplate);
myBCK.FreeSignature(bpSignature);
int iMin = 0;
bpRC = myBCK.getLastError();
if ( bpRC == BIOCHEC_OK )
{
iMin = myBCK.iConvertToScale(10,dScore,BCK_DEFAULT_THRESHOLD);
if ( iMin >= 3 /*bioMinStrength*/ )
{
/* ... do something nice here ... */
EndDialog(hwndDlg,IDOK);
return(TRUE);
}
}
}
}
myBCK.resetFields();
SetDlgItemText(hwndDlg,IDC_PASSPHRASE,_T(""));
SetFocus(GetDlgItem(hwndDlg,IDC_PASSPHRASE));
myBCK.HookStatusMsg(GetDlgItem(hwndDlg,IDC_MSG));
return(TRUE);
} // if (wParam==IDOK)
return TRUE;
} // switch (uMsg)
return FALSE;
}
|
Site Map | Contact
|