working with Java Card Wallet

故事扮演 提交于 2019-11-30 07:37:46

To call the credit (or debit) methods you need to change the INS byte of your APDU to match the required value.

In the code you have posted the INS for Credit is 0x30 and the INS for Debit is 0x40.

So after sending your select APDU you would need to send the following

Credit

0x80 0x30 0x00 0x00 0x01 (1 byte containing the Credit value) 0x00

Debit

0x80 0x30 0x00 0x00 0x01 (1 byte containing the Debit value) 0x00

In both cases you should recieve 0x63 0x61 in response indicating that you need to perform a Verify PIN command.

The Verify PIN command should be constructed as:

0x80 0x20 0x00 0x00 (1 byte indicating the number of PIN bytes) (The PIN bytes) 0x00

for example if the PIN were 4 digits and set to the value '1234' you would expect to see the following:

0x80 0x20 0x00 0x00 0x02 0x12 0x34 0x00

If the PIN is verified correctly you will get a 0x90 0x00 in response

If the PIN is incorrect you will get a 0x63 0x00 response

The value of the PIN for this app is set in the install parameters for the applet which as the name suggests is when the applet is installed onto a card (or emulator)

Hope this helps

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!