{"id":15074490,"url":"https://github.com/grimdork/certcut","last_synced_at":"2026-01-02T18:08:16.454Z","repository":{"id":57564890,"uuid":"120797091","full_name":"grimdork/certcut","owner":"grimdork","description":"Quick certificate generation and loading.","archived":false,"fork":false,"pushed_at":"2024-03-09T12:51:36.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T00:11:16.914Z","etag":null,"topics":["certificate-generation","certificates","go","golang","grpc","laziness"],"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/grimdork.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":"2018-02-08T17:57:20.000Z","updated_at":"2023-01-06T17:20:09.000Z","dependencies_parsed_at":"2024-06-20T01:45:16.207Z","dependency_job_id":"033378b5-8988-4864-82e4-f248415847a7","html_url":"https://github.com/grimdork/certcut","commit_stats":null,"previous_names":["urethramancer/certcut"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimdork%2Fcertcut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimdork%2Fcertcut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimdork%2Fcertcut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimdork%2Fcertcut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grimdork","download_url":"https://codeload.github.com/grimdork/certcut/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243864822,"owners_count":20360360,"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":["certificate-generation","certificates","go","golang","grpc","laziness"],"created_at":"2024-09-25T03:33:47.524Z","updated_at":"2026-01-02T18:08:16.396Z","avatar_url":"https://github.com/grimdork.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# certcut\n\nQuick certificate generation and loading.\n\n## Install\n\ngo get -u github.com/grimdork/certcut\n\n## Why\n\nI needed simpler, automated generation of self-signed server and client certificates for various projects, both gRPC client certificate authentication and other servers.\n\n## How\n\n### Generating a server certificate\n\n```go\n// Create a server certificate and key\ncacert, cakey, err := certcut.NewRootCert(\"Miskatonic U.\", 4096) // 2048 is the default if you supply anything less\nif err != nil {\n\treturn err\n}\n```\n\nGet the PEM with CertPEM() and PrivateKeyPEM(). You can load them with LoadCertFromPEM() and LoadPrivateKeyFromPEM(). Use `x509.CreateRevocationList()` to create CRLs, and load them with `x509.LoadCRLFromPEM()`.\n\n\nNote that this package only cares about the Common Name for certificates etc., as it's intended for internal use and not to generate certificates/signing requests for a public CA.\n\n### Signing a client certificate\n\n```go\n// Continuing from the above example, we generate the key and cert for a client.\n// The key will be 4096 bits.\ncrt, key, err := certcut.GetSignedCert(cacert, cakey, \"Staff\")\nif err != nil {\n\treturn err\n}\n```\n\nIf you want more control over the process, for example to store the signing request, you can use NewCSR() to generate a CSR, and then NewClientCert() to sign it.\n\n### gRPC\n\nThere's a convenience function for the grpc package to load both the CA cert and the client cert at once into a TLS config:\n\n```go\ncreds, err := certcut.NewClientTLSFromFiles(\"server.crt\", \"client.crt\", \"client.key\")\n...\nconn, err := grpc.Dial(address, grpc.WithTransportCredentials(creds))\n```\n\nIt's a drop-in replacement for gRPC's NewClientTLSFromFile().\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrimdork%2Fcertcut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrimdork%2Fcertcut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrimdork%2Fcertcut/lists"}