Anyone has some code for Smartcards?

Started by fielder, March 21, 2018, 19:25:13

Previous topic - Next topic

fielder

i can't find anything related the way to "read" (just read) a smartcard.

i just want to reacive something like this:
[a] cold ATR (size=26)  : 3B FF 11 00 00 81 71 40 42 00 00 21 01 31 42 52 00 05 63 40 4B 01 06 90 00 E7h

i just downloaded the cardpeek utiltiy that send these commands to the reader:
RSET 3B FF 11 00 00 81 71 40 42 00 00 21 01 31 42 52                     
     00 05 63 40 4B 01 06 90 00 E7                                       
RSET 3B FF 11 00 00 81 71 40 42 00 00 21 01 31 42 52                     
     00 05 63 40 4B 01 06 90 00 E7                                       
SEND 00 A4 02 0C 02 3F 00 00                                             
RECV 6B00                                                # Wrong parameter(s) P1-P2
     (nil)
but i can't understand how to connect this strange device (there are no COMs... or USBs...)

i found some infos here: https://www.codeproject.com/Articles/23018/How-to-access-SmartCards-simply-and-effectively and here: https://www.codeproject.com/Articles/16653/A-Smart-Card-Framework-for-NET but nothing that i can use on Bmax :(

col

#1
For Windows you can use the WinSCard API to save you some headache.
https://msdn.microsoft.com/en-us/library/aa374731(v=VS.85).aspx#smart_card_functions

For Linux I believe you can use PCSC
https://muscle.apdu.fr/

EDIT: oh I see you've found something...
Quotebut nothing that i can use on Bmax
Do you know how to write code to interface with C in BlitzMax? If so you could write a wrapper yourself?
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

fielder

hehe for now i'm not able to "port" something to Bmax :)

col

That's a shame as it doesn't look a very big api at all.
I don't have a smart card reader to test/verify code otherwise I'd write it for you.


https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

fielder

#4
No problem :)  i've a old dell keyboard with integrated smartcard reader.. and recently i've found 2 ACER boot-smartcards from an old notebook.. i just tried to see how works these things :p

BTW.. very thank you for your answers :)

P.S. i found on purebasic forum something related to the smartcard reader: http://www.purebasic.fr/english/viewtopic.php?f=13&t=10093 .. and more recently this: http://purebasic.info/phpBB3ex/viewtopic.php?f=14&t=4511

fielder