smartcard

how to write and read data from smart card using java card apdu

怎甘沉沦 提交于 2019-12-01 11:48:15
问题 I have written an applet and installed it in smart card. But I don't know how to read and write data to smart card? private void readName(APDU apdu) throws ISOException { byte[] apduBuffer = apdu.getBuffer(); for (byte i=0; i<userName.length; i++) { apduBuffer[5+i] = userName[(byte)i] ; } apdu.setOutgoing(); apdu.setOutgoingLength((short)userName.length); apdu.sendBytes((short)5, (short)userName.length); } Is it right code to read data from smart card? please tell me how to write data to

Frequent Disconnection ACR122U NFC Reader

冷暖自知 提交于 2019-12-01 11:07:43
问题 When I put SIII (Android 4.3) on ACR122U NFC reader the LED keeps blinking green. When I put Samsung S4 (Android 4.3) LED turns green till the time phone is on the reader. In both the cases NFC is turned on and device is in unlocked state. This behaviour translates into frequent disconnections in SIII and a stable connection on S4. Why two phones behave differently? I am aware of the fact that two phones have NFC chipsets from two different vendors namely NXP and Broadcom. My question is what

RFID reader integration with web page [closed]

大城市里の小女人 提交于 2019-12-01 09:52:36
I have a problem regarding RFID card reader integration to a web page. I found out that the solution is to achieve this ActiveX component and java script. so, my question is that how can we build a ActiveX component for card reader and the java script Codeline to access this activex Component. Or if you can suggest an alternate way to integrate RFID reader to communicate directly with a web page, that would be great. SpringCard provides a technical guide and a live demo for developing a web page communicating with a PC/SC reader using Java applet. You will find it at the page, under Other

Mifare authentication

杀马特。学长 韩版系。学妹 提交于 2019-12-01 08:24:55
Say I want to authenticate to Mifare Classic. How do I know the exact kind of APDU to send to the card? Example. This code: bcla = 0xFF; bins = 0x86; bp1 = 0x0; bp2 = 0x0; // currentBlock len = 0x5; sendBuffer[0] = bcla; sendBuffer[1] = bins; sendBuffer[2] = bp1; sendBuffer[3] = bp2; sendBuffer[4] = len; sendBuffer[5] = 0x1; // Version sendBuffer[6] = 0x0; // Address MSB sendBuffer[7] = currentBlock; if(keyradioButton->Checked==true) // Address LSB sendBuffer[8] = 0x60; // Key Type A else if(keynumberradioButton->Checked ==true) sendBuffer[8] = 0x61; // Key Type B sendBuffer[9] = keynumber; //

Mifare authentication

南楼画角 提交于 2019-12-01 07:06:06
问题 Say I want to authenticate to Mifare Classic. How do I know the exact kind of APDU to send to the card? Example. This code: bcla = 0xFF; bins = 0x86; bp1 = 0x0; bp2 = 0x0; // currentBlock len = 0x5; sendBuffer[0] = bcla; sendBuffer[1] = bins; sendBuffer[2] = bp1; sendBuffer[3] = bp2; sendBuffer[4] = len; sendBuffer[5] = 0x1; // Version sendBuffer[6] = 0x0; // Address MSB sendBuffer[7] = currentBlock; if(keyradioButton->Checked==true) // Address LSB sendBuffer[8] = 0x60; // Key Type A else if

Read write data in SLE4442 smart card with java commandAPDU?

醉酒当歌 提交于 2019-12-01 02:00:51
I want to read and write data in SLE4442 smart card i have ACR38U-i1 smart card reader For write I am use this commandAPDU byte[] cmdApduPutCardUid = new byte[]{(byte)0xFF, (byte)0xD0, (byte)0x40,(byte)0x00, (byte)4,(byte)6,(byte)2,(byte)6,(byte)2}; And for read data byte[] cmdApduGetCardUid = new byte[]{(byte)0xFF,(byte)0xB0,(byte)0x40,(byte)0x00,(byte)0xFF}; both are execute and send SW= 9000 but no one data receive in responseAPDU Like I write 6262 data but it not receive I am also use Select command to before write and read command The select command is byte[] cmdApduSlcCardUid = new byte[

Transmission error for T=0 JavaCards

筅森魡賤 提交于 2019-12-01 01:27:19
I have 4 different types of JavaCards. For a weird purpose, I wrote the following applet to return whole the APDU buffer on reception of each APDU command: package bufferReturner; import javacard.framework.APDU; import javacard.framework.Applet; import javacard.framework.ISOException; public class BufferReturner extends Applet { private BufferReturner() { } public static void install(byte bArray[], short bOffset, byte bLength) throws ISOException { new BufferReturner().register(); } public void process(APDU arg0) throws ISOException { arg0.setOutgoingAndSend((short)0, (short)256); } } When I

SmartCardIO EMV Reader, find my card type with only the ATR number

社会主义新天地 提交于 2019-12-01 01:09:13
I´m starting a new project, I´m new using EMV reader and Javax SmartCardIO. I have the list of the RID for each type of card, however the only thing I can access without knowing the type of card is the ATR, I´m wondering if there is a way to get the RID or the card type with only this info, any help is welcome. Thanks in advance! EDIT: I tried to execute the select PSE command with this method: public static byte[] selectPSE(CardChannel channel) throws CardException { byte[] selectPSE = {(byte)0x00, (byte)0xA4, (byte)0x04, (byte)0x00, (byte)0x0E, (byte)0x31, (byte)0x50, (byte)0x41, (byte)0x59,

Reading big file from a javacard applet

自古美人都是妖i 提交于 2019-12-01 00:43:17
I am writing an applet that stores 3 files of different sizes 5 Kb, 7 Kb and 11 Kb. I have got no problems with storing the files inside the applet. But when I try to read them back, I can only read the first two (smaller files). The third file throws an exception: javax.smartcardio.CardException: Could not obtain response at sun.security.smartcardio.ChannelImpl.doTransmit(Unknown Source) at sun.security.smartcardio.ChannelImpl.transmit(Unknown Source) I have tried to figure out the problem and I have found out it has to do with the size of the file. So I created a test file of size 7 Kb and

How to get a unique smart card ID?

 ̄綄美尐妖づ 提交于 2019-12-01 00:13:20
I'm searching for a way to find a unique number for every smart card I work with. I have heard there are IC Fabrication date, IC Serial Number and IC Batch Identifier that are unique for every card. how can I get these information from my card? guidot Surely every hardware supplier integrates information like the mentioned into the chip. This unfortunately leaves the following problems: The information may or may not be made available by the operating system There is little in common between several hardware suppliers beneath the one byte manufacturer ID, which is maintained globally (see e.g.