JavaCard Applet Development Related Questions and Answers.
-
lenosrd
- Posts: 4
- Joined: Thu Mar 10, 2016 3:14 am
- Points :44
-
Contact:
Post
by lenosrd » Fri Apr 15, 2016 1:45 am
In JCVM v3.0.4 Classic Edition, the applet component is described as
applet_component {
u1 tag
u2 size
u1 count
{ u1 AID_length
u1 AID[AID_length]
u2 install_method_offset
} applets[count]
}
As we can see, the applet AID is present in applet component. But how can I get these instances of the structure in the my programming? Or some information about applet?
How can I find out the root applet?
-
Liguwu
- Posts: 10
- Joined: Thu Apr 07, 2016 1:40 am
- Points :78
-
Contact:
Post
by Liguwu » Fri Apr 15, 2016 3:36 am
FYI
Code: Select all
struct AppletInfo{
char AID_length;
char AID[]; //size = AID_length
};
struct AppletComponent{
char Tag;
short int Size;
char Count;
AppletInfo Applets[];
};
AppletInfo* NextApplet(AppletInfo* Applet){
return (AppletInfo*)&Applet->AID[Applet->AID_length];
}
int _tmain(int argc, _TCHAR* argv[])
{
AppletComponent * aplComp;
//.....
AppletInfo *Applet = &aplComp->Applets[0];
//to get the next call applet, but not more than Count-1 {-1 because the first one we've already got}
Applet = NextApplet(Applet);
return 0;
}
-
Crawford
- Posts: 39
- Joined: Thu Sep 17, 2015 11:50 pm
- Points :246
-
Contact:
Post
by Crawford » Fri Apr 15, 2016 5:57 am
There is no root applet. Each applet is just packaged in a flat way inside the CAP file as if they were just different classes.
-
Pf6KINE
- Posts: 18
- Joined: Wed Apr 13, 2016 2:03 am
- Points :148
-
Contact:
Post
by Pf6KINE » Sat Apr 16, 2016 3:29 am
Code: Select all
PAppletInfo = ^TAppletInfo;
TAppletInfo = packed record
private
function GetInstallMethodOffset: TShort;
public
AID_length: Byte;
AID: Array[0..0] of byte; //size = AID_length
(*
InstallMethodOffset: Word;
*)
property InstallMethodOffset: TShort read GetInstallMethodOffset;
end;
PAppletComponent = ^TAppletComponent;
TAppletComponent = packed record
Tag: TComponentType;
Size: TShort;
Count: Byte;
Applets: Array[0..0] of TAppletInfo; //size = Count
end;
function TAppletInfo.GetInstallMethodOffset: TShort;
begin
Result := PWord(@AID[AID_length])^;
end;
Users browsing this forum: No registered users and 26 guests
JavaCard OS : Disclaimer
Board Disclaimer
The views and comments posted in these fora are personal and do not necessarily represent the those of the Management of JavaCard OS.
The Management of JavaCard OS does not, under any circumstances whatsoever, accept any responsibility for any advice, or recommentations, made by, or implied by, any member or guest vistor of JavaCard OS that results in any loss whatsoever in any manner to a member of JavaCard OS, or to any other person.
Furthermore, the Management of JavaCard OS is not, and cannot be, responsible for the content of any other Internet site(s) that have been linked to from JavaCard OS.