Amadis

Agnos for COTS - Class

Agnos class (Main API)

Create a agnos instance linked to an android activity

Constructors:

class Agnos(listener: DevListener, context: Context? = null, activity: Activity)

Properties:

  • olaAgnosVersions: val olaAgnosVersions: String

  • olaApiVersion: val olaApiVersion: String

  • olaImplementationVersion: val olaImplementationVersion: String

Parameters:

  • listener: Device listener to catch events/signals from low level

  • context: Application context (Android)

  • activity: Application main Activity (Android)

Functions:

Name

Declaration

Explication

Return

Parameters

Name

Declaration

Explication

Return

Parameters

exportCardData

fun exportCardData(): ByteArray

Export sensitive card data encrypted with the card data encryption key from KML2 storage

a ByteArray composed of:

  • 2 bytes indicating the key_blob length (LSB)

  • key_blob (encrypted with KEK, PKCS#7 padding)

  • 2 bytes indicating the encrypted data length (LSB)

  • followed by an AES-CBC-128/256 encrypted buffer containing a TLV stream of sensitive tags

 

exportHashedPAN

fun exportHashedPAN(): ByteArray

Export a PAN token generated by a SHA256

a ByteArray composed of:

  • 2 bytes indicating the hashed PAN length (LSB)

  • hashed PAN

 

exportKCV

fun exportKCV(): ByteArray

Export the encryption key KCV

a ByteArray composed of:

  • 2 bytes indicating the KCV length (LSB)

  • KCV

 

initialize

@JvmOverloads
fun initialize(checkNFC: Boolean = true)

Initialization routine

 

  • checkNFC: check at init that NFC adapter is present and enabled (default = true)

olaArkosAsysInit

fun olaArkosAsysInit(obj: Any, path: String)

Arkos initialization function

 

  • obj: init data contained object (null for now)

  • path: configuration files path (where the configuration files will be created)

olaContactlessAddAIDSupported

fun olaContactlessAddAIDSupported(  aid: AID, partial: Boolean, kernelId: Byte, tlv: ByteArray): OlaError

Add one AID supported to configuration. Must be called before ola_contactless_preprocess()

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_MAX_REACHED

  • OlaError.OLA_PARAM_ERROR

  • OlaError.OLA_ERROR

  • aid: Max 16 bytes

  • partial: allow partial selection with this AID when building candidate list

  • kernelId:on one byte, identifies the kernel to be used when selected later (useful for Carte Bancaire)

  • tlv: combination

olaContactlessAddDRLSupported

fun olaContactlessAddDRLSupported(    programId: ByteArray,     transactionLimit: BCD?,     floorLimit: BCD?,     CVMLimit: BCD?,     doCheckStatus: Boolean,     isZeroAllowed: Boolean,     kernelId: Int): OlaError

Add one DRL (Dynamic Reader Limit) supported to configuration.

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_MAX_REACHED

  • OlaError.OLA_PARAM_ERROR

  • OlaError.OLA_ERROR

  • programId: Program ID, max 16 bytes (one byte for XPressPay)

  • transactionLimit: contactless transaction limit, 6 bytes BCD

  • floorLimit: contactless floor limit, 6 bytes BCD (null if no value)

  • CVMLimit: contactless CVM limit, 6 bytes BCD; (null if no value)

  • doCheckStatus: for PayWave only: allow status check

  • isZeroAllowed: for PayWave only: allow zero amount

  • kernelId: on one byte, identifies the kernel using the DRL; it can be 3 (PayWave) or 4 (XPressPay)

olaContactlessBuildCandidateList

fun olaContactlessBuildCandidateList(nbCandidates: Holders.SingleObjectHolder<Int>): OlaError

Build the candidate list of common AID between the card and the configuration, in order of priority

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_NO_CANDIDATE

  • OlaError.OLA_CARD_ERROR

  • OlaError.OLA_ERROR

  • nbCandidates: output parameter for how many candidates are in the list

olaContactlessClean

fun olaContactlessClean()

Clean the contactless context

 

 

olaContactlessCommitSupportedAIDs

fun olaContactlessCommitSupportedAIDs()

Commit added AID and DRL supported in configuration

 

 

olaContactlessDoTransaction

fun olaContactlessDoTransaction(): OlaError

Perform the Contactless transaction after the AID is selected and configured (First step is building the PDOL and sending the GPO command)

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_PARAM_ERROR

 

olaContactlessFinalSelectCandidate

fun olaContactlessFinalSelectCandidate(candidate: Int, kernelId: Holders.SingleObjectHolder<Byte>): OlaError

Send the final select to the card for a candidate in the candidate list

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_PARAM_ERROR

  • OlaError.OLA_CARD_BLOCKED

  • OlaError.OLA_CARD_ERROR

  • OlaError.OLA_ERROR

  • candidate: an occurrence in candidate list, value must be from 1 to nb_candidates

  • kernelId: the kernel Id that will be activated for this candidate

olaContactlessFlushAIDSupported

fun olaContactlessFlushAIDSupported()

Erase all AID supported from configuration

 

 

olaContactlessGetCardPreferredLanguage

fun olaContactlessGetCardPreferredLanguage( resultHolder: Holders.SingleObjectHolder<CharArray>): OlaError

Get the preference language for the card holder. It's the first match between the card preferred languages list and terminal languages supported, or, when this match does not occur, the first occurrence of terminal languages supported

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_ERROR

  • resultHolder: preferred language in ISO 639-1 format (two ASCII character)

olaContactlessGetErrorIndicator

fun olaContactlessGetErrorIndicator( errorIndicatorHolder: Holders.SingleObjectHolder<OlaErrorIndicator>): OlaError

Get the error indicator structure Contactless transaction context

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_ERROR

  • errorIndicatorHolder: error indicator container

olaContactlessGetOutcome

fun olaContactlessGetOutcome(outcomeHolder: Holders.SingleObjectHolder<OlaOutcomeParameter>): OlaError

Get the outcome from the Contactless transaction context Values based on EMV Co Book A Annex B (standards outcomes) or as specified elsewhere in Book B (for entry point outcome) or in Books C (specifics for different schemes)

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_ERROR

  • outcomeHolder: outcome container

olaContactlessGetTagFromCandidate

fun olaContactlessGetTagFromCandidate(candidate: Int,tag: Int, resultHolder: Holders.SingleObjectHolder<ByteArray>): OlaError

Get a tag from a candidate in the candidate list

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_MISSING_DATA

  • OlaError.OLA_PARAM_ERROR

  • OlaError.OLA_ERROR

  • candidate: an occurrence in candidate list, value must be from 1 to nb_candidates

  • tag: EMV tag number

  • resultHolder: tag value will be written here

olaContactlessGetUIRequestRestart

fun olaContactlessGetUIRequestRestart(uiRequestHolder: Holders.SingleObjectHolder<OlaUiRequest>): OlaError

Get the UI request on restart from the Contactless transaction context

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_ERROR

  • uiRequestHolder: UI request container

olaContactlessGetUIRequestUponOutcome

fun olaContactlessGetUIRequestUponOutcome(uiRequestHolder: Holders.SingleObjectHolder<OlaUiRequest>): OlaError

Get the UI request on outcome from the Contactless transaction context

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_ERROR

  • uiRequestHolder: UI request container

olaContactlessPreprocess

fun olaContactlessPreprocess(): OlaError

Perform preprocessing

Possible values including but not limited to:

  • OlaError.OLA_OK : at least on scheme can be used with contactless technology

  • OlaError.OLA_ERROR

 

olaEmvGetCVMResults

fun olaEmvGetCVMResults(cvm: Holders.SingleObjectHolder<OlaCvmEmv?>): OlaError

Get the CVM from the EMV transaction context

Possible return values:

  • OlaError.OLA_OK

  • OlaError.OLA_MISSING_DATA (No CVM Results yet)

  • OlaError.OLA_ERROR

  • cvm: (out) CVM results - not modified if result is not OlaError.OLA_OK

olaEmvGetTag

fun olaEmvGetTag(tag: Int, resultHolder: Holders.SingleObjectHolder<ByteArray>): OlaError

Get a tag from the Contactless transaction context Input parameter

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_MISSING_DATA

  • OlaError.OLA_PARAM_ERROR

  • tag: EMV tag number

  • resultHolder: the value of the tag

olaEmvSetTag

fun olaEmvSetTag(tag: Int, value: ByteArray): OlaError

Set a tag in the Contactless transaction context

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_ERROR

  • tag: EMV tag number

  • value: EMV tag value

olaInitializeAtStartUp

fun olaInitializeAtStartUp(tlv: ByteArray): OlaError

Initialize OLA implementation

Possible return values:

  • OlaError.OLA_OK

  • OlaError.OLA_PARAM_ERROR

  • tlv: Tag objects containing specific tags for a specific L2 stack

olaPublicKeyAdd

fun olaPublicKeyAdd(key: PublicKeyData, checksum: ByteArray?, wasMaxReached_holder: Holders.SingleObjectHolder<Boolean>): OlaError

Add one public key to configuration.

Possible values including but not limited to:

  • OlaError.OLA_PUBLIC_KEY_OK

  • OlaError.OLA_PUBLIC_KEY_ERROR

  • key: key to add

  • checksum: on 20 bytes

  • wasMaxReached_holder: maximum number of keys reached

olaPublicKeyCommit

fun olaPublicKeyCommit(): OlaError

Added function for Agnos configuration interface based on files

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_ERROR

  • OlaError.OLA_NOT_IMPLEMENTED : Ignored. CAKeys is built on the fly, key by key

 

olaPublicKeyFind

fun olaPublicKeyFind(soughtKey: OlaPublicKey, checksum: ByteArray): OlaError

Find a public key in configuration

Possible values including but not limited to:

  • OlaError.OLA_PUBLIC_KEY_OK

  • OlaError.OLA_PUBLIC_KEY_MISSING

  • OlaError.OLA_PUBLIC_KEY_ERROR

  • soughtKey: key to research

  • checksum: //20 bytes

olaPublicKeyFlush

fun olaPublicKeyFlush()

Erase all EMV public keys configuration configuration

 

 

olaPublicKeyGetNextID

fun olaPublicKeyGetNextID( startFromBeginning: Boolean, idxHolder: Holders.SingleObjectHolder<Byte>, ridHolder: Holders.SingleObjectHolder<Byte>): OlaError

Get next public key identification in configuration

Possible values including but not limited to:

  • OlaError.OLA_OK

  • OlaError.OLA_ERROR

  • OlaError.OLA_NOT_IMPLEMENTED : Ignored. Not used in OLA for Agnos kernel

  • startFromBeginning: starting point

  • idxHolder: index

  • ridHolder: RID

setCardCommTimeout

fun setCardCommTimeout(cardCommTimeout: Int)

Set cardCommTimeout member value

 

  • cardCommTimeout: card communication timeout in milliseconds

setDisplayToast

fun setDisplayToast(displayToast: Boolean)

Set displayToast member value

 

  • displayToast: active/deactivate Toast messages display

setFullForward

fun setFullForward(fullForward: Boolean)

set fullForward member value

 

  • fullForward: event handling mode

true : all events (including NFC related one) will be sent to the listener

false : NFC related events will be handled by the Dev class

setKeyIn

fun setKeyIn(keyIn: Boolean)

Set keyIn member value

 

  • keyIn:allow key check during APDU exchange (cancel)

setListener

fun setListener(listener: DevListener)

Set listener to received events and requests from low level

 

  • listener: class which will listen and receive the events/requests

setPerformRemoval

fun setPerformRemoval(removal: Boolean)

Set removal flag

 

  • removal: whether removal should be performed or not

setReleaseAdapter

fun setReleaseAdapter(releaseAdapter: Boolean)

Set releaseAdapter member value

 

  • releaseAdapter: release NFC adapter at the end of transaction

technoPolling

fun technoPolling(timeout: Int): Int

Card detection function

-1 if error occurred, value of found technos otherwise:

  • 0x01 : TECHNO_CL_ANY

  • 0x04 : TECHNO_CL_TYPE_EMV

  • 0x20 : TECHNO_MANUAL

  • 0x40 : TECHNO_CONTACT

  • 0x80 : TECHNO_MAGSTRIPE

  • timeout: (in seconds)

terminate

fun terminate()

Terminate low level thread.

 

 

Â