generator

package
v0.0.0-...-dbcdf9e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 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 CertOpt

type CertOpt func(g *Generator)

CertOpt is used to configure different options for the Generator.

func WithKeySize

func WithKeySize(keySize uint64) CertOpt

WithKeySize configures the Generator to generate keys with `keySize` bits.

func WithOrgName

func WithOrgName(orgName string) CertOpt

WithOrgName configures the Generator to use the given orgName when generating certificates.

func WithValidityInDays

func WithValidityInDays(validityInDays uint64) CertOpt

WithValidityInDays configures the Generator to generate certificates that are valid for `validityInDays` days.

type Generator

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

Generator generates self-signed TLS certificates.

func New

func New(opts ...CertOpt) *Generator

New creates and returns a new Generator based in the given `opts`.

func (*Generator) NewTLS

func (g *Generator) NewTLS() (cert.Certificate, error)

NewTLS generates a self-signed TLS certificate with a newly created private key, and returns both the cert and the private key PEM encoded.

Jump to

Keyboard shortcuts

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