4. Key Exchange — downloadAndInjectKeys()

This method contacts the UNISWITCH TMS, downloads the terminal master keys bound to the device's hardware serial number, and injects them into the PIN-pad security module.

downloadAndInjectKeys()

pos.downloadAndInjectKeys {
    success,
    terminalId,
    errorMessage ->

    if (success) {
        Log.d(TAG,
            "Terminal ID: $terminalId")
    } else {
        Log.e(TAG,
            "Key exchange failed: $errorMessage")
    }
}
pos.downloadAndInjectKeys((success, terminalId, errorMessage) -> {
    if (success) {
        Log.d(TAG, "Terminal ID: " + terminalId);
    } else {
        Log.e(TAG, "Key exchange failed: " + errorMessage);
    }
});
ℹ️
NOTE Re-call downloadAndInjectKeys() on application startup or at least once per day.

Callback Parameters

Parameter Type Description
success Boolean True if keys were downloaded and injected successfully.
terminalId String? The terminal ID assigned by the UNISWITCH TMS. Null on failure.
errorMessage String? Human-readable error description. Null on success.