javacard

Why applet conversion failed in case of using Shareable interface? (How to use Export files in such cases)

早过忘川 提交于 2019-12-20 05:27:09
问题 I wrote two java card applet named MasterApp and SlaveApp that are in two different packages named masterPack and slavePack : Master AIDs : Package : 01 02 03 04 01 Applet : 01 02 03 04 01 01 Slave AIDs : Package : 01 02 03 04 02 Applet : 01 02 03 04 02 02 As you see below I want to call SharedMethod() of the MasterApp in the Process() method of my SlaveApp : Master Program : package masterPack; import javacard.framework.APDU; import javacard.framework.Applet; import javacard.framework

Math library for JavaCard?

随声附和 提交于 2019-12-19 10:46:33
问题 I'm currently working on a JavaCard project (v.2.2.2) and I need to compute values using square roots, logarithms, etc... I know that the Math class isn't available in JavaCard API and wonder if there exists another library which provides such operations ? And also I can't use double values but I need to. Is there a way to represent a double value in the JavaCard API and perform operation (such as log, sqrt, etc..) ? Any help appreciated ! 回答1: The javacard 2.2.2 only supports boolean, byte,

Process method does not receive full APDU command from host?

◇◆丶佛笑我妖孽 提交于 2019-12-19 09:53:52
问题 The host sends the following command to applet to select EF file 00 A4 02 00 02 40 01 The purpose is to select EF file with ID 40 01 (which is specified in the data field of the command). But when I debug the process(APDU apdu) method, the APDU buffer only contains the 5 first bytes 00 A4 02 00 02 . The data field is set to 00 00 . So my applet cannot select the EF using EF ID. Could you tell me what is wrong with my APDU command above? 回答1: Depending on the card (or emulator), the APDU

Differents between SDA and DDA in JavaCard?

瘦欲@ 提交于 2019-12-19 04:59:47
问题 I have an applet (you can take a look at it there JavaCard applet is not working with RSA encryption). Applet generates RSA public and private keys in constructor and with APDU command encrypt some byte array. Applet generates public and private keys with KeyBuilder.LENGTH_RSA_2048 in docs provided with cards sad that JavaCard supports 2048 bits key length only in DDA. So question is what is DDA and SDA. Differences between them? And main question is: how to install (or run?) applet in this

Differents between SDA and DDA in JavaCard?

非 Y 不嫁゛ 提交于 2019-12-19 04:59:11
问题 I have an applet (you can take a look at it there JavaCard applet is not working with RSA encryption). Applet generates RSA public and private keys in constructor and with APDU command encrypt some byte array. Applet generates public and private keys with KeyBuilder.LENGTH_RSA_2048 in docs provided with cards sad that JavaCard supports 2048 bits key length only in DDA. So question is what is DDA and SDA. Differences between them? And main question is: how to install (or run?) applet in this

Reading big file from a javacard applet

你。 提交于 2019-12-19 04:16:34
问题 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

Transmission error for T=0 JavaCards

梦想与她 提交于 2019-12-19 04:14:08
问题 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

Verify javacard signature ALG_ECDSA_SHA on bouncy castle

跟風遠走 提交于 2019-12-19 04:05:50
问题 My problem looks like this: im generating a signature on javaCard (jcdk 2.2.2) and when when i want to verify it on the terminal using BouncyCastle the signature isnt always verified- 1 in 3,66 (average in 100 tries) signatures are verified, the rest in returning false. when i verify the signature on the card it always returns true, but on the terminal it usually returns false, but sometimes true. because the terminal sometimes gives a positive answer i think that the code is ok and the

Using RSA for modulo-multiplication leads to error on Java Card

ⅰ亾dé卋堺 提交于 2019-12-18 13:31:31
问题 Hello I'm working on a project on Java Card which implies a lot of modulo-multiplication. I managed to implement an modulo-multiplication on this platform using RSA cryptosystem but it seems to work for certain numbers. public byte[] modMultiply(byte[] x, short xOffset, short xLength, byte[] y, short yOffset, short yLength, short tempOutoffset) { //copy x value to temporary rambuffer Util.arrayCopy(x, xOffset, tempBuffer, tempOutoffset, xLength); // copy the y value to match th size of rsa

Symptoms of EEPROM damage

こ雲淡風輕ζ 提交于 2019-12-18 12:39:12
问题 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