{"id":31427207,"url":"https://github.com/entur/tlv-pull-parser","last_synced_at":"2025-09-30T07:02:19.944Z","repository":{"id":280534461,"uuid":"939654271","full_name":"entur/tlv-pull-parser","owner":"entur","description":"TLV pull-parser for the JVM","archived":false,"fork":false,"pushed_at":"2025-09-11T11:25:24.000Z","size":102,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-11T13:30:39.814Z","etag":null,"topics":["emv","java","mastercard","mts7","tlv","visa"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/entur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-26T22:14:59.000Z","updated_at":"2025-09-11T10:51:47.000Z","dependencies_parsed_at":"2025-03-04T00:28:17.093Z","dependency_job_id":"22e11841-753b-4c07-8e37-5d779dabbf4a","html_url":"https://github.com/entur/tlv-pull-parser","commit_stats":null,"previous_names":["entur/tlv-pull-parser"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/entur/tlv-pull-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Ftlv-pull-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Ftlv-pull-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Ftlv-pull-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Ftlv-pull-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/entur","download_url":"https://codeload.github.com/entur/tlv-pull-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Ftlv-pull-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277644028,"owners_count":25852786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-30T02:00:09.208Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emv","java","mastercard","mts7","tlv","visa"],"created_at":"2025-09-30T07:00:43.951Z","updated_at":"2025-09-30T07:02:19.932Z","avatar_url":"https://github.com/entur.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tlv-pull-parser\nThis project hosts a TLV parser and a few utilities for working with TLV content from smart cards. \n\n * Efficient TLV pull-parser\n   * reusable instances\n   * minimal/zero object creation\n   * simple drill-down support \n     * code structure mirrors TLV data structure\n * Customizable TLV pretty-printer\n \nThe project has zero dependencies.\n\n# License\n[European Union Public Licence v1.2](https://eupl.eu/).\n\n# Usage\nGet your APDU response, then create a parser:\n\n```java\nbyte[] responseApdu = ...\n\nLenientTlvPullParser pullParser = new LenientTlvPullParser(responseApdu, 0, responseApdu.length - 2);\n```\n\nand note that parser instances are reusable. \n\nIterate over tags\n\n```java\ndo {\n  int tag = pullParser.nextTag();\n  if(tag == -1) {\n    break;\n  }\n  // your code here\n} while(true);\n```\n\nThe parser does not automatically go into child containers (i.e. like a JSON pull parser would), drill down must be done manually.  \n\nFor targeting a structure like \n\n```\n6F 56 -- Template, File Control Parameters and File Management Data (FCI)\n      84 07 -- Dedicated File (DF) Name\n            A0 00 00 00 04 10 10\n      A5 4B -- File Control Information (FCI) Proprietary Template\n            50 10 -- Application Label\n                  Debit Mastercard\n```\n\ndrill down the built-in payload parser chaining:\n\n```java\nLenientTlvPullParser rootTemplate = pullParser.parseTagLengthValuePayload(0x6F); // skip to tag + drill down\nif(rootTemplate != null) {\n  LenientTlvPullParser proprietaryTemplate = rootTemplate.parseTagLengthValuePayload(0xA5); // skip to tag + drill down\n  if(proprietaryTemplate != null) {\n     // process application label and so on\n  }\n}\n```\n\nwhere each call to `parseTagLengthValuePayload` returns a child `LenientTlvPullParser` which works on the same buffer, \nbut with different offsets. Consuming all child parser contents before accessing the parent parser again is not necessary. \n\n# Release\nRelease version is determined from the latest release tag. Add `[major|minor|patch]` to the commit message to control version increment. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentur%2Ftlv-pull-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fentur%2Ftlv-pull-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentur%2Ftlv-pull-parser/lists"}