Работа с паролем.
BOOL VerifyPIN(LPBYTE lpPIN)
{
LPSC_COMMAND_RECORD lpCommand;
WORD wStatus = sizeof(SC_COMMAND_HEADER);
RESULTCODE bRet = FALSE;
if( lpPIN == NULL )
return FALSE;
lpCommand = (LPSC_COMMAND_RECORD)new BYTE[sizeof(SC_COMMAND_HEADER) + 8];
if( lpCommand != NULL )
{
lpCommand->scHeader.bCla = 0xc0;
lpCommand->scHeader.bIns = 0x20;
lpCommand->scHeader.bP1 = 0x00;
lpCommand->scHeader.bP2 = 0x01;
lpCommand->scHeader.bP3 = 0x08;
memcpy( lpCommand->szData,lpPIN,8 );
if( Send( (LPBYTE)lpCommand,sizeof(SC_COMMAND_HEADER) + SLB_PIN_LEN,wStatus ) )
{
if( wStatus == 0x0090 )
bRet = TRUE;
}
delete lpCommand;
}
return bRet;
}