{"id":15825936,"url":"https://github.com/42wim/sshsig","last_synced_at":"2025-04-16T01:26:37.385Z","repository":{"id":49475364,"uuid":"430119255","full_name":"42wim/sshsig","owner":"42wim","description":"Go library to create/verify armored SSH signatures (https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.sshsig)","archived":false,"fork":false,"pushed_at":"2024-08-18T00:07:57.000Z","size":28,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-06T09:40:56.920Z","etag":null,"topics":["go","signature","ssh","ssh-agent","ssh-agent-sign"],"latest_commit_sha":null,"homepage":"","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/42wim.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":"2021-11-20T14:05:36.000Z","updated_at":"2024-08-18T00:08:00.000Z","dependencies_parsed_at":"2024-10-05T09:40:46.715Z","dependency_job_id":"b6d47c27-1252-4282-ba38-4849d46b2534","html_url":"https://github.com/42wim/sshsig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42wim%2Fsshsig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42wim%2Fsshsig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42wim%2Fsshsig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42wim%2Fsshsig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42wim","download_url":"https://codeload.github.com/42wim/sshsig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249181123,"owners_count":21225848,"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":["go","signature","ssh","ssh-agent","ssh-agent-sign"],"created_at":"2024-10-05T09:40:36.100Z","updated_at":"2025-04-16T01:26:37.371Z","avatar_url":"https://github.com/42wim.png","language":"Go","readme":"# Armored ssh signatures in go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/42wim/sshsig.svg)](https://pkg.go.dev/github.com/42wim/sshsig#section-documentation)\n\nPackage sshsig implements signing/verifying armored SSH signatures.\nYou can use this package to sign data and verify signatures using your ssh private keys or your ssh agent.\nIt gives the same output as using `ssh-keygen`, eg when signing `ssh-keygen -Y sign -f keyfile -n namespace data`\n\nThis code is based upon work by \u003chttps://github.com/sigstore/rekor\u003e\n\nReferences: \u003chttps://github.com/openssh/openssh-portable/blob/master/PROTOCOL.sshsig\u003e\n\nYou can find some examples on how to use this library on: \u003chttps://pkg.go.dev/github.com/42wim/sshsig#pkg-examples\u003e\n\n## Examples\n\n```golang\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\n\t\"github.com/42wim/sshsig\"\n\t\"golang.org/x/crypto/ssh/agent\"\n)\n\nfunc ExampleSignWithAgent() {\n\t// This example will panic when you don't have a ssh-agent running.\n\tconn, err := net.Dial(\"unix\", os.Getenv(\"SSH_AUTH_SOCK\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tag := agent.NewClient(conn)\n\n\t// This public key must match in your agent (use `ssh-add -L` to get the public key)\n\tpubkey := []byte(`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAo3D7CGN01tTYY/dLKXEv8RxRyxa32c51X0uKMhnMab wim@localhost`)\n\t//\n\tdata := []byte(\"hello world\")\n\n\tres, err := sshsig.SignWithAgent(pubkey, ag, bytes.NewBuffer(data), \"file\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(string(res))\n}\n\nfunc ExampleSign() {\n\tprivkey := []byte(`-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\nQyNTUxOQAAACCOjP6i4Pm/pYAAmpAMNZ6xrbHl9RW8xdul6kzIWuKMMAAAAIhoQm34aEJt\n+AAAAAtzc2gtZWQyNTUxOQAAACCOjP6i4Pm/pYAAmpAMNZ6xrbHl9RW8xdul6kzIWuKMMA\nAAAEBfIl93TLj6qHeg37GnPuZ00h8OVv1mzlhy0rhuO4Y0do6M/qLg+b+lgACakAw1nrGt\nseX1FbzF26XqTMha4owwAAAAAAECAwQF\n-----END OPENSSH PRIVATE KEY-----`)\n\n\tdata := []byte(\"hello world\")\n\n\tres, err := sshsig.Sign(privkey, bytes.NewBuffer(data), \"file\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(string(res))\n\n\t// Output:\n\t// -----BEGIN SSH SIGNATURE-----\n\t// U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgjoz+ouD5v6WAAJqQDDWesa2x5f\n\t// UVvMXbpepMyFrijDAAAAAEZmlsZQAAAAAAAAAGc2hhNTEyAAAAUwAAAAtzc2gtZWQyNTUx\n\t// OQAAAEBeu9Z+vLxBORysiqEbTzJP0EZKG0/aE5HpTtvimjQS6mHZCAGFg+kimNatBE0Y1j\n\t// gS4pfD73TlML1SyB5lb/YO\n\t// -----END SSH SIGNATURE-----\n}\n\nfunc main() {\n\tExampleSign()\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42wim%2Fsshsig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42wim%2Fsshsig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42wim%2Fsshsig/lists"}