{"id":20010332,"url":"https://github.com/fifsky/ktool","last_synced_at":"2026-05-13T04:04:28.591Z","repository":{"id":208176252,"uuid":"720959858","full_name":"fifsky/ktool","owner":"fifsky","description":"rsa key tools, format, pkcs1 and pkcs8 convert","archived":false,"fork":false,"pushed_at":"2024-09-12T13:39:01.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T14:46:35.906Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fifsky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-11-20T03:58:14.000Z","updated_at":"2024-09-12T13:37:04.000Z","dependencies_parsed_at":"2024-09-12T23:58:02.753Z","dependency_job_id":"6c2f38c7-cb1a-468d-be5f-88d613852545","html_url":"https://github.com/fifsky/ktool","commit_stats":null,"previous_names":["fifsky/ktool","fifsky/keytool"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fktool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fktool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fktool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fktool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fifsky","download_url":"https://codeload.github.com/fifsky/ktool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241447521,"owners_count":19964314,"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":[],"created_at":"2024-11-13T07:19:20.870Z","updated_at":"2026-05-13T04:04:28.496Z","avatar_url":"https://github.com/fifsky.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSA Key Tools\n\n[![Go](https://github.com/fifsky/ktool/actions/workflows/go.yml/badge.svg)](https://github.com/fifsky/ktool/actions/workflows/go.yml)\n\n## Tools\n - format rsa key\n - pkcs1 to pkcs8\n - pkcs8 to pkcs1\n - get cert serial number\n\n## Usage\n\n```text\ngo install github.com/fifsky/ktool\n```\n\nGet certificate serial number\n```bash\nktool serial -f=./testdata/cert.pem\n```\n\nFormat pkcs8 private key\n```bash\nktool format -f=./testdata/no_format_pkcs8.txt\n```\n\nFormat pkcs1 private key\n```bash\nktool format -f=./testdata/no_format_pkcs1.txt\n```\n\nFormat public key\n```bash\nktool format -f=./testdata/no_format_public_key.txt\n```\n\n\n\u003e format automatically adds the key preamble\n\nConvert private key to pkcs1, suppert pem and der\n```bash\nktool convert -f=./testdata/pkcs8.pem -t=pkcs1\n```\n\nConvert private key to pkcs8, suppert pem and der\n```bash\nktool convert -f=./testdata/pkcs1.pem -t=pkcs8\n```\n\nShow private key format:\n```bash\nktool info -f=./testdata/pkcs1.pem\n// Output: file ./testdata/pkcs1.pem format is: PKCS1\n```\n\n\n## PS\n\npublic key pkcs8 to pkcs1\n```bash\nopenssl rsa -pubin -in public_key_pkcs1.pem -RSAPublicKey_out\n```\n\nprivate pem to der\n```bash\nopenssl rsa -outform der -in pkcs8.pem | base64\n```\n\npublic pem to der\n```bash\nopenssl rsa -pubin -outform DER -in public_key.pem | base64\n```\n\nrsa der public key to pem\n```bash\ncat public_key | base64 --decode | openssl rsa -pubin -inform DER -outform PEM -out public_key.pem\n```\n\nrsa der private key to pem\n```bash\ncat pkcs8_private_key | base64 --decode | openssl rsa -inform DER -outform PEM -out pkcs8.pem\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffifsky%2Fktool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffifsky%2Fktool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffifsky%2Fktool/lists"}