javacard

How to get JavaCard version on card

核能气质少年 提交于 2019-12-01 05:49:03
问题 How to get java card version from card? Is there any way how to get version of JC from the card. Or should I try to install applets with specific for each JC version options. 回答1: The only full-proof way to determine JavaCard API versions supported by a "white" smart card is to build a separate CAP file for each JavaCard version. I suggest you make each CAP contain just a single simple class extending javacard.framework.Applet . You may want to be able to actually install your simple applet

Differents between SDA and DDA in JavaCard?

 ̄綄美尐妖づ 提交于 2019-12-01 01:56:17
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 mode? What I found out: Update 1 : SDA -- Static Data Authentication DDA -- Dynamic Data Authentication

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

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.

How to get a unique smart card ID?

蓝咒 提交于 2019-11-30 18:11:19
问题 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? 回答1: 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

Create PrivateKey from byte array

可紊 提交于 2019-11-30 14:03:52
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 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 = KeyFactory.getInstance("DSA", "BC"); //for private keys use PKCS8EncodedKeySpec; for public keys use

working with Java Card Wallet

ⅰ亾dé卋堺 提交于 2019-11-30 13:30:25
问题 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

SIM toolkit application - Javacard development kit

被刻印的时光 ゝ 提交于 2019-11-30 12:56:54
问题 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 回答1: The files from 3GPP should be enough to

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

二次信任 提交于 2019-11-30 09:56:58
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_object Util.arrayFillNonAtomic(eempromTempBuffer, (short)0, (byte) (Configuration.LENGTH_RSAOBJECT