javacard

How to send commands to smart card reader (and not to the smart card) while no card present?

此生再无相见时 提交于 2019-11-30 08:20:34
Preface: I have a dual interface smart card reader that has some extended capabilities (other than sending APDU commands to card and receiving APDU responses). For example in its document it is mentioned that you can get firmware version of your reader using following command: GET_FIRMWARE_VERSION: FF 69 44 42 05 68 92 00 05 00 In its tool, there is a button for this function and it works fine: I even sniffed USB port to see what exactly exchanged in the connection between my PC and my reader for this function: Command: Response: Problem: I want to get my reader version (and maybe send other

Symptoms of EEPROM damage

给你一囗甜甜゛ 提交于 2019-11-30 07:59:34
Suppose there is a bug in a Java Card applet: a temporary byte array is stored in EEPROM instead of RAM. Moreover, suppose this byte array is overwritten with each APDU. This bug should damage the card sooner or later. What symptoms could we expect? Incorrect values in the array without any explicit warnings or errors? Some exceptions thrown when accessing this array? The applet unselectable? The whole card completely unresponsive? Should the card be damaged "once and forever", or will these failures occur more and more often? In my experiment (J2E145) there was the first failure after 5 000

working with Java Card Wallet

故事扮演 提交于 2019-11-30 07:37:46
I am a java card beginner, The copied the code below from a sample. somehow, i have been able how part of the code works. But still confused about the following. .The way the ownerpin works and how and when the pin is set . How to make the credit and debit works i understand how the balance works and that aspect is prety ok. Below is the code wallet.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package classicapplet1; import javacard.framework.APDU; import javacard.framework.Applet; import javacard.framework.ISO7816; import javacard

SIM toolkit application - Javacard development kit

痞子三分冷 提交于 2019-11-30 04:29:32
I'm trying to develop a STK application but I don't know where to get the development kit. Right now for Javacard I'm getting the one from Oracle's website, but it doesn't have the sim.toolkit package. I don't want to buy it from Gemalto, etc. Is there any "free" implementation? I have found the ETSI - 3GPP a zip file with some code and libraries, but I don't know if this would be enough. Do I generate the cap/jar file from the code there? Thanks The files from 3GPP should be enough to complement the Javacard libraries that you've downloaded from Oracle. Just as you need to know the Javacard

SIMPLE-TLV vs BER-TLV

一曲冷凌霜 提交于 2019-11-29 21:49:20
I have found in docs they are referring to SIMPLE-TLV and BER-TLV . I was look into most of the EMV and GP docs but they have not mentioned the different. Could anyone help me to understand the difference of two ? Data fields in ISO/IEC 7816-4 for smart cards BER encoding This is the specification of the more common BER encoding used by ISO/IEC 7816-4: Each BER-TLV data object shall consists of 2 or 3 consecutive fields (see ISO/IEC 8825 and annex D). The tag field T consists of one or more consecutive bytes. It encodes a class, a type and a number. The length field consists of one or more

Create PrivateKey from byte array

落爺英雄遲暮 提交于 2019-11-29 19:28:19
问题 Is there a way to generate PrivateKey from byte array? I got this byte array using getEncoded() method, but now I have to convert it back to PrivateKey. Thanks, Vuk 回答1: I was looking for this answer too and finally found it. keyBytes is a byte array originally created with getEncoded(). //add BouncyCastle as a provider if you want Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); //create a keyfactory - use whichever algorithm and provider KeyFactory kf =

How to send commands to smart card reader (and not to the smart card) while no card present?

我是研究僧i 提交于 2019-11-29 11:31:04
问题 Preface: I have a dual interface smart card reader that has some extended capabilities (other than sending APDU commands to card and receiving APDU responses). For example in its document it is mentioned that you can get firmware version of your reader using following command: GET_FIRMWARE_VERSION: FF 69 44 42 05 68 92 00 05 00 In its tool, there is a button for this function and it works fine: I even sniffed USB port to see what exactly exchanged in the connection between my PC and my reader

Java Card DES generator applet output is different from online-tools output

試著忘記壹切 提交于 2019-11-29 08:13:10
The below applet is written to do a DES encryption/Decryption on the APDU data field : package cryptoPack; import javacard.framework.APDU; import javacard.framework.Applet; import javacard.framework.ISO7816; import javacard.framework.ISOException; import javacard.framework.JCSystem; import javacard.framework.Util; import javacard.security.CryptoException; import javacard.security.DESKey; import javacard.security.KeyBuilder; import javacardx.crypto.Cipher; public class CryptoDES extends Applet { // Array for the encryption/decryption key private byte[] TheDES_Key = { (byte) 0x00, (byte) 0x00,

Failed to send Extended APDU

坚强是说给别人听的谎言 提交于 2019-11-29 05:20:51
I have a big byte array (it's 320 bytes) on my Java Card and I want to send its data in one APDU response. So, I implemented ExtendedLength interface in my applet and then used the following program: package exPack; import javacard.framework.*; import javacardx.apdu.ExtendedLength; public class testExtended extends Applet implements ExtendedLength { byte[] longData = {(byte) 0x00, (byte) 0x10, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x00, (byte) 0x10, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte)

Javacards IDE, and JCOP tools for eclipse unavailable to download

删除回忆录丶 提交于 2019-11-29 05:11:39
I'm starting to develop in JavaCard (more specifically JavaCard 2.2.2). I'm searching for tools to develop in JavaCard. I want an IDE that incorporates both an emulator and a debugger. The eclipse plugin JCOP tools from IBM seems to do that, but for some reason I can't find it online. Some forums point to the link http://www.zurich.ibm.com/jcop/download/eclipse/ , but this link no longer works... Anyone knows what's going on? Have JCOP tools been discontinued? If so, can anyone suggest another IDE capable of those features? JCOP tools is no longer maintained by IBM. All support activities