AT-NFC 2.1 (win) AT-NFC kernel set

Typedefs | Functions
Kernel Transaction Structure usage API

Provides access to all emv transaction data. More...

## Typedefs
typedef struct tag_KER_TRAN | KER_TRAN
| Kernel internal transaction data structure. More...

## Functions
KER_BOOL KER_API | kerTranRelease (KER_CTX_PARAM KER_TRAN *pTran)
| Releases Transaction container structure. More...
KER_BOOL KER_API | kerTranGetDataByTag (KER_CTX_PARAM KER_TRAN *pTran, const KER_BYTE *pbtTag, KER_BYTE btTagLen, KER_BYTE *pbtData, KER_INT16U *pusDataLen, KER_INT16U usDataMax)
| Obtain tag value from transaction data structure. More...
KER_BOOL KER_API | kerTranGetCustDataByTag (KER_CTX_PARAM KER_TRAN *pTran, const KER_BYTE *pbtTag, KER_BYTE btTagLen, KER_BYTE *pbtData, KER_INT16U *pusDataLen, KER_INT16U usDataMax)
| Obtain tag value from to transaction data structure (from unrecognized/unexpected ICC data) More...
KER_BOOL KER_API | kerTranGetDataByDOL (KER_CTX_PARAM KER_TRAN *pTran, const KER_BYTE *pbtDol, KER_INT16U usDolLen, KER_BYTE *pbtData, KER_INT16U *pusDataLen, KER_INT16U usDataMax)
| Obtain data according to the DOL provided. More...
KER_BOOL KER_API | kerTranGetCardData (KER_CTX_PARAM KER_TRAN *pTran, const KER_BYTE *pbtTag, KER_BYTE btTagLen, KER_BYTE *pbtData, KER_INT16U *pusDataLen, KER_INT16U usDataMax)
| Obtain tag value from card by GET_DATA command. More...
KER_BOOL KER_API | kerTranGetScriptResults (KER_CTX_PARAM KER_TRAN *pTran, KER_BYTE *pbtData, KER_INT16U *pusDataLen, KER_INT16U usDataMax)
| Obtain data as tlv buffer by provided tag list. More...
KER_BOOL KER_API | kerTranGetScriptResultsRef (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usScriptIndex, KER_BYTE *pbtData, KER_INT16U *pusDataLen, KER_INT16U usDataMax)
| Obtain data as tlv buffer by provided tag list. More...
KER_INT16U KER_API | kerTranGetFlags (KER_CTX_PARAM KER_TRAN *pTran)
| Obtain some specific conditions as bitmask. More...
KER_INT16U KER_API | kerTranGetErrorFlags (KER_CTX_PARAM KER_TRAN *pTran)
| Obtain some specific errors as bitmask. More...
KER_INT16U KER_API | kerTranGetStatus (KER_CTX_PARAM KER_TRAN *pTran)
| Obtain transaction progress status. More...
#define | KER_TRAN_FL_SIGNATURE_CVM_REQUESTED 0x0001
#define | KER_TRAN_FL_APP_VER_MISMATCH 0x0002
#define | KER_TRAN_FL_TAA_OFFLINE_DECLINED 0x0004
#define | KER_TRAN_FL_TAA_ONLINE_REQUEST 0x0008
#define | KER_TRAN_FL_TAA_OFFLINE_APPROVE 0x0010
#define | KER_TRAN_FL_CAA_OFFLINE_DECLINED 0x0020
#define | KER_TRAN_FL_CAA_ONLINE_REQUEST 0x0040
#define | KER_TRAN_FL_CAA_OFFLINE_APPROVED 0x0080
#define | KER_TRAN_FL_TAA_DEFAULT_APPROVE 0x0100
#define | KER_TRAN_FL_TAA_DEFAULT_DECLINED 0x0200
#define | KER_TRAN_FL_CAA_SKIP_GAC2_BY_XDA 0x0400
#define | KER_TRAN_FL_ADVICE_REQUIRED 0x1000
#define | KER_TRAN_FL_SERVICE_NOT_ALLOWWED 0x2000
#define | KER_TRAN_FL_PIN_TRY_EXCEEDED 0x4000
#define | KER_TRAN_FL_ISS_AUTH_FAILED 0x8000
#define | KER_TRAN_ERR_FL_PAN_MISMATCH 0x0001
#define | KER_TRAN_ERR_FL_EXP_DATE_MISMATCH 0x0002
#define | KER_TRAN_ERR_FL_INV_AUTH_DATA 0x0004
#define | KER_TRAN_ERR_FL_PDOL_MAND_AMOUNT_MISSED 0x0008
#define | KER_TRAN_STAT_APP_SELECTED 0x0001
#define | KER_TRAN_STAT_PROC_INITIATED 0x0002
#define | KER_TRAN_STAT_READ_DATA 0x0004
#define | KER_TRAN_STAT_OFFLINE_AUTH 0x0008
#define | KER_TRAN_STAT_PROC_RESTR 0x0010
#define | KER_TRAN_STAT_CV 0x0020
#define | KER_TRAN_STAT_RISK_MANAGEMENT 0x0040
#define | KER_TRAN_STAT_CAA 0x0080
#define | KER_TRAN_STAT_ONLINE 0x0100

