MoBIB
The MoBIB container facilitates communication with card readers and inserted MoBIB smart cards. The T1C-JLIB client library provides functionality to communicate with the smart card and facilitates integration into a native or Java application. This document describes the functionality provided by the MoBIB container on the T1C-GCL (Generic Connector Library).
Get MoBIB container object
For more information on how to configure the T1C-JLIB client library see Client Configuration. Initialize a gclClient:
LibConfig conf = new LibConfig();
conf.setEnvironment(Environment.DEV);
conf.setDsUri(DS_URI);
conf.setOcvUri(OCV_URI);
conf.setGclClientUri(URI_T1C_GCL);
conf.setApiKey(API_KEY);
conf.setHardwarePinPadForced(false);
conf.setDefaultPollingIntervalInSeconds(5);
conf.setDefaultPollingTimeoutInSeconds(10);
conf.setSessionTimeout(60);
T1cClient t1cClient = new T1cClient(conf);
Obtain the GclReader object
The constructor for the MoBIB containers expects a valid reader-object as parameter. A reader-object can be obtained from the exposed core functionality, for more information see Core Services. Core services responds with available card-readers, available card in a card-reader, etc. For example: In order to get all connected card-readers, with available cards:
List<GclReader> reader = t1cClient.getCore().getReadersWithInsertedCard();
This function call returns a list of the following objects:
com.t1t.t1c.GclReader
Name | Description | Example Value | Type |
---|---|---|---|
id |
The reader ID | "57a3e2e71c48cee9" | java.lang.String |
name |
The reader name | "Bit4Id miniLector" | java.lang.String |
pinpad |
The presence of a hardware PIN-pad | false | java.lang.Boolean |
card |
The inserted card | see below | com.t1t.t1c.core.GclCard |
com.t1t.t1c.GclCard
Name | Description | Example Value | Type |
---|---|---|---|
atr |
Answer to Reset | "3B6F0000805A2C23C310100511000111829000" | java.lang.String |
description |
List of descriptions | ["MOBIB Card"] | java.util.List<java.lang.String> |
We notice that a card object is available in the response in the context of a detected reader.
The reader in the example above is Bit4id miniLector
, has no pin-pad capabilities, and there is a card detected with given ATR and description "MOBIB Card". An ATR (Answer To Reset) identifies the type of a smart-card.
The container must be instantiated with the GclReader object containing the MoBIB card:
MobibContainer container = client.getMobibContainer(reader);
All methods for the mobib
container will use the selected reader - identified by the reader
-object.
Card data
Status
The MoBIB card can be locked, this means that application(s) on the MoBIB card have been locked by operators. To retrieve this information, the status of the MoBIB card can be requested. Note that this is not related to the expiry date of the card. The service can be called:
Boolean activated = container.getStatus();
Response:
java.lang.Boolean
Card Issuing
The MoBIB card contains a information about the holder of the card.
The service can be called:
GclMobibCardIssuing cardIssuing = container.getCardIssuing();
Response:
com.t1t.t1c.containers.smartcards.mobib.GclMobibCardIssuing
Name | Description | Example Value | Type |
---|---|---|---|
cardExpirationDate |
The card expiration date | "2016-01-31" | java.lang.String |
cardHolderBirthDate |
The card holder's birth date | "1964-07-23" | java.lang.String |
cardHolderEndDate |
The card holder end date | "2016-01-31" | java.lang.String |
cardHolderId |
The card holder id | "6060575401800002365" | java.lang.String |
cardHolderName |
The card holder name | "MIAO- ERH WANG LIU " | java.lang.String |
cardHolderStartDate |
The card holder start date | "2012-02-11" | java.lang.String |
cardRevalidationDate |
The card revalidation date | "2012-02-10" | java.lang.String |
cardType |
The card type | 1 | java.lang.Integer |
companyId |
The company ID | 18 | java.lang.Integer |
gender |
The gender code | 1 | java.lang.Integer |
language |
The language code | 2 | java.lang.Integer |
version |
The version | 1 | java.lang.Integer |
Picture
Contains the card holder's picture stored on the smart card. The service can be called:
String picture = container.getPicture();
Response:
"/9j/4AAQSkZJRgABA...59aVpcklSDzyKUTEDGK//9k="
Contracts
The MoBIB card can contains contracts written by the operators (e.g. SNCB, De Lijn, MIVB, TEC).
The service can be called:
List<GclMobibContract> contracts = container.getContracts();
Response:
com.t1t.t1c.containers.smartcards.mobib.GclMobibContract
Name | Description | Example Value | Type |
---|---|---|---|
authenticatorKvc |
The authenticator KVC | 17 | java.lang.Integer |
authenticatorValue |
The authenticator value | 587 | java.lang.Integer |
journeyInterchangesAllowed |
Journey interchanges allowed flag | true | java.lang.Boolean |
operatorMap |
The operator map | 15 | java.lang.Integer |
passengersMax |
The maximum amount of passengers | 7 | java.lang.Integer |
priceAmount |
The price | 500 | java.lang.Integer |
provider |
The provider | 1 | java.lang.Integer |
restrictCode |
The restrict code | 5 | java.lang.Integer |
restrictTime |
The restrict time | 2 | java.lang.Integer |
saleDate |
The sale date | "2014-03-06 | java.lang.String |
saleSamCount |
The sale SAM count | 15 | java.lang.Integer |
saleSamId |
The sale SAM ID | 25 | java.lang.Integer |
spatials |
List of spatials | See below | java.util.List<com.t1t.t1c.containers.smartcards.mobib.GclMobibSpatial> |
tariff |
The tariff | See below | com.t1t.t1c.containers.smartcards.mobib.GclMobibTariff |
typeId |
The type ID | 15373 | java.lang.Integer |
validityDuration |
The validity duration | See below | com.t1t.t1c.containers.smartcards.mobib.GclMobibValidityDuration |
validityStartDate |
The validity start date | "2014-03-06" | java.lang.String |
vehicleClassAllowed |
The vehicle class that is allowed | 1 | java.lang.Integer |
version |
The version | 4 | java.lang.Integer |
com.t1t.t1c.containers.smartcards.mobib.GclMobibSpatial
Name | Description | Example Value | Type |
---|---|---|---|
routeOrigin |
The route origin | 1 | java.lang.Integer |
type |
The type | 15 | java.lang.Integer |
com.t1t.t1c.containers.smartcards.mobib.GclMobibTariff
Name | Description | Example Value | Type |
---|---|---|---|
counter |
The counter data | See below | com.t1t.t1c.containers.smartcards.mobib.GclMobibCounter |
multimodal |
The multimodal flag | true | java.lang.Boolean |
nameRef |
The name reference | 3 | java.lang.Integer |
com.t1t.t1c.containers.smartcards.mobib.GclMobibCounter
Name | Description | Example Value | Type |
---|---|---|---|
time |
The time | "2017-02-21T06:20:00" | java.lang.String |
type |
The type | 2 | java.lang.Integer |
journeys |
The journeys | 0 | java.lang.Integer |
com.t1t.t1c.containers.smartcards.mobib.GclMobibValidityDuration
Name | Description | Example Value | Type |
---|---|---|---|
unit |
The unit | 3 | java.lang.Integer |
value |
The value | 3 | java.lang.Integer |
Data Filter
Filter Card Data
All data on the smart card can be dumped at once, or using a filter. In order to read all data at once:
GclMobibAllData allData = container.getAllData();
Response:
Name | Description | Example Value | Type |
---|---|---|---|
active |
The activation status | true | java.lang.Boolean |
cardIssuing |
The card issuing data | See above | com.t1t.t1c.containers.smartcards.mobib.GclMobibCardIssuing |
contracts |
The card contracts | See above | java.util.List<com.t1t.t1c.containers.smartcards.mobib.GclMobibContract> |
picture |
The picture | "" | java.lang.String |
The filter can be used to ask a list of custom data containers. For example, we want to read only the 'rn', 'picture' and 'rrn certificate':
List<String> filter = Arrays.asList("status","card-issuing");
// Or retrieve available data filters as follows:
// filter = container.getAllDataFilters();
GclMobibAllData allData = container.getAllData(filter);