An opinionated helper for generating tls certificates

Certificates helper

Build Status FOSSA Status

MIT license GoDoc Go Report Card CodeFactor Coverage Status Mentioned in Awesome Go

This is an opinionated helper for generating tls certificates. It outputs only in PEM format but this enables you easily generate certificate chains for MA TLS.

cert package

The cert package can be used directly in your application without the need of the command line interface, underlying database layer or external dependencies. This way certificate generation can be easily embedded.

Documentation can be found here.

CLI Tool

Installation

Currently you can use it by building it locally, checking the releases or with docker:

docker run mvmaasakkers/certificates cert gen-ca --cn=*.test.domain --stdout

Usage

Generate a CA set

You can generate a CA set by using the generate-ca subcommand like the following example:

certificates cert gen-ca --cn=*.test.domain --stdout

This will output the key and certificate directly to stdout like this (parts are omitted for readability):

-----BEGIN RSA PRIVATE KEY-----
MIIJJwIBAAKCAgEA0txN/brNlBcGrU8mAxL8V19pS1dWEVVTF82LDahI7FMsPPkM
sg5iBCLwYJhnVRPucUmcGC1NyljCy/yW0Cbwl5aNWozAfEkiUpWsukn/ZcMuXvac
qsPRK0Xswbr305NDRnlphoeutyzXAhW2P4FQGCwSfx/Mlaezphc7AreLKg==
-----END RSA PRIVATE KEY-----

-----BEGIN CERTIFICATE-----
MIIE3zCCAsegAwIBAgIFANHEYb4wDQYJKoZIhvcNAQELBQAwDzENMAsGA1UEAxME
P9g8SpNaf6jNS0ULG8+DJ7dwdHes7IWA0BtjDkur4Ya+ey/FwowgMeEnc/h10Adc
az7b
-----END CERTIFICATE-----

By default the certificates are written to files ca.key and ca.crt.

Generate a certificate

This needs a pregenerated CA certificate and key (see "Generate a CA set").

To generate a signed certificate pair you can use the following example:

certificates cert gen --cn=local.test.domain --stdout

This will output the key and certificate directly to stdout like this (parts are omitted for readability):

-----BEGIN RSA PRIVATE KEY-----
MIIJFAIBAAKCAf0Z7/5ZYgOo4gHfAPAPN0vKWEVJ5D97wvnYUq00DcaRPCZZopXl
XUcctgAb3kw27ohTm31KnVEnN8ibeUg2fz+LO/xYVvhD2BMkoe1gk/2JAogPUi1l
jWjI7fuKGwlyHimeYnUx1ADRlShBgHGr
-----END RSA PRIVATE KEY-----

-----BEGIN CERTIFICATE-----
MIIE/TCCAuWgAwIBAgIFFPmGQ70wDQYJKoZIhvcNAQELBQAwDzENMAsGA1UEAxME
V964wCgh6TgfUtt9RabcM3MWtAR18N0vedYg46jhxDa1b+/brQWLuxXDsKIVHrRP
M6ZzVSUF1PH+Ok2Fm7EP26Yax3RkoPrgmlLqL/1fRJaJ
-----END CERTIFICATE-----

By default a file (file.db) database is created to keep track of unique certificate serialnumbers. This is advised only for dev and test environments. The CA database can be one of the following flavours of sql: mysql, postgresql or mssql.

To change key generation bitsize use the --bitsize flag (default is 4096, options are 2048 and 4096).

To use a pre-existing csr to use during the generation give the path to the csr file using the --csr flag.

Development setup

This module uses Go modules for dependency management. To run:

  • go run main.go

And this will output:

NAME:
   Certificates - An opinionated TLS certificate generator.

USAGE:
   main [global options] command [command options] [arguments...]

VERSION:
   v...

DESCRIPTION:
   An opinionated TLS certificate generator.

COMMANDS:
     certificate, cert  certificate commands
     help, h            Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

License

FOSSA Status

