javacard

Difference between contact card and contactless(RF) card

让人想犯罪 __ 提交于 2020-07-09 11:36:05
问题 I want to know the difference between contact card and contactless(RF) card in terms of APDU command/response, implementation and so on. I'm implementing an applet using combi card. I thought that regardless of contact interface or contactless(RF) interface, an applet returns the same response APDU for a command but it doesn't seem like that. I have no idea about that. (I implemented an applet for the only RF interface or for the only contact interface before, not for both.) Is it possible to

'6985 Conditions of use not satisfied' while sending APDU command to javacard

蓝咒 提交于 2020-04-16 04:26:11
问题 I'm sending below command to javacard but I'm getting this error Env: android app running on galaxy s3 over nfc 6985 Conditions of use not satisfied It would be nice if you let me know what would be cause of this error. byte[] APDU_Command = new byte[]{ (byte)0x80,//CLA (byte)0xD0,//INS (byte)0x01,//P1 (byte)0x00,//P2 //Length (byte)0x21,//Lc //id (byte)31, (byte)32, (byte)33, (byte)34, //number (byte)33, (byte)35, (byte)31, (byte)36, (byte)39, (byte)38, (byte)30, (byte)35, (byte)37, (byte)37

How to sign using ECDSA in Javacard

浪尽此生 提交于 2020-02-25 07:44:20
问题 I'm trying to implement the signing code using ECDSA. But I always get a Error SW (6F00) during install phase. I tried by changing parameters several times. (ex. ALG_EC_FP / ALG_EC_F2M, LENGTH_EC_FP_xxx / LENGTH_EC_F2M_xxx) Could you tell me my mistake in my code below. (Ver - JCDK 2.2.1, JDK 1.4.2) package Test; import javacard.framework.*; import javacard.security.*; import javacardx.crypto.*; public class Test extends Applet{ private byte[] PLAINTEXT ; private ECPrivateKey objECDSAPriKey

Javacard Shareable Interface: lookupAID returns AID but getAppletShareableInterface returns null

安稳与你 提交于 2020-01-21 13:56:27
问题 edit 2: Found the mistake. I tried to initialize the Shareable object in the constructor. At that time the client's register method is not yet called, so the JCRE doesn't have its AID. While my server's getShareableInterfaceObject(AID clientaid, byte parameter) method doesn't require the client's AID to be != null the JCRE probably does, since it calls this method for my client. I now initialize my Shareable object when I process my first APDU and it now works. And btw, thank you owlstead for

Java Card 2.2.1 Application with Eclipse

自作多情 提交于 2020-01-17 03:43:40
问题 I want to develop an applet for Java Card 2.2.1 using Eclipse and SDK Java Card kit. I am unable to set up Java Card 2.2.1 in Eclipse; It's okay when I use Java Card 2.2.2. How can I set up Java card 2.2.1 in Eclipse? Eclipse Version 4.4.2 JRE 1.8.0 回答1: I had the same problem, It's a little tricky to solve it. Keep Eclipse open, minimize it and then explore the JCDK direcory in your computer and replace JCDK2.2.2 contents with JCDK2.2.1 contents. Now maximize Eclipse again convert your

Eclipse generated .cap file cannot be installed on JavaCard

核能气质少年 提交于 2020-01-14 06:20:17
问题 I am trying to install applets on my JavaCard (Gemalto IDCore3010). I succeeded with the GlobalPlatform helloworld.cap file, but when it was me generating the .cap file in Eclipse (4.4.2) using the very same sourcecode (with different package name though, but that shouldn't matter) I got error messages both with GlobalPlatformShell and GlobalPlatformProShell. I was using the same command and script as in case of the original file. I also tried other .cap files that had been working on

Send more than 261 bytes to Java Card with Android NFC

两盒软妹~` 提交于 2020-01-13 19:07:46
问题 I want to send an APDU with a length of 1699 bytes via NFC (class IsoDep ) to a Java Card smartcard. I get the error java.io.IOException: Transceive length exceeds supported maximum My phone is a Samsung Galaxy S7. I use extended-length in my applet on the card. I have verified that the card supports extended length. I tested this via pyapdutool by sending an APDU with 4000 bytes to the card. I found that when I write this code, the result is false : final Tag t = (Tag) tag; myTag = IsoDep

RSA Encrytion throws an exception intermittently on JavaCard

℡╲_俬逩灬. 提交于 2020-01-13 18:30:09
问题 I've written a program to encrypt 10 bytes random number using an RSA public key on my Java Card. The random number is generated each time that the card receives that APDU command, and as the related cipher object block size is 2048 bit in my applet, I append 242 bytes of 0x00 at the end of this 10 byte random number to make it 256 bytes length. The problem is that sometimes the response is a Crypto Exception with 05 value. As you know and as JC API documents mentioned: 0x05 = ILLEGAL_USE

Default selected applet doesn't return right value

血红的双手。 提交于 2020-01-07 08:47:06
问题 I wanted to answer this question so I wrote the below program: package test; import javacard.framework.APDU; import javacard.framework.ISO7816; import javacard.framework.Applet; import javacard.framework.ISOException; import javacard.framework.Util; public class Test extends Applet { public static final byte[] res = { (byte) 0x00, (byte) 0x00, (byte) 0x3B, (byte) 0xAD, (byte) 0x3F, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x16, (byte)

Java card weird response to long AID and Short AID applets

独自空忆成欢 提交于 2020-01-04 17:45:14
问题 I create a package that contains 22 equal applets.(The applets are equal in program and different in AID.) When I set the package AID and applet's AIDs as below, everything is OK. (I can install it and I can see it in the response of gp -list command) Package AID = 0102030405 App1 AID = 010203040501 App2 AID = 010203040502 App3 AID = 010203040503 App4 AID = 010203040504 App5 AID = 010203040505 App6 AID = 010203040506 App7 AID = 010203040507 App8 AID = 010203040508 App9 AID = 010203040509