javacard

Eclipse fails to build Java Card sample projects

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 16:07:29
I have installed the new release of Java Card Platform Development Kit, according to the following guide . This includes all the prerequisites, as well as version 3.0.5u2 of JCDK. As a heads up, I tried installing this on 2 different computers (one has Win7, the other Win10) and reinstalled everything on both. The problem I'm encountering is that none of the sample projects will build properly. When I try to build the HelloWorld sample, for example, I get the following text printed in the build console: [ INFO: ] Converter [v3.0.5] [ INFO: ] Copyright (c) 1998, 2017, Oracle and/or its

EMV JavaCard APDU Response in TLV Format

ぃ、小莉子 提交于 2019-12-06 14:53:04
问题 I have a simple JavaCard HelloWorld script, i execute it in JCIDE with virtual reader then i send apdu commands from pyapdutool: 00a404000e aid then 80000000 and i receive javacard string, everything runs fine. My question is: how can i return a tlv format data instead of that response ? I was looking in the emv book 4.3 about this and also on google haven't found a single example to implement emv tlv tags in javacard script. Can someone put me on correct path to understand this ? package

Why I can't receive APDU buffer contents?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 14:52:05
I wrote the following program to return all the APDU buffer contents on reception of each APDU command: package testPack; 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 { if(selectingApplet()){ return; } arg0.setOutgoingAndSend((short)0, (short)255); } } When I send commands though the

read records failed on real smart card

妖精的绣舞 提交于 2019-12-06 14:45:55
I develop an applet which return some simulate bytes data(6 bytes) when it receive Read Records command from host application. I test applet with JCIDE, it work well. I also test it with virtual card reader by using pyApdutool, it work well too. But when I install applet on a card by using pyApdutool, use the same Read Records command, the card return "Unknown error" message. But when I don't set data in respond, the card return "90 00" message. apdu.setOutgoingAndSend((short) 0, (short)0) The applet was installed successful, using pyApdutool can select applet on the card. Here is Read Records

BigInteger subtraction in JavaCard

烂漫一生 提交于 2019-12-06 11:25:01
I am attempting a proof of concept under very constrained technological conditions. My question is: how to efficiently subtract big integers (represented as byte arrays) in a Java Card? . Now, the details are what make the task tricky. I have access to one smart card. The model is Feitian JavaCOS A22 and runs Java Card 2.2. For full detail, Java Card enables the usage of a very restricted subset of the Java API ( namely, no int , no char , and naturally, no BigInteger ), but it does support a series of cryptographic primitives that can be detailed on this list . In particular, my task is to

Update: Personalization of Javacard Applet with GlobalPlatform

孤街醉人 提交于 2019-12-06 11:06:13
问题 From what I've heard, it is common for bigger smart card applets to personalize with global platform. I also found some PDF about personalization with Global Platform, as well as the Javacard API for GP. But I'm somehow missing some information relating both and I haven't found a good documentation on it. How should I organize my Applet to perform GP compatible personalization? Edit: I've read into the documents and have some specific questions, which I hope you can answer shortly. Q1: Guide

Java Card Connecting To a Simulator failed

心不动则不痛 提交于 2019-12-06 10:59:18
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"); try { sckClient.close(); } catch (IOException e1) { e1.printStackTrace(); } return; } My code get

setATRHistBytes() method always returns false

别等时光非礼了梦想. 提交于 2019-12-06 10:41:06
I wrote the following program to change the Historical Bytes in the ATR of my smartcard to, for example, 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 . I use GPSystem.setATRHistBytes() to set the historical bytes. Note that 0x00 0x00 ... 0x00 is not the actual value that I'm using for the historical bytes but I censored it. The actual value is an array of 15 bytes that is equal to the historical bytes of another exisitng card. package org.globalplatform; import javacard.framework.*; import org.globalplatform.GPSystem; public class TestPrj extends Applet { public static final byte[] HIST_B

How do I get CPLC data from a smart card?

佐手、 提交于 2019-12-06 09:01:17
问题 I'm using GPShell on an Ubuntu VM with a smart card reader (the model is ACR122) and I'm using several different NXP SmartMX chips. Using their Android TagInfo app, I'm able to see the "Card Production Lifecycle Data" when I scan one specific SmartMX chip. However, I would like to use GPShell to get the CPLC data as well. I assume it's accessible because I can see it when I scan the tag on the Android device. I have a program called connect.txt , and it has this as the contents: mode_211

SIM Card Authentication

拟墨画扇 提交于 2019-12-06 07:20:28
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: Authenticate. Authentication failed : INITIALIZE UPDATE : unknown response : VOP sw=6D00 And when i try