## Detailed Description

Provides access to all emv transaction data.

## Macro Definition Documentation

## ◆ KER_TRAN_ERR_FL_EXP_DATE_MISMATCH

#define KER_TRAN_ERR_FL_EXP_DATE_MISMATCH 0x0002

Exp Date (5F24) & track(57) mismatch

## ◆ KER_TRAN_ERR_FL_INV_AUTH_DATA

#define KER_TRAN_ERR_FL_INV_AUTH_DATA 0x0004

Set Issuer Auth Data failed due to invalid format

## ◆ KER_TRAN_ERR_FL_PAN_MISMATCH

#define KER_TRAN_ERR_FL_PAN_MISMATCH 0x0001

PAN (5A) & track (57) mismatch

## ◆ KER_TRAN_ERR_FL_PDOL_MAND_AMOUNT_MISSED

#define KER_TRAN_ERR_FL_PDOL_MAND_AMOUNT_MISSED 0x0008

Mandatory amount required by PDOL missed

## ◆ KER_TRAN_FL_ADVICE_REQUIRED

#define KER_TRAN_FL_ADVICE_REQUIRED 0x1000

Advice required by CID

## ◆ KER_TRAN_FL_APP_VER_MISMATCH

#define KER_TRAN_FL_APP_VER_MISMATCH 0x0002

app version mismatch

## ◆ KER_TRAN_FL_CAA_OFFLINE_APPROVED

#define KER_TRAN_FL_CAA_OFFLINE_APPROVED 0x0080

offline approved by CAA

## ◆ KER_TRAN_FL_CAA_OFFLINE_DECLINED

#define KER_TRAN_FL_CAA_OFFLINE_DECLINED 0x0020

offline declined by CAA

## ◆ KER_TRAN_FL_CAA_ONLINE_REQUEST

#define KER_TRAN_FL_CAA_ONLINE_REQUEST 0x0040

online request by CAA

## ◆ KER_TRAN_FL_CAA_SKIP_GAC2_BY_XDA

#define KER_TRAN_FL_CAA_SKIP_GAC2_BY_XDA 0x0400

skip GAC2 by XDA

## ◆ KER_TRAN_FL_ISS_AUTH_FAILED

#define KER_TRAN_FL_ISS_AUTH_FAILED 0x8000

Issuer authentication failed by CID

## ◆ KER_TRAN_FL_PIN_TRY_EXCEEDED

#define KER_TRAN_FL_PIN_TRY_EXCEEDED 0x4000

PIN Try Limit exceeded by CID

## ◆ KER_TRAN_FL_SERVICE_NOT_ALLOWWED

#define KER_TRAN_FL_SERVICE_NOT_ALLOWWED 0x2000

Service not allowed by CID

## ◆ KER_TRAN_FL_SIGNATURE_CVM_REQUESTED

#define KER_TRAN_FL_SIGNATURE_CVM_REQUESTED 0x0001

signature CVM requested

## ◆ KER_TRAN_FL_TAA_DEFAULT_APPROVE

#define KER_TRAN_FL_TAA_DEFAULT_APPROVE 0x0100

default approve requested by TAA

