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.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5    Statistic  

SmartCard.ReadFile

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

Parameters

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

Result

Returns data or error.

Description

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.

Examples

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 ]
Else
    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

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


SmartCard.ReadCertificate   -   SmartCard.Reconnect

Feedback: Report problem or ask question.




Links
MBS FileMaker blog