Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

Implementing of javacardx.biometry

JavaCard Applet Development Related Questions and Answers.
mhsnmaghsoodloo
Posts: 24
Joined: Thu Apr 07, 2016 12:14 pm
Points :457
Contact:

Implementing of javacardx.biometry

Post by mhsnmaghsoodloo » Tue Aug 23, 2016 6:26 am

Hello everyone,
I want to implement javacardx.biometry.OwnerBioTemplate interface. I wrote the sample code that compile and convert to by JCDK 2.2.2. When i want to load and install to the card by GPShell i get the error code 0x6438 (Imported package not found). But when i comment the " implements OwnerBioTemplate" and "implements SharedBioTemplate", the applet load and install to the card successfully.
the sample code is:

import javacard.framework.*;
import javacardx.biometry.*;
public class bioServerApplet extends Applet implements SharedBioTemplate {

public final static byte CLA = (byte)0xCF;
public final static byte INS_ENROLL = (byte)0x10;
public final static byte MATCH_TRY_LIMIT = (byte)5;
private OwnerBioTemplate impl;

public static void install(byte[] bArray, short bOffset, byte bLength)
{
new bioServerApplet(bArray,bOffset,bLength);
}

private bioServerApplet(byte[] bArray, short bOffset, byte bLength) {
register(bArray, bOffset, bLength);
byte aidLen = bArray[bOffset];
if (aidLen== (byte)0){
register();
} else {
register(bArray, (short)(bOffset+1), aidLen);
}
impl = BioBuilder.buildBioTemplate(BioBuilder.PASSWORD,MATCH_TRY_LIMIT);
}

public void process(APDU apdu){

}

public void enrollData(APDU apdu){
byte []buffer = apdu.getBuffer();
short bytesRead = apdu.setIncomingAndReceive();
impl.init(buffer, ISO7816.OFFSET_CDATA, bytesRead);
impl.doFinal();
//enrollment complete
}


//--- the nethods below implement the SharedBioTemplate interface
public boolean isInitialized(){
return impl.isInitialized();
// return true;
}
public boolean isValidated(){
return impl.isValidated();
//return true;
}
public void reset(){
impl.reset();
}
public byte getTriesRemaining(){
return impl.getTriesRemaining();
//return (byte) 0x33;
}
public byte getBioType(){
return impl.getBioType();
//return (byte) 0x33;
}
public short getVersion(byte[] dest, short offset){
return impl.getVersion(dest,offset);
//return (short) 33;
}
public short getPublicTemplateData(short publicOffset, byte[] dest,
short destOffset,
short length) throws BioException{
return impl.getPublicTemplateData(publicOffset,dest,destOffset,length);
//return (short) 33;
}
public short initMatch(byte[] candidate, short offset, short length)
throws BioException{
return impl.initMatch(candidate,offset,length);
//return (short) 33;
}
public short match(byte[] candidate, short offset, short length)
throws BioException{
return impl.match(candidate,offset,length);
//return (short) 33;
}
}
the OwnerBioTemplate implementation is:

import javacardx.biometry.*;
public class OwnerBioTemplateImpl implements OwnerBioTemplate{

public void init(byte[] bytes, short s, short s1) throws BioException {

}

public void update(byte[] bytes, short s, short s1) throws BioException {

}

public void doFinal() throws BioException {

}

public void resetUnblockAndSetTryLimit(byte b) throws BioException {

}

public boolean isInitialized() {
return true;
}

public boolean isValidated() {
return true;
}

public void reset() {

}

public byte getTriesRemaining() {
return 0x33;
}

public byte getBioType() {
return 0x33;
}

public short getVersion(byte[] bytes, short s) {
return 33;
}

public short getPublicTemplateData(short s, byte[] bytes, short s1, short s2) throws BioException {
return 33;
}

public short initMatch(byte[] bytes, short s, short s1) throws BioException {
return 33;
}

public short match(byte[] bytes, short s, short s1) throws BioException {
return 33;
}
}

install -file bio.cap -instParam 00 -priv 00 -AID A00000030500001000 -pkgAID A00
0000305 -instAID A00000030500001000
Command --> 80E602001805A00000030508A0000000030000000006EF04C60204100000
Wrapped command --> 84E602002005A00000030508A0000000030000000006EF04C602041000B6
F6AE609D69F16C00
Response <-- 009000
Command --> 80E80000EFC482040201000FDECAFFED010204000105A00000030502001F000F001F
000D001F0032007B0103000A0025000001AB00000000000003010004001F03000107A00000006200
01020107A0000000620202030107A000000062010103000D0109A00000030500001000003D06007B
02800000FF00010D00000008000B000E001100140018001C001F00240029002E0033003881000906
050B090A07080C0D81010D06050B090A07080C0D01020304438203010001070B0000007B007E009C
00A600B000BA00C400CE00DA00E900F68100090A090F0D0E0B0C10118202008102090A090F0D0E0B
0C101107010300011018
Wrapped command --> 84E80000F7C482040201000FDECAFFED010204000105A00000030502001F
000F001F000D001F0032007B0103000A0025000001AB00000000000003010004001F03000107A000
0000620001020107A0000000620202030107A000000062010103000D0109A0000003050000100000
3D06007B02800000FF00010D00000008000B000E001100140018001C001F00240029002E00330038
81000906050B090A07080C0D81010D06050B090A07080C0D01020304438203010001070B0000007B
007E009C00A600B000BA00C400CE00DA00E900F68100090A090F0D0E0B0C10118202008102090A09
0F0D0E0B0C10110701030001101892A80583FE545E26
Response <-- 6438
load() returns 0x80206438 (Unknown ISO7816 error: 0x6438)

Anyone can help me to solve my problem?

