Closed nic1v closed 1 year ago
Actually this can be improved to throw a meaningful exception when the reponse is less than 2 bytes in length.
Hello Martin! Thanks for the response.
I think the one card I was using was a Mifare card (Bought From Here)
I also tried this with a different card (NFC Ring actually) with the same response...
C:\Users\Nic\Downloads>gp -info -d -v -i
GlobalPlatformPro v20.01.23-0-g5ad373b
Running on Windows 10 10.0 amd64, Java 19.0.2 by Oracle Corporation
# Detected readers from JNA2PCSC
[*] ACS ACR122 0
SCardConnect("ACS ACR122 0", T=*) -> T=1, 3B8F8001804F0CA000000306030001000000006A
SCardBeginTransaction("ACS ACR122 0")
Reader: ACS ACR122 0
ATR: 3B8F8001804F0CA000000306030001000000006A
More information about your card:
http://smartcard-atr.appspot.com/parse?ATR=3B8F8001804F0CA000000306030001000000006A
A>> T=1 (4+0000) 00A40400 00
SCardEndTransaction("ACS ACR122 0")
SCardDisconnect("ACS ACR122 0", true) tx:0/rx:0
Exception in thread "main" java.lang.IllegalArgumentException: newPosition < 0: (-2 < 0)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:344)
at java.base/java.nio.Buffer.position(Buffer.java:319)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1526)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:267)
at jnasmartcardio.Smartcardio$JnaCardChannel.transmitImpl(Smartcardio.java:807)
at jnasmartcardio.Smartcardio$JnaCardChannel.transmit(Smartcardio.java:688)
at apdu4j.terminals.LoggingCardTerminal$LoggingCard$LoggingCardChannel.transmit(LoggingCardTerminal.java:254)
at apdu4j.CardChannelBIBO.transceive(CardChannelBIBO.java:22)
at apdu4j.APDUBIBO.transmit(APDUBIBO.java:36)
at pro.javacard.gp.GPSession.discover(GPSession.java:127)
at pro.javacard.gp.GPTool.main(GPTool.java:237)
Is there a Reader/Writer you suggest? I'm currently trying to learn about this all to make an access control system for my house as a hobby so I appreciate any advice!
https://github.com/fidesmo/fdsm/wiki/Choosing-a-desktop-reader - from the affordable/chinese ones i prefer 1252 myself.
Try with your contactless bank card. The ring you are using is also Mifare classic, which has nothing to do with JavaCard-s
Hello,
I'm receiving this IllegalArgumentException when running any command through Windows CLI...
Currently using this Reader/Writer + Card set but no FOBs though (https://dangerousthings.com/product/acr122u/)
Let me know if there is more information I can provide!