{"id":17273410,"url":"https://github.com/kairoaraujo/goca","last_synced_at":"2025-03-17T11:30:37.370Z","repository":{"id":40735349,"uuid":"325024603","full_name":"kairoaraujo/goca","owner":"kairoaraujo","description":"Golang Certificate Authority (CA) package","archived":false,"fork":false,"pushed_at":"2024-08-12T11:18:05.000Z","size":3325,"stargazers_count":44,"open_issues_count":12,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T23:06:12.538Z","etag":null,"topics":["certficate","certificate","certificate-authorities","certificate-authority","certificate-generation","certs","go","go-api","golang","hacktoberfest","pki","security","ssl-certificates"],"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/kairoaraujo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-12-28T13:48:28.000Z","updated_at":"2025-02-07T12:53:56.000Z","dependencies_parsed_at":"2024-04-13T18:47:11.846Z","dependency_job_id":"5a5e8147-8883-47c3-8ac4-1f1009e18313","html_url":"https://github.com/kairoaraujo/goca","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairoaraujo%2Fgoca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairoaraujo%2Fgoca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairoaraujo%2Fgoca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairoaraujo%2Fgoca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kairoaraujo","download_url":"https://codeload.github.com/kairoaraujo/goca/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858056,"owners_count":20359271,"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":["certficate","certificate","certificate-authorities","certificate-authority","certificate-generation","certs","go","go-api","golang","hacktoberfest","pki","security","ssl-certificates"],"created_at":"2024-10-15T08:51:12.214Z","updated_at":"2025-03-17T11:30:34.745Z","avatar_url":"https://github.com/kairoaraujo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Certificate Authority management package\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/kairoaraujo/goca)](https://goreportcard.com/report/github.com/kairoaraujo/goca)\n[![Build Status](https://github.com/kairoaraujo/goca/workflows/tests/badge.svg)](https://github.com/kairoaraujo/goca/actions)\n[![Go Reference](https://pkg.go.dev/badge/github.com/kairoaraujo/goca.svg)](https://pkg.go.dev/github.com/kairoaraujo/goca)\n[![Docker Pulls](https://img.shields.io/docker/pulls/kairoaraujo/goca.svg?maxAge=604800)](https://hub.docker.com/r/kairoaraujo/goca/)\n\n### THIS PROJECT IS OPEN FOR MAINTAINERS\n\n\u003e Development on the GoCA projects has been stagnated for a while\n\u003e For that reason, I'm opening the organization to new maintainers who will have the proper permissions to unstuck development.\n\u003e\n\u003e Those willing to join, contact me by email with the subject [GoCA Maintainer] \u003cyour name\u003e and please let me know what\n\u003e motivates you to join in such role.\n\nGocA provides a Certificate Authority (CA) framework managing, a Simple PKI.\n\nGoCA is a framework that uses mainly crypto/x509 to manage Certificate\nAuthorities.\n\nUsing GoCA makes it easy to create a CA and issue certificates, signing\nCertificates Signing Request (CSR), and revoke certificate generating\nCertificates Request List (CRL).\n\n**Content**:\n\n- [Go Certificate Authority management package](#go-certificate-authority-management-package)\n  - [GoCA Package](#goca-package)\n  - [GoCA HTTP REST API](#goca-http-rest-api)\n  - [GoCA Docker Container](#goca-docker-container)\n- [Contributing](#contributing)\n\n## GoCA Package\n\n```shell\ngo get github.com/kairoaraujo/goca\n```\n\nAll files are store in the ``$CAPATH``. The ``$CAPATH`` is an environment\nvariable that defines where all files (keys, certificates, etc.) are stored.\nIt is essential to have this folder in a safe place.\n\n$CPATH structure:\n\n```shell\n\n$CPATH\n├── \u003cCA Common Name\u003e\n    ├── ca\n    │   ├── \u003cCA Common Name\u003e.crl\n    │   ├── \u003cCA Common Name\u003e.crt\n    │   ├── key.pem\n    │   └── key.pub\n    └── certs\n        └── \u003cCertificate Common Name\u003e\n            ├── \u003cCertificate Common Name\u003e.crt\n            ├── \u003cCertificate Common Name\u003e.csr\n            ├── key.pem\n            └── key.pub\n```\n\nGoCA also make it easier to manipulate files such as Private and Public Keys,\nCertificate Signing Request, Certificate Request Lists, and Certificates\nfor other Go applications.\n\n\nThis example shows\n\n1. Creating a Certificate Authority (Root) or Loading if it already exists\n2. Issue a new Certificate\n3. Shows the certificate\n\n```go\n\n// Define the GOCAPTH (Default is current dir)\nos.Setenv(\"CAPATH\", \"/opt/GoCA/CA\")\n\n// RootCAIdentity for creation\nrootCAIdentity := goca.Identity{\n    Organization:       \"GO CA Root Company Inc.\",\n    OrganizationalUnit: \"Certificates Management\",\n    Country:            \"NL\",\n    Locality:           \"Noord-Brabant\",\n    Province:           \"Veldhoven\",\n    Intermediate:       false,\n}\n\n// (1) Create the New Root CA or loads existent from disk ($CAPATH)\nRootCA, err := goca.New(\"mycompany.com\", rootCAIdentity)\nif err != nil {\n    // Loads in case it exists\n    fmt.Println(\"Loading CA\")\n    RootCA, err = goca.Load(\"gocaroot.nl\")\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Check the CA status and shows the CA Certificate\n    fmt.Println(RootCA.Status())\n    fmt.Println(RootCA.GetCertificate())\n\n} else {\n    log.Fatal(err)\n}\n\n// (2) Issue certificate for example intranet server\nintranetIdentity := goca.Identity{\n    Organization:       \"Intranet Company Inc.\",\n    OrganizationalUnit: \"Global Intranet\",\n    Country:            \"NL\",\n    Locality:           \"Noord-Brabant\",\n    Province:           \"Veldhoven\",\n    Intermediate:       false,\n    DNSNames:           []string{\"w3.intranet.example.com\", \"www.intranet.example.com\"},\n}\n\nintranetCert, err := RootCA.IssueCertificate(\"intranet.example.com\", intranetIdentity)\nif err != nil {\n    log.Fatal(err)\n}\n\n// (3) Shows the Certificate (string)\nfmt.Println(intranetCert.GetCertificate())\n\n// Shows all CA Certificates\nfmt.Println(RootCA.ListCertificates())\n```\n\n## GoCA HTTP REST API\n\nGoCA also provides an implementation using HTTP REST API.\n\nThis is available in [``rest-api``](rest-api/) folder.\n\n## GoCA Docker Container\n\nGoCA Docker ready to use HTTP Rest API that uses mainly crypto/x509 to manage Certificate Authorities and Certificates such\nas a simple PKI Service.\n\nThe API Documentation is online available at http://kairoaraujo.github.io/goca/.\n\nMore details in [Docker README](DOCKER_README.md).\n\nGoCA Docker Image is available at https://hub.docker.com/r/kairoaraujo/goca/\n\n# Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkairoaraujo%2Fgoca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkairoaraujo%2Fgoca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkairoaraujo%2Fgoca/lists"}