I set password "1234" and Pack "OK".
Expand|Select|Wrap|Line Numbers
- public int Authentication(string Password){
- if(connectCard()){
- ModWinsCard.SCARD_IO_REQUEST Request;
- Request.dwProtocol = Protocol;
- Request.cbPciLength = System.Runtime.InteropServices.Marshal.SizeOf(typeof(ModWinsCard.SCARD_IO_REQUEST));
- ClearBuffers();
- SendBuff[0] = 0x1B; //PWD_AUTH (See data sheet)
- SendBuff[1] = (byte)Password[0];
- SendBuff[2] = (byte)Password[1];
- SendBuff[3] = (byte)Password[2];
- SendBuff[4] = (byte)Password[3];
- byte[] receivedUID = new byte[256];
- int outBytes = receivedUID.Length;
- int status = ModWinsCard.SCardTransmit(hCard, ref Request, ref SendBuff[0], SendBuff.Length, ref Request, ref receivedUID[0], ref outBytes);
- }
- return status;
- }
I am having trouble finding any examples showing how to do this. Can anyone see what I am doing wrong?