{"id":37988392,"url":"https://github.com/skythen/apdu","last_synced_at":"2026-01-16T18:41:11.243Z","repository":{"id":55512315,"uuid":"323727584","full_name":"skythen/apdu","owner":"skythen","description":"Go  APDU","archived":false,"fork":false,"pushed_at":"2022-03-03T01:26:20.000Z","size":64,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T18:12:36.887Z","etag":null,"topics":["apdu","golang","iso7816","smartcard"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skythen.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}},"created_at":"2020-12-22T20:35:13.000Z","updated_at":"2024-01-25T09:48:25.000Z","dependencies_parsed_at":"2022-08-15T02:10:22.744Z","dependency_job_id":null,"html_url":"https://github.com/skythen/apdu","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/skythen/apdu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skythen%2Fapdu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skythen%2Fapdu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skythen%2Fapdu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skythen%2Fapdu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skythen","download_url":"https://codeload.github.com/skythen/apdu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skythen%2Fapdu/sbom","scorecard":{"id":830823,"data":{"date":"2025-08-11","repo":{"name":"github.com/skythen/apdu","commit":"a39ff370d2f305eb9f976bd50c2398db36cf2fd7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/22 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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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"}}]},"last_synced_at":"2025-08-23T17:45:21.524Z","repository_id":55512315,"created_at":"2025-08-23T17:45:21.525Z","updated_at":"2025-08-23T17:45:21.525Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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":["apdu","golang","iso7816","smartcard"],"created_at":"2026-01-16T18:41:10.386Z","updated_at":"2026-01-16T18:41:11.209Z","avatar_url":"https://github.com/skythen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APDU\n\n[![Build Status](https://travis-ci.org/skythen/apdu.svg?branch=master)](https://travis-ci.org/skythen/apdu)\n[![Coverage Status](https://coveralls.io/repos/github/skythen/apdu/badge.svg)](https://coveralls.io/github/skythen/apdu)\n[![GoDoc](https://godoc.org/github.com/skythen/apdu?status.svg)](http://godoc.org/github.com/skythen/apdu)\n[![Go Report Card](https://goreportcard.com/badge/github.com/skythen/apdu)](https://goreportcard.com/report/github.com/skythen/apdu)\n\nPackage apdu implements parsing and conversion of Application Protocol Data Units (APDU) which is the communication\nformat between a card and off-card applications. The format of the APDU is defined\nin [ISO specification 7816-4](https://www.iso.org/obp/ui/#iso:std:iso-iec:7816:-4:en).\n\nThe package has support for extended length APDUs as well.\n\n`go get github.com/skythen/apdu`\n\n## Capdu\n\n### Create\n\nYou can create a Capdu either by creating a Capdu struct:\n\n```go\n  capduCase1 := Capdu{Cla: 0x00, Ins: 0xAB, P1: 0xCD, P2: 0xEF}\n  capduCase2 := Capdu{Cla: 0x80, Ins: 0xCA, P1: 0x00, P2: 0x66, Ne: 256}\n  capduCase3 := Capdu{Cla: 0x80, Ins: 0xF2, P1: 0xE0, P2: 0x02, Data: []byte{0x4F, 0x00}, Ne: 256}\n  capduCase4 := Capdu{Cla: 0x00, Ins: 0xAA, P1: 0xBB, P2: 0xCC, Data: make([]byte, 65535), Ne: 65536}\n```\n\n(please note that Ne is the expected length of response in bytes, not encoded as Le)\n\nor by parsing from bytes/strings:\n\n```go\n  bCapdu, err := apdu.ParseCapdu([]byte{0x80, 0xF2, 0xE0, 0x02, 0x02, 0x4F, 0x00, 0x00)\n  sCapdu, err := apdu.ParseCapduHexString(\"80F2E002024F0000\")\n```\n\n### Convert\n\n#### Bytes\n\nYou can convert a Capdu to its bytes representation with the Bytes() function. Case and format (standard/extended) are\ninferred and applied automatically.\n\n```go\n  b, err := capdu.Bytes()\n```\n\n#### String\n\nYou can convert a Capdu to its hex representation as well. The same rules apply as for conversion to bytes:\n\n```go\n  s, err := capdu.String()\n```\n\n### Utility\n\n#### IsExtendedLength\n\nUse IsExtendedLength to check if the CAPDU is of extended length (len of Data \u003e 65535 or Ne \u003e 65536):\n\n```go\n  ext := capdu.IsExtendedLength()\n```\n\n## Rapdu\n\n### Create\n\nYou can create a Rapdu either by creating a Rapdu struct:\n\n```go\n  r1 := Rapdu{SW1: 0x90, SW2: 0x00}\n  r2 := Rapdu{Data: []byte{0x01, 0x02, 0x03}, SW1: 0x90, SW2: 0x00}\n```\n\nor by parsing from bytes/strings:\n\n```go\n  r1, err := apdu.ParseRapdu([]byte{0x90, 0x00)\n  r2, err := apdu.ParseRapduHexString(\"0102039000\")\n```\n\n### Convert\n\n#### Bytes\n\nYou can convert a Rapdu to its bytes representation with the Bytes() function.\n\n```go\n  b, err := rapdu.Bytes()\n```\n\n#### String\n\nYou can convert a Rapdu to its hex representation as well.\n\n```go\n  s, err := rapdu.String()\n```\n\n### Utility\n\n#### Success/Warning/Error\n\nUse IsSuccess/IsWarning/IsError to check the response status.\n\n```go\n  if !rapdu.IsSuccess() {\n\t  ...\n  }\n\n  if rapdu.IsWarning() || rapdu.IsError(){\n      ...\n  }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskythen%2Fapdu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskythen%2Fapdu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskythen%2Fapdu/lists"}