Dear Srijoy,
Again the answer is in the ETSI specs. Normally you only
select files from the GSM application with select APDUs
as this is normlly the only applet receiving APDU process
calls.
To access GSM files from a toolkit applet you must get a
instance of sim.access.SIMView interface. This is acomplished
by calling sim.access.SIMSystem.getTheSIMView().
Please note that the object returned is a JCRE owned object
(not owned by the GSM applet as you first may think from the fact
that it implements the Shareable interface).
Then you call the select method on this interface to select a file
and access methods to read, update, etc. the file. For example
to read the Location information from DF GSM, EF LOCI you would
proceed as follows:
// Get the SIMView object
sim.access.SIMView theView = sim.access.SimSystem.getTheSIMView();
// select DF GSM and then EF IMSI
theView.select( sim.access.FID_DF_GSM );
theView.select( sim.access.FID_EF_LOCI );
// read the IMSI
theView.readBinary( (short) 0, // file offset
buffer, // buffer to store result
(short) 0, // offset in buffer where to store
(short) 11 ); // length to read. (all 11 bytes)
Without authorisation to read this file this code would throw a
SIMViewException with the reason SIMViewException.AC_NOT_FULFILLED to
indicate that this file needs CHV1 for read , update or rehabilitate
commands.
You can't set these access condition level from your applets code. To
allow applets to have access to files which need a certain access
condition
you need to specify which access condition will be assumed true
for all file accesses of this applet during installation. This is done
by specifying the correct "Access Domain Data" in the install(install)
apdu
during applet installation after the applet loading.
See GSM 03.48 (ETSI 101 181) for the applet loading specs and security
mechanisms.
Be aware that normally only the network operator can activate the
loader/installer applet on the card and issue these commands.
Regards
Martin
Srijoy Das wrote:
>
> Subject: Select GSM files ( Java SIM card)
>
> But I have another question -
> If I want to select a GSM file with a SELECT command,
> Then I will give the FileID. But each GSM file has security
> key access levels associated, ADM, CHV1, CHV2,
> 1.Suppose I want to update the file selected then how do
> I take care of the security checks on each file?
>
> regards,
> Srijoy
>
> The reasonable man adapts himself to the world; the unreasonable one
> persists in trying to adapt the world to himself. Therefore all progress
> depends on the unreasonable man.
>
> ---
> > Visit the OpenCard web site at http://www.opencard.org/ for more
> > information on OpenCard---binaries, source code, documents.
> > This list is being archived at http://www.opencard.org/archive/opencard/
>
> ! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
> ! to
> ! [EMAIL PROTECTED]
> ! containing the word
> ! unsubscribe
> ! in the body.
--
**************<- Developer Support Center Munich ->**************
Sun Microsystems GmbH Martin Merck
Sonnenallee 1 DSC
85551 Kirchheim-Heimstetten Phone: +49-89-46008-2115
Germany Fax: +49-89-46008-2570
www.sun.de mailto: [EMAIL PROTECTED]
*****************************************************************
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.