javacard

APDU read file java card program

☆樱花仙子☆ 提交于 2019-12-08 07:33:35
问题 i made java card classic applet using netbeans when i program the read operation i check for the first byte in the APDU to be 0x80 then the second to be 0xB0 then take the offset that i will read from in the file from the byte 2 and 3 then take the number of bytes to be read from byte 4 to be the APDU as the default one 0x80 0xB0 0x00 0x03 0x60 this read 60 bytes from the current file starting by offset number 3 when i try this command it returned error Input data length != Lc around line 12

Loading a .cap file onto a smart card: LOAD failed SW 69 85

。_饼干妹妹 提交于 2019-12-08 05:11:19
问题 I am having trouble loading the .cap file onto the smart card, its just a basic hello world program. I keep getting LOAD failed SW 69 85 as an error. Ive tried loading the .cap using gp and gpj. From the reading I've done it seems to be some security issue. I am still able to view the apps and delete it off the card, so the card is not locked yet. I'm just a beginner at this so help would be really appreciated. Here is the output from gpj: Found card in terminal: OMNIKEY Smart Card Reader USB

SIM Card Authentication

六眼飞鱼酱① 提交于 2019-12-08 02:15:19
问题 I'm new to SIM Cards and I'm trying to authenticate to a SIM Card using Gemalto JCardManager (part of Gemalto Developer Suite), with Gemplus USB SmartCard Reader. Aparently, i have all the necessary keys (kic, kid and kik), but i can't authenticate. In fact, i have two SIM's: one SIM Card R5 and one USIM Card R5. I have configured the keys files for both of them, but when i try to authenticate to the SIM Card R5, the following message appears: [ERROR ] <- 6D 00 Command Exception on command:

Java Card Connecting To a Simulator failed

喜你入骨 提交于 2019-12-08 01:22:53
问题 I am trying to test a Java Card applet to establish a connection to a simulator such as cref: try { sckClient = new Socket("localhost", 9025); InputStream is = sckClient.getInputStream(); OutputStream os = sckClient.getOutputStream(); cad = CadDevice.getCadClientInstance(CadDevice.PROTOCOL_T0, is, os); } catch (Exception e) { System.out.println("error"); return; } try { cad.powerUp(); } catch (IOException e) { e.printStackTrace(); } catch (CadTransportException e) { System.out.println("error"

How to Reset java card using APDU command

非 Y 不嫁゛ 提交于 2019-12-07 22:32:28
问题 I am new to java card development.so far i have developed java card applet which can encrypt data using RSA algorithm. So basically i followed Application selection and send data.But now i want to reset java card before selecting the java card.Can anyone give me some brief idea how to do that??thanks Sajith. 回答1: There is no such thing as a RESET APDU command. Generally speaking, you can reset using a lower level API (which may not be available to you) or by disconnecting the card entirely.

Opening a secure connection with Java Card and Global Platform

丶灬走出姿态 提交于 2019-12-07 17:31:07
问题 After succeeding with Java Card development on emulators now I'm dealing with a real Java Card (Gemalto IDCore 3010). I have been experiencing with the Global Platform, but I have problems even with the most basic sample code, that would list the applets on the card. This is the original code: mode_201 enable_trace establish_context card_connect select -AID a0000000030000 open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key

Access an applet directly without AID selection

左心房为你撑大大i 提交于 2019-12-07 11:55:31
问题 Usually, when you power up a JavaCard smartcard and want to communicate with an applet, you must select the applet using its AID first. Is there any way to have a "default applet" that is selected when the card is powered up? What I really want to do is be able to send my application level APDUs immediately upon selecting the card and not need to go through the application selection process. Is this possible? If so, how? 回答1: If your Java Card smartcard implements the Global Platform Card

Fast way to convert byte[] to short[] on Java Card

泪湿孤枕 提交于 2019-12-07 09:14:56
问题 I want to optimize SHA-3 algorithm on a Java Card. I need a fast algorithm consuming less memory which allows to easy convert byte[] to short[] (or short [] to byte[] ). My current implementation looks like this: private short[] byteToShort(byte[] b,int len) { short len_conv = (short)(len/2); for ( short x = 0; x < len_conv;x++) { for ( short j = 0 ; j < 2 ; j++) aux[j] = b[2*x+j]; temp_conv[x] = (short)((((short)aux[1]) & 0xFF) | ((((short)(aux[0]) & 0xFF) << 8 ))); } return temp_conv; }

Store symmetric keys in Java Card

ⅰ亾dé卋堺 提交于 2019-12-07 06:10:30
I am working on an applet which has to share some keys of type AESKey with different terminals. The thing is I don't know in advance how many terminals it will have to handle. As there is no structure like HashTable in Java Card, it's getting complicated. I can still fix an upper bound and instanciate as much objects AESKey but I would like to search for another way to do. I thought I could do something with byte arrays, but is it a bad practice to store keys in byte[] ? I think the answer is yes and it is only recommanded to store it in transient arrays to make computations. Otherwise, I don

Loading a .cap file onto a smart card: LOAD failed SW 69 85

我的梦境 提交于 2019-12-06 21:34:25
I am having trouble loading the .cap file onto the smart card, its just a basic hello world program. I keep getting LOAD failed SW 69 85 as an error. Ive tried loading the .cap using gp and gpj. From the reading I've done it seems to be some security issue. I am still able to view the apps and delete it off the card, so the card is not locked yet. I'm just a beginner at this so help would be really appreciated. Here is the output from gpj: Found card in terminal: OMNIKEY Smart Card Reader USB 0 ATR: 3B 68 00 00 00 73 C8 40 11 00 90 00 DEBUG: Command APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00