tls

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: Apache-2.0 Imports: 15 Imported by: 7

Documentation

Overview

Package tls implements TLS infrastructure providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authority

type Authority struct {
	// contains filtered or unexported fields
}

Authority is an infrastructure provider that implements a TLS authority, capable of issuing TLS certificates. Its implementation requires that a file be specified (through the flag parameter file) where the authority is stored. An Authority's instance may also be marshaled, in which case the certificate material for the authority is inlined directly in the instance configuration.

func (*Authority) Certificate

func (ca *Authority) Certificate() *x509.Certificate

Certificate returns the authority's public certificate, which can be used to verify certificates issued by the same.

func (*Authority) Flags

func (ca *Authority) Flags(flags *flag.FlagSet)

Flags implements infra.Provider.

func (*Authority) HTTPS

func (ca *Authority) HTTPS() (client, server *cryptotls.Config, err error)

HTTPS returns a tls configs based on newly issued TLS certificates from this CA.

func (Authority) Help

func (Authority) Help() string

Help implements infra.Provider

func (*Authority) Init

func (ca *Authority) Init() error

Init implements infra.Provider. It initializes the authority from either the provided file or the serialized instance configuration.

func (*Authority) InstanceConfig

func (ca *Authority) InstanceConfig() interface{}

InstanceConfig implements infra.Provider, allowing for the authority's certificate material to be marshaled inline.

func (*Authority) Issue

func (ca *Authority) Issue(cn string, ttl time.Duration, ips []net.IP, dnss []string) ([]byte, *rsa.PrivateKey, error)

Issue issues a new certificate out of this CA with the provided common name, TTL, IPs, and DNS names.

type Certs

type Certs interface {
	HTTPS() (client, server *cryptotls.Config, err error)
}

Certs defines an interface used to obtain TLS client and server certificates.

Jump to

Keyboard shortcuts

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