Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ola

See ola.h

#include

Code Block
languagec
#include "ola_tags_dictionary.h"
#include "ola_emv.h" /// Generic EMV API
#include "ola_publickey.h" /// Generic Public Key configuration API
#include "ola_contactless.h" /// Generic Contacless Processing API
#include "ola_contact.h" /// Generic Contact Processing API

--

#define

Code Block
languagec
#define OLA_API_VERSION "2.1.6"

Current OLA version.

logf_function

Code Block
languagec
typedef void (*logf_function)(char* str);

Callback definition used by L2 stack to trace its execution. That logging function is defined above OLA API (for example, by the L3) and called from OLA implementation or below.

ola_get_api_version

Code Block
languagec
const char *ola_get_api_version(void);

Gets OLA Interface version.

ola_get_implementation_version

Code Block
languagec
const char *ola_get_implementation_version(void);

Get OLA Implementation version. Whereas OLA Interface is independant for any L2, its implementation depends on underlying SDK. For example, if using Agnos Framework, possible implementations could be AGF 3.5.x, or AGF 3.3.x. Today, other available implementations are on AMP, Castles, and PAX terminals.

ola_initialize_at_start_up

Code Block
languagec
tOLAError ola_initialize_at_start_up(uint8_t *tlv, uint16_t tlvLength);

Set specific internal states related to a given OLA implementation. For example, if using Agnos Framework, the TLV is a serialization of the following structure:

Code Block
languagec
typedef struct {
    /** Path to all configuration files (must end with '/') */
	uint8_t path[MAX_PATH_LENGTH]; // DF01
    /** CAKeys full path file name -  */
	uint8_t cakeys[MAX_PATH_LENGTH]; // DF02
    /** CRL full path file name */
	uint8_t crl[MAX_PATH_LENGTH]; // DF03
    /** EFL full path file name */
	uint8_t efl[MAX_PATH_LENGTH]; // DF04
    /** PCSC readers full path file name (.ini) */
	uint8_t pcsc[MAX_PATH_LENGTH]; // DF05
    /** Languages full path file name (.ini) */
	uint8_t lang[MAX_PATH_LENGTH]; // DF06
    /**
     * Runtime parameters
     *
     * Byte 1 - DEFAULT TXN TYPE (tag 9C)
     * Byte 2 - LEGACY SELECTION BITMAP
     * |  bit 8  7  6  5  4  3  2  1
     * |      x                       Legacy ZIP
     * |         x                    Legacy PayPass
     * |            x                 Legacy Amex
     * |               x              Legacy JCB
     * |                  x           Legacy CUP
     * |                     x        Legacy DPAS
     * |                        x     Legacy Visa
     * |                           -  RFU
     * Byte 3 - STACK PARAMETER BITMAP 1/2
     * |  bit 8  7  6  5  4  3  2  1
     * | x                       Contactless - AlwaysReceipt
     * |    x                    Agnos - CL
     * |       x                 Contactless - TransactionLooping
     * |          x              Contactless - KeyIn
     * |             x           Contactless - Signal
     * |                x        Callback - DE
     * |                   x     Agnos - APDULog
     * |                      x  Agnos - UIDisplay
     * Byte 4 - STACK PARAMETER BITMAP 2/2
     * |  bit 8  7  6  5  4  3  2  1
     * | x                       Agnos - Replay
     * |    x                    Agnos - IDMessageDisplay
     * |       x                 Agnos - TagDump
     * |          x              Contactless - DigitalSignal
     * |             -           RFU
     * |                -        RFU
     * |                   -     RFU
     * |                      -  RFU
     * Byte 5 - POLLING TIMEOUT (s)
     * Byte 6 - TRACE DEPTH (0 to 6)
     * Byte 7 - DEFAULT LANGUAGE
     */
    uint8_t params[RUNTIME_PARAM_LENGTH]; // DF07
    /** Trace level */
    uint8_t trace_level; // DF08

} tAgnosIni;

ola_set_trace_function

Code Block
languagec
void ola_set_trace_function(logf_function fct);

Set logging callback.

ola_emv

See ola_emv.h

#include

Code Block
languagec
#include <stdint.h>

--

tOLAError

Code Block
languagec
typedef enum
{
	OLA_OK,
	OLA_CARD_MUTE,
	OLA_CARD_BLOCKED,
	OLA_MAX_REACHED,
	OLA_NO_CANDIDATE,
	OLA_CONTACT_NEW_SELECTION,
	OLA_CONTACT_SELECTION_ERROR,
	OLA_CONDITIONS_NOT_SATISFIED,
	OLA_ACCEPTED,
	OLA_NOT_ACCEPTED,
	OLA_OFFLINE_ACCEPTED,
	OLA_OFFLINE_DECLINED,
	OLA_GO_ONLINE,
	OLA_DECLINED,
	OLA_MISSING_DATA,
	OLA_PINPAD_ERROR,
	OLA_PARAM_ERROR,
	OLA_NOT_IMPLEMENTED,
	OLA_ERROR,
	OLA_CARD_ERROR,
	OLA_CANCEL,
	OLA_PUBLIC_KEY_OK,
	OLA_PUBLIC_KEY_MISSING,
	OLA_PUBLIC_KEY_MAX_REACHED,
	OLA_PUBLIC_KEY_END,
	OLA_PUBLIC_KEY_ERROR,
	OLA_CARD_REMOVED
} tOLAError;

