Question

In my applet, key is hardcoded and i want to give this key as the parameter of install() method.

The install method takes 3 parameter as

install(byte[] bArray, short bOffset, byte bLength)

How can i give the key value as the parameter of the install method?

Was it helpful?

Solution

Normally a Java Card implementation also implements Global Platform. In that case the user parameters can be given as part of the INSTALL for INSTALL command. The Global Platform card specification is available for free, although registration is required.

You can find the specification of the parameters in 11.5.2.3.7 INSTALL Command Parameters of the provided document. It is important to provide the instance AID first. Then there is a specific format for the Application Specific Parameters (tag C9, then a length byte, then the parameters in binary). You need to parse this structure in the Java Card install method as well.

If you cannot debug the install method then return the parameters as response data of a test APDU.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top