Page 1 of 1

Javacard kit 3.0.4 & crypto algorithm

Posted: Tue Nov 28, 2017 10:12 am
by prichard
Hi,
I wrote this little applet to see if your simulator (and later one of your cards) supports this style of crypto:
Signature. getInstance (MessageDigest. ALG_NULL, Signature. SIG_CIPHER_ECDSA, Cipher. PAD_NULL, false);

my applet this compiles in java card kit 3.0.4, but during the installation on the simulator I have a: 69 85 Conditions of use not satisfied with the INSTALL for install & make selectable command.

Is your simulator fully compatible with java card kit 3.0.4?
Do you have a card that is compatible with java card kit 3.0.4?

Thank you in advance for your help,
Pascal

code of the applet:

package com.fime.ecTest;

import javacard.framework.APDU;
import javacard.framework.Applet;
import javacard.framework.AppletEvent;
import javacard.framework.ISO7816;
import javacard.framework.ISOException;
import javacard.security.MessageDigest;
import javacard.security.Signature;
import javacardx.crypto.Cipher;

public class Application extends Applet implements AppletEvent {

/** SM2 cryptographic object */
private static Signature sm2Object;

Application()
{
sm2Object = Signature.getInstance(MessageDigest.ALG_NULL, Signature.SIG_CIPHER_ECDSA, Cipher.PAD_NULL, false);

}

public static void install(byte[] bArray, short bOffset, byte bLength) {
// GP-compliant JavaCard applet registration
new Application().register(bArray, (short) (bOffset + 1),
bArray[bOffset]);
}

public void process(APDU apdu) {
// Good practice: Return 9000 on SELECT
if (selectingApplet()) {
return;
}

byte[] buf = apdu.getBuffer();
switch (buf[ISO7816.OFFSET_INS]) {
case (byte) 0x00:
break;
default:
// good practice: If you don't know the INStruction, say so:
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}

public void uninstall() {
sm2Object = null;
}
}

Re: Javacard kit 3.0.4 & crypto algorithm

Posted: Thu Dec 07, 2017 11:52 pm
by roundtable
For signature builder call Signature. getInstance (MessageDigest. ALG_NULL, Signature. SIG_CIPHER_ECDSA, Cipher. PAD_NULL, false);
infact , it is failed as expected, since ECDSA is signature standard specified In ANSI X9.62-1998, for this scheme, only message digest and Private key are needed without any padding method, so When you call . getInstance (MessageDigest. ALG_NULL, Signature. SIG_CIPHER_ECDSA, Cipher. PAD_NULL, false) , where algorithm for message Digest is NULL, which is not met requirement of ECDSA scheme. exception is thrown as expected.

Similarly, if padding method is not Cipher. PAD_NULL, exception mqy be thrown .

Re: Javacard kit 3.0.4 & crypto algorithm

Posted: Fri Dec 08, 2017 1:29 am
by kuafu
JavaCard JC30M48CRhttps://www.javacardos.com/store/javacard-jc30m48cr.php
JavaCard JC10M128Chttps://www.javacardos.com/store/javacard-jc10m128c.php
JavaCard JC10M24Rhttps://www.javacardos.com/store/smartcard_eJavaToken.php
JavaCard A40CRhttps://www.javacardos.com/store/javacard-a40cr.php
JavaCard A22CRhttps://www.javacardos.com/store/javacard-a22cr.php

They are all compatible with java card kit 3.0.4.

and our simulator is fully compatible with java card kit 3.0.4