Owner
Comments
  • Dependabot issue on git.apache.org/thrift.git@v0.12.0:

    Dependabot issue on git.apache.org/[email protected]:

    Hi @mvmaasakkers ,

    the go.mod file is using git.apache.org/[email protected] which causes github Dependabot error as the following:

    Dependabot` can't resolve your Go dependency files
    Dependabot failed to update your dependencies because there was an error resolving your Go dependency files.
    
    Dependabot encountered the following error:
    
    go: github.com/mvmaasakkers/[email protected] requires
    	git.apache.org/[email protected]: reading git.apache.org/thrift.git/go.mod at revision v0.12.0: unknown revision
    [Learn more](https://docs.github.com/github/managing-security-vulnerabilities/troubleshooting-dependabot-errors)
    

    Similar issues: https://github.com/hashicorp/vault/issues/7475

    Would it be possible, we update the go.mod as well as go version to 1.18. Thank you

  • Add license scan report and status

    Add license scan report and status

  • Add more tests for rand.go

    Add more tests for rand.go

    Please add a test that runs the fn multiple times and validates that each value is different than the last one.

    https://github.com/mvmaasakkers/certificates/blob/020fb015e7dd252861f94d17dcbf6b0acfa0cae3/cert/rand_test.go#L7

  • Weekly Digest (29 December, 2019 - 5 January, 2020)

    Weekly Digest (29 December, 2019 - 5 January, 2020)

    Here's the Weekly Digest for mvmaasakkers/certificates:


    ISSUES

    Last week, no issues were created.


    PULL REQUESTS

    Last week, no pull requests were created, updated or merged.


    COMMITS

    Last week there were no commits.


    CONTRIBUTORS

    Last week there were no contributors.


    STARGAZERS

    Last week there were no stargazers.


    RELEASES

    Last week there were no releases.


    That's all for last week, please :eyes: Watch and :star: Star the repository mvmaasakkers/certificates to receive next weekly updates. :smiley:

    You can also view all Weekly Digests by clicking here.

    Your Weekly Digest bot. :calendar:

  • Weekly Digest (22 December, 2019 - 29 December, 2019)

    Weekly Digest (22 December, 2019 - 29 December, 2019)

    Here's the Weekly Digest for mvmaasakkers/certificates:


    ISSUES

    Last week, no issues were created.


    PULL REQUESTS

    Last week, no pull requests were created, updated or merged.


    COMMITS

    Last week there were no commits.


    CONTRIBUTORS

    Last week there were no contributors.


    STARGAZERS

    Last week there were no stargazers.


    RELEASES

    Last week there were no releases.


    That's all for last week, please :eyes: Watch and :star: Star the repository mvmaasakkers/certificates to receive next weekly updates. :smiley:

    You can also view all Weekly Digests by clicking here.

    Your Weekly Digest bot. :calendar:

  • Weekly Digest (15 December, 2019 - 22 December, 2019)

    Weekly Digest (15 December, 2019 - 22 December, 2019)

    Here's the Weekly Digest for mvmaasakkers/certificates:


    ISSUES

    Last week, no issues were created.


    PULL REQUESTS

    Last week, no pull requests were created, updated or merged.


    COMMITS

    Last week there were no commits.


    CONTRIBUTORS

    Last week there were no contributors.


    STARGAZERS

    Last week there were no stargazers.


    RELEASES

    Last week there were no releases.


    That's all for last week, please :eyes: Watch and :star: Star the repository mvmaasakkers/certificates to receive next weekly updates. :smiley:

    You can also view all Weekly Digests by clicking here.

    Your Weekly Digest bot. :calendar:

  • Weekly Digest (8 December, 2019 - 15 December, 2019)

    Weekly Digest (8 December, 2019 - 15 December, 2019)

    Here's the Weekly Digest for mvmaasakkers/certificates:


    ISSUES

    Last week, no issues were created.


    PULL REQUESTS

    Last week, no pull requests were created, updated or merged.


    COMMITS

    Last week there were no commits.


    CONTRIBUTORS

    Last week there were no contributors.


    STARGAZERS

    Last week there were no stargazers.


    RELEASES

    Last week there were no releases.


    That's all for last week, please :eyes: Watch and :star: Star the repository mvmaasakkers/certificates to receive next weekly updates. :smiley:

    You can also view all Weekly Digests by clicking here.

    Your Weekly Digest bot. :calendar:

  • Weekly Digest (1 December, 2019 - 8 December, 2019)

    Weekly Digest (1 December, 2019 - 8 December, 2019)

    Here's the Weekly Digest for mvmaasakkers/certificates:


    ISSUES

    Last week, no issues were created.


    PULL REQUESTS

    Last week, no pull requests were created, updated or merged.


    COMMITS

    Last week there were no commits.


    CONTRIBUTORS

    Last week there were no contributors.


    STARGAZERS

    Last week there were no stargazers.


    RELEASES

    Last week there were no releases.


    That's all for last week, please :eyes: Watch and :star: Star the repository mvmaasakkers/certificates to receive next weekly updates. :smiley:

    You can also view all Weekly Digests by clicking here.

    Your Weekly Digest bot. :calendar:

  • Weekly Digest (24 November, 2019 - 1 December, 2019)

    Weekly Digest (24 November, 2019 - 1 December, 2019)

    Here's the Weekly Digest for mvmaasakkers/certificates:


    ISSUES

    Last week, no issues were created.


    PULL REQUESTS

    Last week, no pull requests were created, updated or merged.


    COMMITS

    Last week there were no commits.


    CONTRIBUTORS

    Last week there were no contributors.


    STARGAZERS

    Last week there were no stargazers.


    RELEASES

    Last week there were no releases.


    That's all for last week, please :eyes: Watch and :star: Star the repository mvmaasakkers/certificates to receive next weekly updates. :smiley:

    You can also view all Weekly Digests by clicking here.

    Your Weekly Digest bot. :calendar:

  • Weekly Digest (17 November, 2019 - 24 November, 2019)

    Weekly Digest (17 November, 2019 - 24 November, 2019)

    Here's the Weekly Digest for mvmaasakkers/certificates:

    ISSUES

    This week, no issues have been created or closed.

    PULL REQUESTS

    This week, no pull requests has been proposed by the users.

    CONTRIBUTORS

    This week, no user has contributed to this repository.

    STARGAZERS

    This week, no user has starred this repository.

    COMMITS

    This week, there have been no commits.

    RELEASES

    This week, no releases were published.

    That's all for this week, please watch :eyes: and star :star: mvmaasakkers/certificates to receive next weekly updates. :smiley:

  • Weekly Digest (10 November, 2019 - 17 November, 2019)

    Weekly Digest (10 November, 2019 - 17 November, 2019)

    Here's the Weekly Digest for mvmaasakkers/certificates:


    ISSUES

    Last week, no issues were created.


    PULL REQUESTS

    Last week, no pull requests were created, updated or merged.


    COMMITS

    Last week there were no commits.


    CONTRIBUTORS

    Last week there were no contributors.


    STARGAZERS

    Last week there were no stargazers.


    RELEASES

    Last week there were no releases.


    That's all for last week, please :eyes: Watch and :star: Star the repository mvmaasakkers/certificates to receive next weekly updates. :smiley:

    You can also view all Weekly Digests by clicking here.

    Your Weekly Digest bot. :calendar:

Secure Boot certificates from the Framework Laptop

Framework Laptop UEFI Secure Boot Certificates Source: Extracted from a live machine (FRANBMCP08) Date: 2021-10-21 KEK (Key Exchange Key) This certifi

Dec 8, 2022
Generate self-signed, trusted certificates for local development.

Development Certificates Generator devcert takes away the pain of creating self-signed certificates for development manually. Usage $ devcert my-proje

Dec 13, 2022
A RSA signing server model, allows to create valid signed certificates that cant be modified
A RSA signing server model, allows to create valid signed certificates that cant be modified

Omega Description a RSA signing server model, allows to create valid signed certificates that cant be modified Requirements MySQL Server GoLang 1.17 I

Nov 15, 2021
Update-java-ca-certificates - Small utility to convert the system trust store to a system Java KeyStore

update-java-ca-certificates This small utility takes care of creating a system-w

Dec 28, 2022
Monitor your certificates and get notified before they expire.
Monitor your certificates and get notified before they expire.

Sifaka Sifaka is a tool to monitor your x509 certificates or simply websites certificates expirey date. If your organisation is handling some certs re

Apr 16, 2022
Automatic HTTPS for any Go program: fully-managed TLS certificate issuance and renewal
Automatic HTTPS for any Go program: fully-managed TLS certificate issuance and renewal

Easy and Powerful TLS Automation The same library used by the Caddy Web Server Caddy's automagic TLS features—now for your own Go programs—in one powe

Jan 6, 2023
Driftwood is a tool that can enable you to lookup whether a private key is used for things like TLS or as a GitHub SSH key for a user.
Driftwood is a tool that can enable you to lookup whether a private key is used for things like TLS or as a GitHub SSH key for a user.

Driftwood is a tool that can enable you to lookup whether a private key is used for things like TLS or as a GitHub SSH key for a user. Drift

Dec 29, 2022
A light package for generating and comparing password hashing with argon2 in Go

argon2-hashing argon2-hashing provides a light wrapper around Go's argon2 package. Argon2 was the winner of the Password Hashing Competition that make

Sep 27, 2022
A convenience library for generating, comparing and inspecting password hashes using the scrypt KDF in Go 🔑

simple-scrypt simple-scrypt provides a convenience wrapper around Go's existing scrypt package that makes it easier to securely derive strong keys ("h

Dec 22, 2022
A Go Library For Generating Random, Rule Based Passwords. Many Random, Much Secure.
A Go Library For Generating Random, Rule Based Passwords. Many Random, Much Secure.

Can Haz Password? A Go library for generating random, rule based passwords. Many random, much secure. Features Randomized password length (bounded). T

Dec 6, 2021
Order TLS certificates using ACME TLS-ALPN-01

Order TLS certificates using ACME TLS-ALPN-01

Jan 4, 2023
Jun 23, 2022
Reverse proxy with automatically obtains TLS certificates from Let's Encrypt

Русскоязычное описание ниже (Russian below). English description Home page: https://github.com/rekby/lets-proxy2 Features: http-01 and tls-alpn-01 val

Dec 11, 2022
Certificate monitoring utility for watching tls certificates and reporting the result as metrics.
Certificate monitoring utility for watching tls certificates and reporting the result as metrics.

cert-checker cert-checker is a certificate monitoring utility for watching tls certificates. These checks get exposed as Prometheus metrics to be view

Dec 6, 2022
Discover expired TLS certificates in the services of a kubernetes cluster

About verify-k8s-certs is a daemon (prometheus exporter) to discover expired TLS certificates in a kubernetes cluster. It exposes the informations as

Feb 1, 2022
For whatever reason you want to transfer TLS certificates in kubernetes to Qiniu CDN

Qiniu Certificate Sync For whatever reason you want to transfer TLS certificates in kubernetes to Qiniu CDN This app will upload provided TLS secrets

Oct 21, 2021
Monitors the expiry time of tls certificates and exports prometheus metrics

Certificate Monitor Monitors the expiry time of tls certificates and exports prometheus metrics. Target domains can be automatically discovered via in

Feb 7, 2022
Http-server - A HTTP server and can be accessed via TLS and non-TLS mode

Application server.go runs a HTTP/HTTPS server on the port 9090. It gives you 4

Feb 3, 2022
traefik-certs-cleaner is a simple helper to clean the Traefik acme.json file by removing certificates

traefik-certs-cleaner If you appreciate this project: Description traefik-certs-cleaner is a simple helper to clean the Traefik acme.json file by remo

Oct 31, 2022
Go tool for generating sql scanners, sql statements and other helper functions

sqlgen generates SQL statements and database helper functions from your Go structs. It can be used in place of a simple ORM or hand-written SQL. See t

Nov 24, 2022