{"id":51848120,"url":"https://github.com/keycard-tech/keycard-rs","last_synced_at":"2026-07-23T15:30:32.387Z","repository":{"id":370695003,"uuid":"1251970490","full_name":"keycard-tech/keycard-rs","owner":"keycard-tech","description":"Keycard Rust SDK","archived":false,"fork":false,"pushed_at":"2026-07-10T08:54:09.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-10T10:13:22.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/keycard-tech.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-28T04:26:36.000Z","updated_at":"2026-07-10T08:54:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/keycard-tech/keycard-rs","commit_stats":null,"previous_names":["keycard-tech/keycard-rs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/keycard-tech/keycard-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keycard-tech%2Fkeycard-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keycard-tech%2Fkeycard-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keycard-tech%2Fkeycard-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keycard-tech%2Fkeycard-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keycard-tech","download_url":"https://codeload.github.com/keycard-tech/keycard-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keycard-tech%2Fkeycard-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35807555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"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":[],"created_at":"2026-07-23T15:30:31.447Z","updated_at":"2026-07-23T15:30:32.370Z","avatar_url":"https://github.com/keycard-tech.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keycard-rs\n\nRust port of the Status Keycard Java library. Provides a complete API for\ninteracting with Status Keycard hardware security modules via APDU commands\nover PC/SC transport.\n\n## Features\n\n- Full APDU command set for Keycard operations (signing, key management, PIN, etc.)\n- Secure Channel V1 and V2 with automatic version detection\n- PC/SC smart card transport (via the `pcsc` crate)\n- BIP32 key derivation and export\n- BIP39 mnemonic support\n- ECDSA signature recovery\n- NDEF data storage\n- Pinless signing path\n\n## Installation\n\nAdd the crate to your `Cargo.toml`:\n\n```toml\n[dependencies]\nkeycard-rs = { git = \"https://github.com/keycard-tech/keycard-rs\" }\n```\n\nThe `pcsc` feature is enabled by default. Disable it if you provide your own\n`CardChannel` implementation:\n\n```toml\nkeycard-rs = { git = \"https://github.com/keycard-tech/keycard-rs\", default-features = false }\n```\n\n## Usage\n\n### Connecting and selecting the applet\n\n```rust\nuse keycard_rs::{KeycardCommandSet, PcscChannel};\n\nlet channel = PcscChannel::connect()?;\nlet mut keycard = KeycardCommandSet::new(channel);\n\nlet response = keycard.select()?;\nassert!(response.is_ok());\n\nlet info = keycard.app_info().expect(\"app_info should be set after SELECT\");\n```\n\n### Pairing and opening a secure channel\n\n```rust\n// Pair with a password (V1 only)\nif keycard.secure_channel_version() == Some(SecureChannelVersion::V1) {\n    keycard.auto_pair(\"KeycardDefaultPairing\")?;\n}\n\n// Open the secure channel (V1 and V2)\nif info.has_secure_channel() {\n    keycard.auto_open_secure_channel()?;\n}\n```\n\n### Verifying PIN and signing\n\n```rust\nkeycard.verify_pin(\"000000\")?;\n\nlet hash: [u8; 32] = [\n    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,\n    0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,\n    0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,\n    0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,\n];\n\nlet sign_resp = keycard.sign_with_path(\u0026hash, \"m/44'/60'/0'/0/0\", false)?;\n```\n\n### Loading a key and exporting a public key\n\n```rust\nuse keycard_rs::parsing::{Bip32KeyPair, Mnemonic};\n\nlet mnemonic = \"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\";\nlet seed = Mnemonic::binary_seed_from_phrase(mnemonic, \"\");\nkeycard.load_key(\u0026seed)?;\n\nlet export_resp = keycard.export_key(\"m/44'/60'/0'/0/0\", false, true)?;\nlet key_pair = Bip32KeyPair::from_tlv(export_resp.data())?;\nlet public_key = key_pair.public_key();\n```\n\n### Verifying a signature\n\n```rust\nuse keycard_rs::parsing::RecoverableSignature;\n\nlet sig = RecoverableSignature::from_card_response(\u0026hash, sign_resp.data())?;\nassert_eq!(sig.public_key(), public_key);\n```\n\n### Custom transport\n\nImplement the `CardChannel` trait to use a different transport layer:\n\n```rust\nuse keycard_rs::{ApduCommand, ApduResponse, CardChannel, Error};\n\nstruct MyChannel { /* ... */ }\n\nimpl CardChannel for MyChannel {\n    fn send(\u0026mut self, cmd: \u0026ApduCommand) -\u003e Result\u003cApduResponse, Error\u003e {\n        // transmit APDU and return response\n        todo!()\n    }\n\n    fn is_connected(\u0026self) -\u003e bool {\n        todo!()\n    }\n}\n```\n\n## Integration tests\n\nThe repository includes integration tests that communicate with a real Keycard.\nThey require a physically connected card and smart card reader, and are marked\nwith `#[ignore]`.\n\nRun all integration tests:\n\n```text\ncargo test --test integration -- --ignored\n```\n\nRun a specific test with output:\n\n```text\ncargo test --test integration full_sign_flow -- --ignored --nocapture\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeycard-tech%2Fkeycard-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeycard-tech%2Fkeycard-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeycard-tech%2Fkeycard-rs/lists"}