I'm experimenting with applet for JavaCard - it's very simple SCWS serverlet(basically template from Gemalto Dev Suite). I want it to store some data on card - how to do it? I found only some theoretical materials about linear and cyclical files.
//EDIT
I managed to find something like this:
private byte createfile()
{
try{
AdminFileView uiccAdminFileView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET);
if(uiccAdminFileView == null){
return 'a';
}
uiccAdminFileView.select((short)0x7F60);
EditHandler editHandler = (EditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER,
(short) 50);
editHandler.clear();
editHandler.appendArray(CreateEF, (short) 0,(short) CreateEF.length);
uiccAdminFileView.createFile(editHandler);
data[0] = (byte) 0x12;
data[1] = (byte) 0x34;
data[2] = (byte) 0x56;
uiccAdminFileView.select((short)0xEE00);
uiccAdminFileView.updateBinary((short) 0, data, (short)0, (short)3);
} catch(UICCException e){
return (byte)e.getReason();
}
return 'b';
}
But at this point it returns "a" every time - as far as I know it has something to do with access rights for applet.