.. include:: ../abbreviations.txt .. _asn1_data_reading_formatting: ASN.1 data reading formatting ============================= To permit use of API with ease, read data from smartcard through :js:func:`Token.readFile` is parsed in |JSON|. Indeed, since Data Groups and other files described in ICAO specifications are in |ASN.1|, their content represents precise and structured data. Thus, following javascript codes are possible: .. code-block:: javascript // read DG 1 and log issuing state myToken.readFile(ICAO.FILE_ID.DG_1).then(function(data){ console.log("issuing state: " + data.content.issuingState); }); >> issuing state: UTO .. code-block:: javascript // read EF.COM and log tag of present DGs myToken.readFile(ICAO.FILE_ID.EF_COM).then(function(data){ console.log("present DGs tag: " + data.content.dataGroupTagList); }); >> present DGs tag: 97,117,99,118,101,102,103,104,105,107,108,109,111 Generally, guidelines of *International Telecommunication Union X.697* (ITU-T X.697) specifications are followed to convert ASN.1 into JSON. However, due to a lack of information or technical choice, some *specificities* are described in this document. .. toctree:: :hidden: ASN1_JSON_rules ASN1_specificities