gencert

package
v0.0.0-...-0fe05a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2021 License: BSD-3-Clause, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.4"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cert

type Cert struct {
	Private *pem.Block
	Public  *pem.Block

	PrivateBytes []byte
	PublicBytes  []byte
}

type Certs

type Certs struct {
	Root, Leaf, Client *Cert
}

func Generate

func Generate(cfg Config) (*Certs, error)

type Config

type Config struct {
	// Which hosts to sign certificates for.
	Hosts []string
	// Which organization is issuing these certs, defaults to "Acme Co."
	Org string
	// How long leaf and client certs should be valid for, defaults to one year.
	LeafValidFor time.Duration
	// How long the root CA cert should be valid for, defaults to one year.
	RootValidFor time.Duration
	// Use root CA on disk to generate leaf certs, instead of generating a new
	// one. Should be a .key file with a root CA private key.
	RootCAPrivateKey string
	// Should be a .pem file with a root CA certificate. It is an error to set
	// RootCACert and not RootCAPrivateKey, or vice versa.
	RootCACert string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL