{"id":13621609,"url":"https://github.com/go-piv/go-ykpiv","last_synced_at":"2026-01-11T23:00:55.311Z","repository":{"id":45725736,"uuid":"89027886","full_name":"go-piv/go-ykpiv","owner":"go-piv","description":"Golang interface to manage Yubikeys, including a crypto.Signer \u0026 crypto.Decrypter interface","archived":false,"fork":false,"pushed_at":"2025-07-22T20:53:02.000Z","size":133,"stargazers_count":224,"open_issues_count":10,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-08-14T04:18:29.924Z","etag":null,"topics":["cryptography","golang","library","ykpiv","yubikey"],"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/go-piv.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":"AUTHORS","dei":null}},"created_at":"2017-04-21T22:18:41.000Z","updated_at":"2025-07-19T00:31:47.000Z","dependencies_parsed_at":"2024-02-24T10:34:00.899Z","dependency_job_id":"d29f2529-a131-4387-9eaf-814c30e3a1a8","html_url":"https://github.com/go-piv/go-ykpiv","commit_stats":null,"previous_names":["paultag/go-ykpiv"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/go-piv/go-ykpiv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-piv%2Fgo-ykpiv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-piv%2Fgo-ykpiv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-piv%2Fgo-ykpiv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-piv%2Fgo-ykpiv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-piv","download_url":"https://codeload.github.com/go-piv/go-ykpiv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-piv%2Fgo-ykpiv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["cryptography","golang","library","ykpiv","yubikey"],"created_at":"2024-08-01T21:01:08.614Z","updated_at":"2026-01-11T23:00:55.258Z","avatar_url":"https://github.com/go-piv.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"go-ykpiv\n========\n\ngo-ykpiv is a high level cgo wrapper around `libykpiv.so.1` that implements an\nidiomatic go API fit for use when applications need to communicate with a\nYubikey in PIV mode.\n\nWhat's PIV?\n-----------\n\nPIV Cards are cards defined by FIPS 201, a Federal US Government standard\ndefining the ID cards employees use. At its core, it's a set of x509\nCertificates and corresponding private keys in a configuration that is\nstandardized across implementations.\n\nFor more details on how PIV Tokens can be used, the FICAM\n(Federal Identity, Credential, and Access Management) team at GSA\n(General Services Administration) has published some guides on GitHub\nunder [GSA/piv-guides](https://github.com/GSA/piv-guides)\n\nHow is this different than OpenSC?\n----------------------------------\n\nMost PIV tokens, Yubikeys included, can be used as a PKCS#11 device using\n[OpenSC](https://github.com/opensc/opensc), and Yubikeys are even capable of doing\nSigning and Decryption through that interface. However, some management functions\nare not exposed in the PKCS#11 OpenSC interface, so this library may be of use\nwhen one wants to write a new Certificate, or set PINs.\n\nDevelopment\n===========\n\nTesting\n-------\n\nTo run the tests, you'll need to find a Yubikey that you're willing to wipe\nclean, and destroy all data on it. After you've found such a key, remove all\nother Yubikeys from your machine.\n\nThe tests will panic if the `YKPIV_YES_DESTROY_MY_KEY` environment variable\nis unset.\n\nRunning the tests will **reset** your Yubikey a few times (once per test), and\nyou will wind up with a key with the default PIN, PUK and Management Key.\n\nInstallation\n============\n\nDebian\n------\n\n```\nsudo apt install build-essential libykpiv-dev\ngo get pault.ag/go/ykpiv\n```\n\nMacOS X\n------\n\n```\nbrew install yubico-piv-tool\ngo get pault.ag/go/ykpiv\n```\n\nExamples\n========\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"pault.ag/go/ykpiv\"\n)\n\nfunc main() {\n\tyubikey, err := ykpiv.New(ykpiv.Options{\n\t\t// Verbose: true,\n\t\tReader: \"Yubico Yubikey NEO U2F+CCID 01 00\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer yubikey.Close()\n\n\tversion, err := yubikey.Version()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Printf(\"Application version %s found.\\n\", version)\n}\n```\n\nRunning on Windows\n==================\n1. Download `yubico-piv-tool-1.7.0-win64.zip` from the official site\n2. Create directory win in the root of the project\n3. Copy `lib` and `include` directories from the downloaded archive to the `win` directory\n4. Copy all DLLs  from the `bin` directory in the archive to the root of your project\n5. Copy `libwinpthread-1.dll` from `C:\\TDM-GCC-64\\bin` to the root of your project\n\nRelated work\n============\n\nEric Chiang has published [piv-go](https://github.com/ericchiang/piv-go),\na go implementation of the yubikey piv bindings.\n\n\nLICENSE\n=======\n\n```\nCopyright (c) Paul R. Tagliamonte \u003cpaultag@gmail.com\u003e, 2017\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-piv%2Fgo-ykpiv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-piv%2Fgo-ykpiv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-piv%2Fgo-ykpiv/lists"}