testca

package
v0.0.0-...-0956853 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	ExpiresAfter time.Duration // default: 1 hour
}

Options are options for the test CA

type TestCA

type TestCA struct {
	Opts    Options
	CertPEM []byte
	PrivPEM []byte
	CertDER []byte
	PrivDER []byte
	Priv    *ecdsa.PrivateKey
	Cert    *x509.Certificate
}

func New

func New(opts Options) (*TestCA, error)

New creates a testCA that can generate configurations for testing.

Heavily inspired by: https://www.youtube.com/watch?v=VwPQKS9Njv0 https://docs.google.com/presentation/d/16y-HTvL7ASzf9JspCBX0OVmhwUWVoLj9epzJfNMQRr8/edit

func (*TestCA) ClientConfig

func (ca *TestCA) ClientConfig(name string) (tlsconfig.Config, error)

func (*TestCA) ServerConfig

func (ca *TestCA) ServerConfig(name string) (tlsconfig.Config, error)

Jump to

Keyboard shortcuts

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