javacard

Eclipse fails to build Java Card sample projects

↘锁芯ラ 提交于 2019-12-23 01:29:33
问题 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

Eclipse fails to build Java Card sample projects

旧街凉风 提交于 2019-12-23 01:29:08
问题 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

Store symmetric keys in Java Card

独自空忆成欢 提交于 2019-12-23 01:24:22
问题 I am working on an applet which has to share some keys of type AESKey with different terminals. The thing is I don't know in advance how many terminals it will have to handle. As there is no structure like HashTable in Java Card, it's getting complicated. I can still fix an upper bound and instanciate as much objects AESKey but I would like to search for another way to do. I thought I could do something with byte arrays, but is it a bad practice to store keys in byte[] ? I think the answer is

setATRHistBytes() method always returns false

大兔子大兔子 提交于 2019-12-22 17:52:07
问题 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.*;

Sending Extended APDU to Javacard

喜欢而已 提交于 2019-12-22 10:33:18
问题 I have a ACR38 samrt-card-reader and a number of Javacard [2.1.1] compliant with GP Spec [02]. As I know, there is two kind of APDU, Short-APDU [APDU with LC or/and LE shorter than 255 ] and Extended-APDU [APDU with LC or/and LE greater than 255 ]. is that right? We send Short-APDU in T=0 protocol and send Extended-APDU in T=1 protocol. is that right? I sent Short-APDU to my card successfully. [via GPJ , GPShell , OpenSC-Tool ]. And now, I want to know: 1: if I want to use Extended APDU, my

En-/Decryption output in Java Card + corresponding APDUs

风流意气都作罢 提交于 2019-12-22 09:43:32
问题 I'm new to the whole topic of Java Card and tried to look at a few code examples to get a better understanding. I found a sample for AES usage in the oracle forum but have a few problems with the following part: private void doAES(APDU apdu) { byte b[] = apdu.getBuffer(); short incomingLength = (short) (apdu.setIncomingAndReceive()); if (incomingLength != 24) ISOException.throwIt(ISO7816.SW_WRONG_LENGTH); //perform encryption and append results in APDU Buffer a[] automatically cipherAES.init

Encode publicKey on Java Card

浪尽此生 提交于 2019-12-21 21:43:20
问题 How to encode an ECDSA PublicKey on Java Card so that after I can decode it on another platform (e.g. sending the encoded key in a response APDU and processing it in a standard Java application)? keyPair.getPublic().getEncoded() on Java would do the trick with PKCS#8 encoding, but as far as I know getEncoded() is not available on the Java Card platform. 回答1: You can implement this function like this: Card side: 1 KeyPair.getPublicKey() --> publicKey; 2 publicKey.getW() --> W; 3 Send W to

Required Things to start Smartcard Programming Using Javacard

こ雲淡風輕ζ 提交于 2019-12-20 23:27:25
问题 I wanted to start with the smartcard programming soon. Please help me the things required for starting the learning using javacard. Which IDE (If any IDE Supports), Software and Hardware related? Like Mobile phone simulator is there any smartcard simulator or else if I have to buy a smartcard specify those cards where and how I can get? 回答1: A general answer regarding smartcard programming is that you should be ready to navigate a confusing list of tools and technologies. Typically smartcard

How can I check INITIALIZE UPDATE and EXTERNAL AUTHENTICATE correctness?

微笑、不失礼 提交于 2019-12-20 15:32:11
问题 I sent 80 50 00 00 08 00 00 00 00 00 00 00 00 [ INITILIZE UPDATE Command] via opensc-tool to my java card and received 00 00 11 60 01 00 8A 79 0A F9 FF 02 00 11 79 11 36 5D 71 00 A5 A5 EC 63 BB DC 05 CC [ Init Response ] as its response from the card. As you see: In the command,I send 00 00 00 00 00 00 00 00 as Host Challenge , And in the response : 00 00 11 60 01 00 8A 79 0A F9 = Key diversification data FF 02 = Key information 00 11 79 11 36 5D 71 00 = Card challenge A5 A5 EC 63 BB DC 05 CC

How to load CAP file to java card

半腔热情 提交于 2019-12-20 07:49:05
问题 I am new to java card,Can you help me how to parse Aplet CAP file into the APDU, For installing this CAP file to the card suported GP2.2. 回答1: You should try using GPShell which will do the work for you. You need to perform a number of GlobalPlatform commands : Install [for load] Load Install [for install and make selectable] GPshell will do this for you, as well as the security (you need to authenticate with SCP02, in a script that will look like this : mode_211 enable_trace establish