tlsgen

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: BSD-3-Clause Imports: 17 Imported by: 1

README

tlsgen

TLS Cert Generator Utility

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReadFrom = tlsloader.ReadFrom

Functions

func WriteTo

func WriteTo(s Storage, cb func(w io.Writer) error) (err error)

Types

type Config

type Config struct {
	CommonName   string        `mapstructure:"common_name"`
	Organization []string      `mapstructure:"organization"`
	Hosts        []string      `mapstructure:"hosts"`
	CertFile     string        `mapstructure:"cert_file"`
	KeyFile      string        `mapstructure:"key_file"`
	FileMode     os.FileMode   `mapstructure:"file_mode"`
	Duration     time.Duration `mapstructure:"duration"`
	Bits         uint16        `mapstructure:"bits"`
	Storage      *PairStorage
}

type Generator

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

func New

func New(cfg Config, Log ...logging.Logger) *Generator

func (*Generator) Generate

func (this *Generator) Generate(storage *PairStorage) (err error)

func (*Generator) IsRunning

func (this *Generator) IsRunning() bool

func (*Generator) LeftTime

func (this *Generator) LeftTime() time.Duration

func (*Generator) Start

func (this *Generator) Start(done func()) (stop task.Stoper, err error)

func (*Generator) Stop

func (this *Generator) Stop()

func (*Generator) UpdateIfNecessary

func (this *Generator) UpdateIfNecessary() (err error)

type PairStorage

type PairStorage struct {
	Cert, Key Storage
}

func NewSafeFilePairStorage

func NewSafeFilePairStorage(certPath, keyPath string, mode ...os.FileMode) *PairStorage

type SafeFileStorage

type SafeFileStorage struct {
	tlsloader.FileStorage
	Mode os.FileMode
}

func NewSafeFileStorage

func NewSafeFileStorage(path string, mode ...os.FileMode) *SafeFileStorage

func (*SafeFileStorage) Writer

func (this *SafeFileStorage) Writer() (io.WriteCloser, error)

type Storage

type Storage interface {
	tlsloader.Storage
	Writer() (w io.WriteCloser, err error)
}

Jump to

Keyboard shortcuts

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