{"id":26867493,"url":"https://github.com/nullisxyz/apdu","last_synced_at":"2025-03-31T05:17:22.314Z","repository":{"id":285084277,"uuid":"946862330","full_name":"nullisxyz/apdu","owner":"nullisxyz","description":"Primitives for smart card interactions in Rust","archived":false,"fork":false,"pushed_at":"2025-03-29T11:15:54.000Z","size":222,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T12:23:17.345Z","etag":null,"topics":["apdu","cryptography","keycard","rust","smartcard"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/nullisxyz.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}},"created_at":"2025-03-11T19:42:45.000Z","updated_at":"2025-03-29T11:15:56.000Z","dependencies_parsed_at":"2025-03-29T12:33:43.103Z","dependency_job_id":null,"html_url":"https://github.com/nullisxyz/apdu","commit_stats":null,"previous_names":["nullisxyz/apdu"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullisxyz%2Fapdu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullisxyz%2Fapdu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullisxyz%2Fapdu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullisxyz%2Fapdu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullisxyz","download_url":"https://codeload.github.com/nullisxyz/apdu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418648,"owners_count":20773938,"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","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","cryptography","keycard","rust","smartcard"],"created_at":"2025-03-31T05:17:21.809Z","updated_at":"2025-03-31T05:17:22.304Z","avatar_url":"https://github.com/nullisxyz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nexum-apdu: Smart Card APDU in Rust\n\nnexum-apdu is a comprehensive toolkit for smart card communication in Rust using the APDU (Application Protocol Data Unit) protocol. Whether you're building a payment terminal, identity verification system, or HSM integration, nexum-apdu provides the foundation for secure card communications.\n\n[![docs.rs](https://img.shields.io/docsrs/nexum-apdu-core/latest)](https://docs.rs/nexum-apdu-core)\n[![Crates.io](https://img.shields.io/crates/v/nexum-apdu-core)](https://crates.io/crates/nexum-apdu-core)\n\nUnlock the cryptographic conversations that smart cards are dying to have with nexum-apdu as your trusted interpreter.\n\n## Installation\n\nThe easiest way to get started is to add the core crate:\n\n```sh\ncargo add nexum-apdu-core\n```\n\nFor PC/SC reader support, add:\n\n```sh\ncargo add nexum-apdu-transport-pcsc\n```\n\nFor GlobalPlatform card management:\n\n```sh\ncargo add nexum-apdu-globalplatform\n```\n\nFor APDU command/response pair macro support:\n\n```sh\ncargo add nexum-apdu-macros\n```\n\n## Overview\n\nThis repository contains the following crates:\n\n- [`nexum-apdu-core`]: Core traits and types for APDU operations\n- [`nexum-apdu-macros`]: Procedural macros for defining APDU commands and responses\n- [`nexum-apdu-transport-pcsc`]: PC/SC transport implementation for card readers\n- [`nexum-apdu-globalplatform`]: GlobalPlatform card management functionality\n\n[`nexum-apdu-core`]: https://github.com/nullisxyz/apdu/tree/main/crates/core\n[`nexum-apdu-macros`]: https://github.com/nullisxyz/apdu/tree/main/crates/macros\n[`nexum-apdu-transport-pcsc`]: https://github.com/nullisxyz/apdu/tree/main/crates/pcsc\n[`nexum-apdu-globalplatform`]: https://github.com/nullisxyz/apdu/tree/main/crates/globalplatform\n\n## Features\n\n- 🎯 **Abstracted transport layer** supporting different card reader types\n- 🛡️ **Secure channel support** for GlobalPlatform SCP02 protocol\n- 🧩 **Modular architecture** allowing use of only what you need\n- 📦 **Command processor pipeline** for flexible transformations\n- 📝 **Declarative command definitions** with the `apdu_pair!` macro\n- 🔄 **Response chaining support** for handling complex responses\n- 🐧 **no_std compatibility** for embedded environments (WIP)\n\n## Documentation \u0026 Examples\n\nFor detailed documentation on each crate, please check their individual README files:\n\n- [nexum-apdu-core README](./crates/core/README.md) - Core APDU abstractions and types\n- [nexum-apdu-macros README](./crates/macros/README.md) - Procedural macros for command/response definition\n- [nexum-apdu-transport-pcsc README](./crates/pcsc/README.md) - PC/SC transport implementation\n- [nexum-apdu-globalplatform README](./crates/globalplatform/README.md) - GlobalPlatform operations\n\n### Example Applications\n\nCheck out these examples to see nexum-apdu in action:\n\n- [Connect to a reader](./crates/pcsc/examples/connect.rs) - Basic card connection and communication\n- [List available readers](./crates/pcsc/examples/list_readers.rs) - Enumerate connected card readers\n- [APDU shell](./crates/pcsc/examples/apdu_shell.rs) - Interactive APDU command interpreter\n- [Monitor card events](./crates/pcsc/examples/monitor_events.rs) - Track card insertion/removal events\n- [Select an application by AID](./crates/pcsc/examples/select_aid.rs) - Select applications using their AID\n- [Install a CAP file](./crates/globalplatform/examples/install_cap.rs) - Install Java Card applications\n\nFor more examples, see the `examples` directory in each crate.\n\n## Architecture\n\nnexum-apdu is built around three main architectural layers:\n\n### Transport Layer\n\nThe `CardTransport` trait handles the low-level communication with cards, providing a clean abstraction over different physical transport mechanisms.\n\n### Command Processor Layer\n\nCommand processors can transform, secure, or log APDU commands before they reach the transport layer, allowing for modular protocol implementations like secure channels.\n\n### Executor Layer\n\nExecutors manage the complete command execution flow, combining transports and processors to provide a high-level interface for applications.\n\n## Note on `no_std` Support\n\nWhile significant work has been done to make nexum-apdu compatible with `no_std` environments, this support is still a work in progress. The core crate has a `no_std` feature flag that can be enabled, but extensive testing in embedded environments has not yet been conducted.\n\n```toml\n[dependencies]\nnexum-apdu-core = { version = \"0.1.0\", default-features = false }\n```\n\n## Credits\n\nThis project builds upon the work done in:\n\n- [`apdu-rs`](https://github.com/siketyan/apdu-rs) by [Naoki Ikeguchi](https://crates.io/users/siketyan), which provided initial inspiration and concepts\n- [`globalplatformpro`](https://github.com/martinpaljak/GlobalPlatformPro) by Martin Paljak for the GlobalPlatform protocol reference implementation\n\n## License\n\nLicensed under the MIT License.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crates by you shall be licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullisxyz%2Fapdu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullisxyz%2Fapdu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullisxyz%2Fapdu/lists"}