certs

package
v0.0.1-20240408-0001 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCerts

func GenerateCerts(scope string, options *CertGeneration) error

func GetCertsFullPath

func GetCertsFullPath() string

func GetCertsFullPathByScope

func GetCertsFullPathByScope(scope string) string

Types

type CertGeneration

type CertGeneration struct {
	Host         string        `default:""`                    // "Comma-separated hostnames and IPs to generate a certificate for"
	ValidFrom    string        `default:"Jan 1 00:00:00 2021"` // Creation date formatted as Jan 1 15:04:05 2011
	ValidForDays time.Duration `default:"36500"`               // "Duration that certificate is valid for"
	IsCA         bool          `default:"false"`               // "whether this cert should be its own Certificate Authority"
	RSABits      int           `default:"2048"`                // "Size of RSA key to generate. Ignored if --ecdsa-curve is set"
	EcdsaCurve   string        `default:""`                    // "ECDSA curve to use to generate a key. Valid values are P224, P256 (recommended), P384, P521"
	ED25519Key   bool          `default:"false"`               // "Generate an Ed25519 key"

	// By default if they are empty... they'll be saved in the default directory!
	KeyPath  string `default:""`
	CertPath string `default:""`
}

Defaults var (

host       = flag.String("host", "", "Comma-separated hostnames and IPs to generate a certificate for")
validFrom  = flag.String("start-date", "", "Creation date formatted as Jan 1 15:04:05 2011")
validFor   = flag.Duration("duration", 365*24*time.Hour, "Duration that certificate is valid for")
isCA       = flag.Bool("ca", false, "whether this cert should be its own Certificate Authority")
rsaBits    = flag.Int("rsa-bits", 2048, "Size of RSA key to generate. Ignored if --ecdsa-curve is set")
ecdsaCurve = flag.String("ecdsa-curve", "", "ECDSA curve to use to generate a key. Valid values are P224, P256 (recommended), P384, P521")
ed25519Key = flag.Bool("ed25519", false, "Generate an Ed25519 key")

)

Jump to

Keyboard shortcuts

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