--

tOlaEMVCoCVM

Code Block
languagec
typedef enum
{
    cvmNone,
    cvmNoCvm,
    cvmSignature,
    cvmOnlinePin,
    cvmOnlinePin_Signature,
    cvmOfflinePinPlaintext,
    cvmOfflinePinPlaintext_Signature,
    cvmOfflinePinCiphered,
    cvmOfflinePinCiphered_Signature
} tOlaEMVCoCVM;

--

ola_emv_set_tag

Code Block
languagec
tOLAError ola_emv_set_tag(
	uint32_t tag,
    uint8_t *value,
    uint16_t length
);

Set an EMV tag

ola_emv_get_tag

Code Block
languagec
tOLAError ola_emv_get_tag(
	uint32_t tag,
    uint8_t *value,
    uint16_t *length
);

Get an EMV tag

ola_emv_get_cvm_results

Code Block
languagec
tOLAError ola_emv_get_cvm_results(
	tOlaEMVCoCVM *cvm
);

Get CVM result

ola_contact

See ola_contact.h

#include

Code Block
languagec
#include "ola_emv.h"
#include <stdint.h>

--

tOlaModeContactTransaction

Code Block
languagec
typedef enum
{
    metUndef = 0,
    metFull,
    metExtractPAN,
    metUnknown
} tOlaModeContactTransaction;

ola_contact_flush_aid_supported

Code Block
languagec
void ola_contact_flush_aid_supported(void);

ola_contact_answer_to_reset

Code Block
languagec
tOLAError ola_contact_answer_to_reset(const char* reader);

ola_contact_add_aid_supported

Code Block
tOLAError  ola_contact_add_aid_supported(
		const uint8_t *aid,
	    uint8_t aidLength,
		int partial
);

ola_contact_build_candidate_list

Code Block
tOLAError ola_contact_build_candidate_list(
		uint8_t *nb_candidates,
	    int *pse
);

ola_contact_get_tag_from_candidate

Code Block
languagec
tOLAError ola_contact_get_tag_from_candidate(
		uint8_t candidate,
	    uint32_t tag,
		uint8_t *value,
	    uint16_t *length
);

ola_contact_final_select_candidate

Code Block
languagec
tOLAError ola_contact_final_select_candidate(uint8_t candidate);

ola_contact_initiate_transaction

Code Block
languagec
tOLAError ola_contact_initiate_transaction(
		tOlaModeContactTransaction mode
);

ola_contact_complete_transaction

Code Block
languagec
tOLAError ola_contact_complete_transaction(
		const uint8_t *authorResponseCode,
	    const uint8_t *issuerAuthenticationData,
	    uint8_t issuerAuthenticationData_length
);

ola_contact_clean

Code Block
languagec
void  ola_contact_clean(void);

...

ola_publickey

See ola_publickey.h

This module provides a set of primitives to manage public key certifcates (CAPK) used in EMV to support the Offline Data Authentication (ODA) process.

#include

Code Block
languagec
#include "ola.h"
#include <stdint.h>

--

tOlaPubKey

Code Block
languagec
typedef struct
{
    uint8_t rid[5];
    uint8_t idx[1];
    uint8_t modulusLen;
    uint8_t modulusValue[248];
    uint8_t exponentLen;
    uint8_t exponentValue[3];
    uint8_t expirDate[3];
} tOlaPubKey;

OLA’s CAPK definition.

ola_pubkey_flush

Code Block
void ola_pubkey_flush(void);

Reset L2 stack’s CAPK. Depending on OLA implementation, it corresponds to emptying CAPK files in flash or zeroing a specific structure in RAM. After that call, no CAPK are store by L2 stack.

ola_pubkey_add

Code Block
tOLAError ola_pubkey_add(
        const tOlaPubKey *key,
        const uint8_t *checksum
);

Add a CAPK into L2 stack’s. OLA Implementation creates a copy of key for further use. The checksum is optional (may be NULL) and corresponds to a SHA-1 of the tOlaPubKey instance refered by key.

ola_pubkey_find

Code Block
tOLAError ola_pubkey_find(
		tOlaPubKey *key,
        uint8_t *checksum
);

Look up for a specific CAPK. The checksum is optional (may be NULL) and corresponds to a SHA-1 of the tOlaPubKey instance refered by key.

ola_pubkey_get_next_id

Code Block
tOLAError ola_pubkey_get_next_id(
        uint8_t *idx,
        uint8_t *rid,
        int start
);

CAPK iterator. Use start = 1 to iterate from the beginning.

ola_pubkey_commit

Code Block
tOLAError ola_pubkey_commit(void);

Persist all previously added CAPK. Depending on OLA Implementation, it might be required to add all CAPK in a first step, then commit them in a second step for further use. This is typically dependent on L2 stack design.

...