## ◆ KER_TRAN_FL_TAA_DEFAULT_DECLINED

#define KER_TRAN_FL_TAA_DEFAULT_DECLINED 0x0200

default declined by CAA

## ◆ KER_TRAN_FL_TAA_OFFLINE_APPROVE

#define KER_TRAN_FL_TAA_OFFLINE_APPROVE 0x0010

offline approve requested by TAA

## ◆ KER_TRAN_FL_TAA_OFFLINE_DECLINED

#define KER_TRAN_FL_TAA_OFFLINE_DECLINED 0x0004

offline decline by TAA

## ◆ KER_TRAN_FL_TAA_ONLINE_REQUEST

#define KER_TRAN_FL_TAA_ONLINE_REQUEST 0x0008

online request by TAA

## ◆ KER_TRAN_STAT_APP_SELECTED

#define KER_TRAN_STAT_APP_SELECTED 0x0001

after kerSelectApp completion

## ◆ KER_TRAN_STAT_CAA

#define KER_TRAN_STAT_CAA 0x0080

after kerCAA completion

## ◆ KER_TRAN_STAT_CV

#define KER_TRAN_STAT_CV 0x0020

after kerCV or kerSetOnlinePinResult success or failure completion

## ◆ KER_TRAN_STAT_OFFLINE_AUTH

#define KER_TRAN_STAT_OFFLINE_AUTH 0x0008

after kerOfflineAuth completion

## ◆ KER_TRAN_STAT_ONLINE

#define KER_TRAN_STAT_ONLINE 0x0100

after kerOnline completion

## ◆ KER_TRAN_STAT_PROC_INITIATED

#define KER_TRAN_STAT_PROC_INITIATED 0x0002

after kerInitAppProc completion

## ◆ KER_TRAN_STAT_PROC_RESTR

#define KER_TRAN_STAT_PROC_RESTR 0x0010

after kerProcRestrict completion

## ◆ KER_TRAN_STAT_READ_DATA

#define KER_TRAN_STAT_READ_DATA 0x0004

after kerReadAppData completion

## ◆ KER_TRAN_STAT_RISK_MANAGEMENT

#define KER_TRAN_STAT_RISK_MANAGEMENT 0x0040

after kerRiskManagement completion

## Typedef Documentation

## ◆ KER_TRAN

typedef struct tag_KER_TRAN KER_TRAN

Kernel internal transaction data structure.

Termial application should not parse it directly.

## Function Documentation

## ◆ kerTranGetCardData()

KER_BOOL KER_API kerTranGetCardData | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const KER_BYTE * | pbtTag,
|  | KER_BYTE | btTagLen,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataLen,
|  | KER_INT16U | usDataMax
| ) |  |

Obtain tag value from card by GET_DATA command.

Parameters

  [in] | pTran | - transaction data structure obtained by kerSelectApp
  [in] | pbtTag | - buffer tag value to obtain
  [in] | btTagLen | - pbtTlv buffer length
  [out] | pbtData | - pointer to obtain result data
  [out] | pusDataLen | - pointer to obtain result data length
  [in] | usDataMax | - pbtData buffer size

Returns
  KER_TRUE Success.
  KER_FALSE Tag not found or invalid parameter provided or buffer too small.

## ◆ kerTranGetCustDataByTag()

KER_BOOL KER_API kerTranGetCustDataByTag | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const KER_BYTE * | pbtTag,
|  | KER_BYTE | btTagLen,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataLen,
|  | KER_INT16U | usDataMax
| ) |  |

Obtain tag value from to transaction data structure (from unrecognized/unexpected ICC data)

Parameters

  [in] | pTran | - transaction data structure obtained by kerSelectApp
  [in] | pbtTag | - buffer tag value to obtain
  [in] | btTagLen | - pbtTlv buffer length
  [out] | pbtData | - pointer to obtain result data
  [out] | pusDataLen | - pointer to obtain result data length
  [in] | usDataMax | - pbtData buffer size

Returns
  KER_TRUE Success.
  KER_FALSE Tag not found or invalid parameter provided or buffer too small.

## ◆ kerTranGetDataByDOL()

