{"id":880,"date":"2018-10-04T17:05:09","date_gmt":"2018-10-04T17:05:09","guid":{"rendered":"http:\/\/open-cells.com\/?page_id=880"},"modified":"2018-10-04T17:05:09","modified_gmt":"2018-10-04T17:05:09","slug":"uicc-tutorial","status":"publish","type":"page","link":"https:\/\/open-cells.com\/index.php\/uicc-tutorial\/","title":{"rendered":"UICC tutorial"},"content":{"rendered":"<h1>What is a UICC ?<\/h1>\n<p>The USIM is telecom application inside a UICC.<\/p>\n<p>UICC is a tiny\u00a0 computer, common to all smart cards: telecom, banking, \u2026<\/p>\n<p>The interface is a serial link, with only one pin for both Tx and Rx, so it is half duplex.<\/p>\n<p>To interface UICC with a computer, a USB\/serial converter is the current solution. It could be two flavors: direct dialog over the serial link or a protocol called PC\/SC.<\/p>\n<p>As 3GPP describes the actual dialog (no PC\/SC encapsulation). We choose to use this direct interface between our SW ans the UICC (see our commercial page about SIM cards readers).<\/p>\n<p>In our reader, the converter is a Prolific PL2303 chip. So, the car reader is seen as a serial\/USB converter in Linux (or other OS). It doesn\u2019t require any additional driver.<\/p>\n<p>Opening the serial link connects us directly to the UICC Tx\/Rx pin. By this connection, we can send\/receive data to a UICC card.<\/p>\n<h1>UICC dialog<\/h1>\n<p>The dialog is master\/slave: the card only answer to requests.<\/p>\n<p>The requests are called \u201cAPDU\u201d, see <a href=\"https:\/\/en.wikipedia.org\/wiki\/Smart_card_application_protocol_data_unit\">wikipedia doc<\/a><\/p>\n<p>The APDU for telecom application are described in ETSI and 3GPP standards.<\/p>\n<p>Most dialogs implements a \u201cfile system\u201d concept: 3GPP defined UICC embedded files. The files are in directories as we do in computers.<\/p>\n<p>The UICC file system specific concepts:<\/p>\n<ul class=\"ili-indent\">\n<li>file names, directory names are only 2 bytes (no explicit label)<\/li>\n<li>rich file types: regular binary type, record based type, circular type<\/li>\n<li>powerful access control features<\/li>\n<\/ul>\n<p>Some orders doesn\u2019t implement \u201cfile system\u201d design pattern: specific APDU calls, for example, 3GPP authentication.<\/p>\n<p>A more complex UICC facility is to download applications in the card. These applications are written in a java (\u201cjavacard\u201d flavor). Java application are not useful for regular 4G subscription and authentication.<\/p>\n<h1>Typical 4G smartphone example<\/h1>\n<p>Power (or reset) the UICC. The card answer with a structured word called \u201cATR\u201d (answer to reset). This ATR tells us the card features and supplier identification.<br \/>\nThe commands subset used by regular mobile phones is implemented in a pure standard way by all card suppliers.<\/p>\n<p>Nevertheless, 3GPP defines some parts as only examples, to free proprietary implementations, like a operator that would use his own algorithm instead of \u201cMilenage\u201d. Also, most suppliers have their own implementation for the operator provisioning parts (this is the case for our UICC).<\/p>\n<p>The second order to the UICC will be to select a directory under the root directory.<\/p>\n<p>GSM SIM, 3G\/4G USIM, IMS IMSI, \u2026 have their own directories.<\/p>\n<p>Example: APDU=a0a40000023f00<\/p>\n<ul>\n<li>a0 is GSM class<\/li>\n<li>a4 is select directory<\/li>\n<li>0000 are always defined APDU syntax parameters, we don\u2019t need values in this case<\/li>\n<li>02 is the length of the following data<\/li>\n<li>3f00 is the name of the GSM directory, defined by 3GPP<\/li>\n<\/ul>\n<p>The we have to read the card answer, it should be: 9f17, that 3GPP defined as the success answer in <a href=\"http:\/\/www.etsi.org\/deliver\/etsi_gts\/11\/1111\/05.03.00_60\/gsmts_1111v050300p.pdf\">GSM 11.11<\/a> standardization document<\/p>\n<p>All of this is simple, but there is two painful issues:<\/p>\n<p>proprietary commands per supplier for card configuration<\/p>\n<p>each file content encoding is specific, described in big documents:<\/p>\n<p>From physical interface to root files (above telecom application): <a href=\"http:\/\/www.etsi.org\/deliver\/etsi_ts\/102200_102299\/102221\/13.01.00_60\/ts_102221v130100p.pdf\">ETSI standard<\/a><\/p>\n<p>Our application: USIM files are defined in: <a href=\"http:\/\/www.3gpp.org\/ftp\/\/Specs\/archive\/31_series\/31.102\/\">3GPP standard<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is a UICC ? The USIM is telecom application inside a UICC. UICC is a tiny\u00a0 computer, common to all smart cards: telecom, banking, \u2026 The interface is a serial link, with only one pin for both Tx and Rx, so it is half duplex. To interface UICC with a computer, a USB\/serial converter &hellip; <a href=\"https:\/\/open-cells.com\/index.php\/uicc-tutorial\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;UICC tutorial&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","footnotes":""},"class_list":["post-880","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/pages\/880","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/comments?post=880"}],"version-history":[{"count":1,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/pages\/880\/revisions"}],"predecessor-version":[{"id":881,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/pages\/880\/revisions\/881"}],"wp:attachment":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/media?parent=880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}