martinpaljak / GlobalPlatformPro

🌐 🔐 Manage applets and keys on JavaCard-s like a pro (via command line or from your Java project)
https://javacard.pro/globalplatform
GNU Lesser General Public License v3.0
679 stars 210 forks source link

Disable/Enable auto Get Response #245

Closed jlanza closed 3 years ago

jlanza commented 3 years ago

This is not a bug, but like a new feature request.

As GlobalPlatformPro can be used to send plain APDU, would it be possible to include an option to enable/disable auto Get Response?

As GlobalPlatformPro is programmed in Java, I have tried in windows using:

c:\> set JAVA_TOOL_OPTIONS="-Dsun.security.smartcardio.t0GetResponse=false"
c:\>  gp -d -a 00a40200022f01

But the GetResponse is automatically sent. I would like to get 61XX ;) Is there any way to achieve this?

martinpaljak commented 3 years ago

For immediate relief you might want to try this: https://github.com/martinpaljak/jnasmartcardio/blob/master/src/main/java/jnasmartcardio/Smartcardio.java#L801

If you just send APDU-s without global platform, use apdu4j and its command line -B option.