KER_BOOL KER_API kerTranGetDataByDOL | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const KER_BYTE * | pbtDol,
|  | KER_INT16U | usDolLen,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataLen,
|  | KER_INT16U | usDataMax
| ) |  |

Obtain data according to the DOL provided.

Parameters

  [in] | pTran | - transaction data structure
  [in] | pbtDol | - buffer with DOL (set of TAG + LEN (1 byte))
  [in] | usDolLen | - pbtDol buffer length
  [out] | pbtData | - pointer to obtain result data
  [out] | pusDataLen | - pointer to obtain result data length
  [in] | usDataMax | - pbtData buffer size

Returns
  KER_OK Success.
  KER_FALSE Invalid parameter provided or buffer too small.

## ◆ kerTranGetDataByTag()

KER_BOOL KER_API kerTranGetDataByTag | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | const KER_BYTE * | pbtTag,
|  | KER_BYTE | btTagLen,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataLen,
|  | KER_INT16U | usDataMax
| ) |  |

Obtain tag value from transaction data structure.

Parameters

  [in] | pTran | - transaction data structure obtained by kerSelectApp
  [in] | pbtTag | - buffer tag value to obtain
  [in] | btTagLen | - pbtTlv buffer length
  [out] | pbtData | - pointer to obtain result data
  [out] | pusDataLen | - pointer to obtain result data length
  [in] | usDataMax | - pbtData buffer size

Returns
  KER_TRUE Success.
  KER_FALSE Tag not found or invalid parameter provided or buffer too small.

## ◆ kerTranGetErrorFlags()

KER_INT16U KER_API kerTranGetErrorFlags | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |

Obtain some specific errors as bitmask.

Parameters

  [in] | pTran | - transaction data structure

Returns
  Error bitmask (see KER_TRAN_ERR_FL_PAN_MISMATCH, etc...)

## ◆ kerTranGetFlags()

KER_INT16U KER_API kerTranGetFlags | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |

Obtain some specific conditions as bitmask.

Parameters

  [in] | pTran | - transaction data structure

Returns
  Conditions bitmask (see KER_TRAN_FL_SIGNATURE_CVM_REQUESTED, etc...)

## ◆ kerTranGetScriptResults()

KER_BOOL KER_API kerTranGetScriptResults | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataLen,
|  | KER_INT16U | usDataMax
| ) |  |

Obtain data as tlv buffer by provided tag list.

Parameters

  [in] | pTran | - transaction data structure
  [out] | pbtData | - pointer to obtain result data (optional, set KER_NULL if you don't need it)
  [out] | pusDataLen | - pointer to obtain script result data length
  [in] | usDataMax | - pbtData buffer size

Returns
  KER_OK Success.
  KER_FALSE Invalid parameter provided or buffer too small.

## ◆ kerTranGetScriptResultsRef()

KER_BOOL KER_API kerTranGetScriptResultsRef | ( | KER_CTX_PARAM KER_TRAN * | pTran,
|  | KER_INT16U | usScriptIndex,
|  | KER_BYTE * | pbtData,
|  | KER_INT16U * | pusDataLen,
|  | KER_INT16U | usDataMax
| ) |  |

Obtain data as tlv buffer by provided tag list.

Parameters

  [in] | pTran | - transaction data structure
  [in] | usScriptIndex | - index of script requested (starting from zero) in order, as scripts were processed by kernel
  [out] | pbtData | - pointer to obtain single script result
  [out] | pusDataLen | - pointer to obtain script result data length (5 bytes assumed, or 0 - if corresponding to usScriptIndex script results not found)
  [in] | usDataMax | - pbtData buffer size

Returns
  KER_OK Success.
  KER_FALSE Invalid parameter provided

## ◆ kerTranGetStatus()

KER_INT16U KER_API kerTranGetStatus | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |

Obtain transaction progress status.

Parameters

  [in] | pTran | - transaction data structure

Returns
  Status bitmask (see KER_TRAN_STAT_APP_SELECTED, etc...)

## ◆ kerTranRelease()

KER_BOOL KER_API kerTranRelease | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |

Releases Transaction container structure.

Parameters

  [in] | pTran | - pointer to the transaction structure to release

Returns
  KER_TRUE Success.
  KER_FALSE Failure. Execution failed due to invalid param or memory error.