{"id":20018999,"url":"https://github.com/ojarva/python-sshpubkeys","last_synced_at":"2025-10-20T03:34:46.920Z","repository":{"id":24769373,"uuid":"28182691","full_name":"ojarva/python-sshpubkeys","owner":"ojarva","description":"OpenSSH public key parser for Python","archived":false,"fork":false,"pushed_at":"2024-06-15T20:58:28.000Z","size":221,"stargazers_count":99,"open_issues_count":12,"forks_count":43,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-12T20:06:53.047Z","etag":null,"topics":["openssh","parser","publickey","python","ssh","validator"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ojarva.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2014-12-18T12:30:04.000Z","updated_at":"2025-03-14T10:50:33.000Z","dependencies_parsed_at":"2024-06-18T14:12:12.704Z","dependency_job_id":null,"html_url":"https://github.com/ojarva/python-sshpubkeys","commit_stats":{"total_commits":110,"total_committers":19,"mean_commits":"5.7894736842105265","dds":"0.36363636363636365","last_synced_commit":"5f7619c8907c201b8833ee4ed809baceb487e51c"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ojarva/python-sshpubkeys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojarva%2Fpython-sshpubkeys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojarva%2Fpython-sshpubkeys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojarva%2Fpython-sshpubkeys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojarva%2Fpython-sshpubkeys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ojarva","download_url":"https://codeload.github.com/ojarva/python-sshpubkeys/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojarva%2Fpython-sshpubkeys/sbom","scorecard":{"id":703764,"data":{"date":"2025-08-11","repo":{"name":"github.com/ojarva/python-sshpubkeys","commit":"5f788694842d5594ad4856ac0b9ae361d95f86ca"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Code-Review","score":3,"reason":"Found 4/12 approved changesets -- score normalized to 3","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/python-tests.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/ojarva/python-sshpubkeys/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/ojarva/python-sshpubkeys/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/ojarva/python-sshpubkeys/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/ojarva/python-sshpubkeys/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/ojarva/python-sshpubkeys/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/ojarva/python-sshpubkeys/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-tests.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/ojarva/python-sshpubkeys/python-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-tests.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/ojarva/python-sshpubkeys/python-tests.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:23","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   6 pipCommand dependencies pinned"],"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE.txt: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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3ww4-gg4f-jr7f","Warn: Project is vulnerable to: GHSA-5cpq-8wj7-hf2v","Warn: Project is vulnerable to: GHSA-9v9h-cgj8-h64p","Warn: Project is vulnerable to: PYSEC-2023-254 / GHSA-jfhm-5ghh-2f97","Warn: Project is vulnerable to: GHSA-jm77-qphf-c4w8","Warn: Project is vulnerable to: GHSA-v8gr-m533-ghj9","Warn: Project is vulnerable to: GHSA-w7pp-m8wf-vj6r","Warn: Project is vulnerable to: GHSA-x4qr-2fvf-3mr5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 27 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"}}]},"last_synced_at":"2025-08-22T05:52:30.881Z","repository_id":24769373,"created_at":"2025-08-22T05:52:30.881Z","updated_at":"2025-08-22T05:52:30.881Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279936531,"owners_count":26247129,"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","status":"online","status_checked_at":"2025-10-19T02:00:07.647Z","response_time":64,"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":["openssh","parser","publickey","python","ssh","validator"],"created_at":"2024-11-13T08:25:26.927Z","updated_at":"2025-10-20T03:34:46.894Z","avatar_url":"https://github.com/ojarva.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"OpenSSH Public Key Parser for Python\n====================================\n\n.. image:: https://github.com/ojarva/python-sshpubkeys/workflows/Run%20python%20tests/badge.svg\n\nMajor changes between versions 2 and 3\n--------------------------------------\n\n- Dropped support for Python 2.6 and 3.3\n- Even in loose mode, DSA keys must be 1024, 2048, or 3072 bits (earlier this was looser)\n- The interface (API) is exactly the same\n\n\nUsage\n-----\n\nNative implementation for validating OpenSSH public keys.\n\nCurrently ssh-rsa, ssh-dss (DSA), ssh-ed25519 and ecdsa keys with NIST curves are supported.\n\nInstallation:\n\n::\n\n  pip install sshpubkeys\n\nor clone the `repository \u003chttps://github.com/ojarva/sshpubkeys\u003e`_ and use\n\n::\n\n  python setup.py install\n\nUsage:\n\n::\n\n  import sys\n  from sshpubkeys import SSHKey\n\n  ssh = SSHKey(\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQCxO38tKAJXIs9ivPxt7AY\"\n        \"dfybgtAR1ow3Qkb9GPQ6wkFHQqcFDe6faKCxH6iDRteo4D8L8B\"\n        \"xwzN42uZSB0nfmjkIxFTcEU3mFSXEbWByg78aoddMrAAjatyrh\"\n        \"H1pON6P0= ojarva@ojar-laptop\", strict=True)\n  try:\n      ssh.parse()\n  except InvalidKeyError as err:\n      print(\"Invalid key:\", err)\n      sys.exit(1)\n  except NotImplementedError as err:\n      print(\"Invalid key type:\", err)\n      sys.exit(1)\n\n  print(ssh.bits)  # 768\n  print(ssh.hash_md5())  # 56:84:1e:90:08:3b:60:c7:29:70:5f:5e:25:a6:3b:86\n  print(ssh.hash_sha256())  # SHA256:xk3IEJIdIoR9MmSRXTP98rjDdZocmXJje/28ohMQEwM\n  print(ssh.hash_sha512())  # SHA512:1C3lNBhjpDVQe39hnyy+xvlZYU3IPwzqK1rVneGavy6O3/ebjEQSFvmeWoyMTplIanmUK1hmr9nA8Skmj516HA\n  print(ssh.comment)  # ojar@ojar-laptop\n  print(ssh.options_raw)  # None (string of optional options at the beginning of public key)\n  print(ssh.options)  # None (options as a dictionary, parsed and validated)\n\n\nParsing of `authorized_keys` files:\n\n::\n\n  import os\n  from sshpubkeys import AuthorizedKeysFile\n  f = open(os.environ[\"HOME\"] + \"/.ssh/authorized_keys\", \"r\")\n  key_file = AuthorizedKeysFile(f, strict=False)\n\n  for key in key_file.keys:\n      print(key.key_type, key.bits, key.hash_sha512())\n\n\nOptions\n-------\n\nSet options in constructor as a keywords (i.e., `SSHKey(None, strict=False)`)\n\n- strict: defaults to True. Disallows keys OpenSSH's ssh-keygen refuses to create. For instance, this includes DSA keys where length != 1024 bits and RSA keys shorter than 1024-bit. If set to False, tries to allow all keys OpenSSH accepts, including highly insecure 1-bit DSA keys.\n- skip_option_parsing: if set to True, options string is not parsed (ssh.options_raw is populated, but ssh.options is not).\n- disallow_options: if set to True, options are not allowed and it will raise an\n  InvalidOptionsError.\n\nExceptions\n----------\n\n- NotImplementedError if invalid ecdsa curve or unknown key type is encountered.\n- InvalidKeyError if any other error is encountered:\n    - TooShortKeyError if key is too short (\u003c768 bits for RSA, \u003c1024 for DSA, \u003c256 for ED25519)\n    - TooLongKeyError if key is too long (\u003e16384 for RSA, \u003e1024 for DSA, \u003e256 for ED25519)\n    - InvalidTypeError if key type (\"ssh-rsa\" in above example) does not match to what is included in base64 encoded data.\n    - MalformedDataError if decoding and extracting the data fails.\n    - InvalidOptionsError if options string is invalid.\n        - InvalidOptionNameError if option name contains invalid characters.\n            - UnknownOptionNameError if option name is not recognized.\n        - MissingMandatoryOptionValueError if option needs to have parameter, but it is absent.\n\nTests\n-----\n\nSee \"`tests/ \u003chttps://github.com/ojarva/sshpubkeys/tree/master/tests\u003e`_\" folder for unit tests. Use\n\n::\n\n  python setup.py test\n\nor\n\n::\n\n  python3 setup.py test\n\nto run test suite. If you have keys that are not parsed properly, or malformed keys that raise incorrect exception, please send your *public key* to olli@jarva.fi, and I'll include it. Alternatively, `create a new issue \u003chttps://github.com/ojarva/sshpubkeys/issues/new\u003e`_ or make `a pull request \u003chttps://github.com/ojarva/sshpubkeys/compare\u003e`_ in github.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fojarva%2Fpython-sshpubkeys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fojarva%2Fpython-sshpubkeys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fojarva%2Fpython-sshpubkeys/lists"}