TABLE OF CONTENTS

 

[Modules] calypso_card_read.c

NAME

   SpringCard Calypso API :: Card command set (files and application selection + reading)

COPYRIGHT

AUTHOR

   Johann Dantant / PRO ACTIVE

HISTORY

   JDA 21/10/2008 : first public release

[Functions] CalypsoCardReadBinary

NAME

   CalypsoCardReadBinary

DESCRIPTION

   Read bytes from an EF (must be a binary EF)

INPUTS

   CALYPSO_CTX_ST *ctx      : library context
   BYTE           sfi       : identifier of the file (0 for current file)
   WORD           offset    : address of first byte
   BYTE           ask_size  : size to be read ('Le' parameter in APDU - may be 0)
   BYTE           data[]    : buffer to receive the data
   CALYPSO_SZ     *datasize : input  = size of the data buffer
                              output = actual length of the data

RETURNS

   CALYPSO_RC            : 0 or an error code

[Functions] CalypsoCardReadRecord

NAME

   CalypsoCardReadRecord

DESCRIPTION

   Read one record from the current EF (either cyclic or linear)

INPUTS

   CALYPSO_CTX_ST *ctx      : library context
   BYTE           sfi       : identifier of the file (0 for current file)
   BYTE           rec_no    : identifier of the record
   BYTE           rec_size  : expected size of the record ('Le' parameter in APDU - may be 0)
   BYTE           data[]    : buffer to receive the data
   CALYPSO_SZ     *datasize : input  = size of the data buffer
                              output = actual length of the data

RETURNS

   CALYPSO_RC               : 0 or an error code

[Functions] CalypsoCardSelectApplication

NAME

   CalypsoCardSelectApplication

DESCRIPTION

   Select the Calypso application

WARNING

   This function is not supported by Rev.1 cards

INPUTS

   CALYPSO_CTX_ST  *ctx     : library context
   const BYTE      aid[]    : AID of the application to select, possibly right truncated
   CALYPSO_SZ      aidsize  : length of the AID
   BYTE            fci[]    : buffer to receive the FCI of the selected application
   CALYPSO_SZ      *fcisize : input  = size of the FCI buffer
                              output = actual length of the FCI

RETURNS

   CALYPSO_RC               : 0 or an error code

NOTES

   If aid is NULL, the function will be performed using "1TIC.ICA" as default AID.
   On success, the FCI is parsed, you may access its content using
   - CalypsoCardRevision
   - CalypsoCardDFName
   - CalypsoCardSerialNumber
   - CalypsoCardMaxSessionUpdates

[Functions] CalypsoCardSelectDF

NAME

   CalypsoCardSelectDF

DESCRIPTION

   Select a DF

INPUTS

   CALYPSO_CTX_ST *ctx      : library context
   WORD           file_id   : identifier of the file
   BYTE           resp[]    : buffer to receive the response to select
   CALYPSO_SZ     *respsize : input  = size of the response buffer
                              output = actual length of the response

RETURNS

   CALYPSO_RC               : 0 or an error code

[Functions] CalypsoCardSelectEF

NAME

   CalypsoCardSelectEF

DESCRIPTION

   Select an EF under current DF

INPUTS

   CALYPSO_CTX_ST *ctx      : library context
   WORD           file_id   : identifier of the file
   BYTE           resp[]    : buffer to receive the response to select
   CALYPSO_SZ     *respsize : input  = size of the response buffer
                              output = actual length of the response

RETURNS

   CALYPSO_RC               : 0 or an error code

[Functions] CalypsoCardSelectFile

NAME

   CalypsoCardSelectFile

DESCRIPTION

   Select an EF or a DF (or the MF)

INPUTS

   CALYPSO_CTX_ST *ctx      : library context
   DWORD          file_id   : identifier of the file (see below)
   BYTE           resp[]    : buffer to receive the response to select
   CALYPSO_SZ     *respsize : input  = size of the response buffer
                              output = actual length of the response

RETURNS

   CALYPSO_RC               : 0 or an error code

NOTES

   file_id is a DWORD (4 bytes) value constructed as follow :
   - 0x0000XXXX : selects EF with ID XXXX under current DF
   - 0xYYYYXXXX : selects EF with ID XXXX under DF with ID YYYY
   - 0x00000000 : selects the Master File

Generated from calypso_card_read.c on Mon Aug 18 16:38:26 2014