Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0    Statistic  


Read file from smart card with APDU protocol.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
SmartCard 8.5 Yes Yes Yes No No
MBS( "SmartCard.ReadFile"; SmartCardContext; FileID; ResultType )   More


Parameter Description Example value
SmartCardContext The smartcard context reference number. $SmartCardContext
FileID The fileID of the file to retrieve.
Given as hex string.
ResultType How to return data.
Can be JPEG, Hex or Base64.


Returns data or error.


Read file from smart card with APDU protocol.
Returns data in desired encoding or error message.
The first two bytes (4 Hex characters) are status code.
For JPEG we remove status code to return only image.


Read file from smartcard with APDU protocol:

Set Variable [ $result ; Value: MBS( "SmartCard.ReadFile"; $$SmartCard; Card::FileID) ]
If [ MBS("IsError") ]
    Set Field [ Card::Status ; $result ]
    Show Custom Dialog [ "Error" ; $result ]
    Set Field [ Card::FileData ; Middle ( $result ; 5; Length($result) ) ]
    Set Field [ Card::Status ; "OK " & Left ( $result ; 4 ) ]
    Perform Script [ Specified: From list ; “Split” ; Parameter: ]
End If

See also

Blog Entries

Created 19th October 2018, last changed 19th October 2018

SmartCard.ReadCertificate   -   SmartCard.Reconnect

Feedback: Report problem or ask question.

MBS Xojo PDF Plugins