{"id":21658403,"url":"https://github.com/dumacp/smartcard","last_synced_at":"2026-02-16T10:49:22.469Z","repository":{"id":37678006,"uuid":"146339613","full_name":"dumacp/smartcard","owner":"dumacp","description":"smartcard devices under the PCSC implementation","archived":false,"fork":false,"pushed_at":"2025-05-12T13:42:57.000Z","size":9723,"stargazers_count":28,"open_issues_count":4,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-17T23:16:00.357Z","etag":null,"topics":["contactless","go","golang","mifare","mifare-plus","nxp","samav2","smartcard"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dumacp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-08-27T18:45:48.000Z","updated_at":"2025-06-30T14:07:32.000Z","dependencies_parsed_at":"2023-10-01T23:37:53.957Z","dependency_job_id":"2373d4d5-5428-4062-a384-f73134a830af","html_url":"https://github.com/dumacp/smartcard","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/dumacp/smartcard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumacp%2Fsmartcard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumacp%2Fsmartcard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumacp%2Fsmartcard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumacp%2Fsmartcard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dumacp","download_url":"https://codeload.github.com/dumacp/smartcard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumacp%2Fsmartcard/sbom","scorecard":{"id":359535,"data":{"date":"2025-08-11","repo":{"name":"github.com/dumacp/smartcard","commit":"edf1da7a1ce9fdccde96529177c882e60221d0c3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T10:26:52.696Z","repository_id":37678006,"created_at":"2025-08-18T10:26:52.697Z","updated_at":"2025-08-18T10:26:52.697Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29506275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["contactless","go","golang","mifare","mifare-plus","nxp","samav2","smartcard"],"created_at":"2024-11-25T09:29:13.745Z","updated_at":"2026-02-16T10:49:22.438Z","avatar_url":"https://github.com/dumacp.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# smartcard\nsmartcard devices under the PCSC implementation\n\nImplementation for mifare smartcard family (Mifare Plus, Desfire, SamAV2, ...)\n\n## example 1 (SAMav2)\n```\npackage main\n\nimport (\n  \"log\"\n  \"strings\"\n  \"github.com/dumacp/smartcard\"\n  \"github.com/dumacp/smartcard/nxp/mifare\"\n)\n\nfunc main() {\n  ctx, err := smartcard.NewContext()\n  if err != nil {\n    log.Fatal(\"Not connection\")\n  }\n  defer ctx.Release()\n  readers, err := smartcard.ListReaders(ctx)\n  for i, el := range readers {\n    log.Printf(\"reader %v: %s\\n\", i, el)\n  }\n  samReaders := make([]smartcard.Reader,0)\n  for _, el := range readers {\n    if strings.Contains(el, \"SAM\") {\n      samReaders = append(samReaders, smartcard.NewReader(ctx, el))\n    }\n  }\n  for _, samReader := range samReaders {\n    sam, err := mifare.ConnectSamAv2(samReader)\n    if err != nil {\n      log.Printf(\"%s\\n\",err)\n      continue\n    }\n    version, err := sam.GetVersion()\n    if err != nil {\n      log.Fatalln(\"Not GetVersion: \", err)\n    }\n    log.Printf(\"GetVersion sam: % X\\n\", version)\n  }\n}\n```\n## example 2 (Mifare Plus SL3 auth)\n```\npackage main\n\nimport (\n\t\"log\"\n\t\"flag\"\n\t\"strings\"\n\t\"encoding/hex\"\n\t\"github.com/dumacp/smartcard\"\n\t\"github.com/dumacp/smartcard/nxp/mifare\"\n)\n\nvar keyS string\nvar keyNbr int\n\nfunc init() {\n        flag.StringVar(\u0026keyS, \"key\", \"00000000000000000000000000000000\", \"key aes128\")\n        flag.IntVar(\u0026keyNbr, \"keyNbr\", 0x4002, \"key Number\")\n}\n\nfunc main() {\n\tflag.Parse()\n\n\tkey, err := hex.DecodeString(keyS)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Printf(\"key: [% X]\\n\", key)\n\n\tctx, err := smartcard.NewContext()\n\tif err != nil {\n\t\tlog.Fatal(\"Not connection\")\n\t}\n\tdefer ctx.Release()\n\treaders, err := smartcard.ListReaders(ctx)\n\tfor i, el := range readers {\n\t\tlog.Printf(\"reader %v: %s\\n\", i, el)\n\t}\n\tmplusReaders := make([]smartcard.Reader,0)\n\tfor _, el := range readers {\n\t\tif strings.Contains(el, \"PICC\") {\n\t\t\tmplusReaders = append(mplusReaders, smartcard.NewReader(ctx, el))\n\t\t}\n\t}\n\tfor _, mplusReader := range mplusReaders {\n\t\tmplus, err := mifare.ConnectMplus(mplusReader)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"%s\\n\",err)\n\t\t\tcontinue\n\t\t}\n\t\tuid, err := mplus.UID()\n\t\tif err != nil {\n\t\t\tlog.Fatalln(\"ERROR: \", err)\n\t\t}\n\t\tlog.Printf(\"card UID: % X\\n\", uid)\n\n\t\tats, err := mplus.ATS()\n\t\tif err != nil {\n\t\t\tlog.Println(\"ERROR: \", err)\n\t\t}\n\t\tlog.Printf(\"card ATS: % X\\n\", ats)\n\n\t\tresp, err := mplus.FirstAuth(keyNbr,key)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Error: %s\\n\",err)\n\t\t}\n\t\tlog.Printf(\"Auth: % X\\n\", resp)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdumacp%2Fsmartcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdumacp%2Fsmartcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdumacp%2Fsmartcard/lists"}