Tarantino
Posts: 101
Joined: Wed Aug 19, 2015 1:56 am
Points :478
Contact:

Re: Implementing of javacardx.biometry

Post by Tarantino » Wed Aug 24, 2016 4:07 am

I have done test with your project in JCIDE, and the project can be downloaded and installed in JCIDE simulator successfully. it can run without any problem. So I guess maybe your real card doesn't support some function.
You do not have the required permissions to view the files attached to this post. Please login first.
The greatest glory in living lies not in never falling, but in rising every time we fall.--Nelson Mandela

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: Implementing of javacardx.biometry

Post by UNKNwYSHSA » Wed Aug 24, 2016 9:41 pm

From your description, please make sure your card implements package javacardx.biometry. javacardx package is Extension packages, Not all card implements these functions.
sense and simplicity

mhsnmaghsoodloo
Posts: 24
Joined: Thu Apr 07, 2016 12:14 pm
Points :457
Contact:

Re: Implementing of javacardx.biometry

Post by mhsnmaghsoodloo » Sun Aug 28, 2016 6:50 am

Thanks trantino for your reply.
I tested my code in netbeans simulator (cjcre.exe) but it couldn't load my applet too. My card is a javacard 2.2.2 and i could load a javacard 2.2.2 hello world applet. javacardx.biometry package is a interface and my applet wants to implement it. I must mention that when i comment "implements SharedBioTemplate" my applet load to card successfully.
Do you mean my card doesn't support javacardx.biometry interfaces? because i want to implement biometric package not card.

mhsnmaghsoodloo
Posts: 24
Joined: Thu Apr 07, 2016 12:14 pm
Points :457
Contact:

Re: Implementing of javacardx.biometry

Post by mhsnmaghsoodloo » Sun Aug 28, 2016 6:54 am

UNKNwYSHSA wrote:From your description, please make sure your card implements package javacardx.biometry. javacardx package is Extension packages, Not all card implements these functions.


thanks for reply. javacardx.biometry package has some interface and i want to implement it not card.

mhsnmaghsoodloo
Posts: 24
Joined: Thu Apr 07, 2016 12:14 pm
Points :457
Contact:

Re: Implementing of javacardx.biometry

Post by mhsnmaghsoodloo » Sun Aug 28, 2016 6:58 am

Tarantino wrote:I have done test with your project in JCIDE, and the project can be downloaded and installed in JCIDE simulator successfully. it can run without any problem. So I guess maybe your real card doesn't support some function.

very thanks for compiling my code. I have to test my code by JCIDE.

mhsnmaghsoodloo
Posts: 24
Joined: Thu Apr 07, 2016 12:14 pm
Points :457
Contact:

Re: Implementing of javacardx.biometry

Post by mhsnmaghsoodloo » Sun Aug 28, 2016 9:57 am

Tarantino wrote:I have done test with your project in JCIDE, and the project can be downloaded and installed in JCIDE simulator successfully. it can run without any problem. So I guess maybe your real card doesn't support some function.


I tested uploaded JCIDE project by JCIDE. When i compile your project i get error "package javacardx.biometry does not exist";
what i am missing?

Tarantino
Posts: 101
Joined: Wed Aug 19, 2015 1:56 am
Points :478
Contact:

Re: Implementing of javacardx.biometry

Post by Tarantino » Sun Aug 28, 2016 11:31 pm

Hi,

The error you got is just because the java card kit version is wrong. Follow the steps below to change JCKit version in JCIDE to jc 2.2.2, the project will be complied successfully.

From the menu, select " Build-> Property ", a dialog box "Property Sheet" will pop up. Click "Local JCKit Configuration" in the side bar, and unfold "JCKit Option" and for first item "Java Card kit version", select "java_card_kit-2_2_2" from dropdown list.

You do not have the required permissions to view the files attached to this post. Please login first.
The greatest glory in living lies not in never falling, but in rising every time we fall.--Nelson Mandela

mhsnmaghsoodloo
Posts: 24
Joined: Thu Apr 07, 2016 12:14 pm
Points :457
Contact:

Re: Implementing of javacardx.biometry

Post by mhsnmaghsoodloo » Mon Aug 29, 2016 1:01 am

Tarantino wrote:Hi,

The error you got is just because the java card kit version is wrong. Follow the steps below to change JCKit version in JCIDE to jc 2.2.2, the project will be complied successfully.

From the menu, select " Build-> Property ", a dialog box "Property Sheet" will pop up. Click "Local JCKit Configuration" in the side bar, and unfold "JCKit Option" and for first item "Java Card kit version", select "java_card_kit-2_2_2" from dropdown list.


Thank you tarantino,
You are right. can you answer another question. hasn't JCIDE any facilities to load two applet on simulator simultaneously? (To find out can i call javacardx.biometry interfaces which i implemented in second applet)

Tarantino
Posts: 101
Joined: Wed Aug 19, 2015 1:56 am
Points :478
Contact:

Re: Implementing of javacardx.biometry

Post by Tarantino » Mon Aug 29, 2016 4:54 am

mhsnmaghsoodloo wrote:Thank you tarantino,
You are right. can you answer another question. hasn't JCIDE any facilities to load two applet on simulator simultaneously? (To find out can i call javacardx.biometry interfaces which i implemented in second applet)


In JCIDE, select " Debug-> Run or Debug Configuration ", click "Add Cap File", select the applet you want to download first and then click button "Up " to adjust the downloading order. After this, click "Debug" to debug your applet. The applets will be downloaded according to the order you arranged.



You do not have the required permissions to view the files attached to this post. Please login first.
The greatest glory in living lies not in never falling, but in rising every time we fall.--Nelson Mandela

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 80 guests

JavaCard OS : Disclaimer