setup

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSubjectEmpty          = errors.New("CA Subject must not be empty")
	ErrValidityPeriodExpired = errors.New("Declining to setup CA which expires within 30 seconds")
	ErrKeyTypeAny            = errors.New("KeyType cannot be KeyAny, please specify a specific key algorithm such as KeyRSA4096")
)
View Source
var ErrValidCAExist = errors.New("Valid CA already exists.")

Functions

func Run

func Run(env *action.Environment, cfg *Config) error

Types

type Config

type Config struct {
	Subject  *dname.Config         `yaml:"subject" flags:""`
	Validity period.ValidityPeriod `yaml:"validity" flags:"validity,time duration/timestamp where the cert is valid to (examples: 30d, 1y, 20220530)"`
	KeyType  wcrypto.KeyType       `yaml:"keyType" flags:"key-type,private key type (rsa, ecdsa),t"`

	NameConstraints NameConstraints `yaml:"nameConstraints"`
}

func ConfigFromCert

func ConfigFromCert(cert *x509.Certificate) (*Config, error)

func DefaultConfig

func DefaultConfig(baseSubject *dname.Config) *Config

func EmptyConfig

func EmptyConfig() *Config

func (*Config) CompatibleWith

func (a *Config) CompatibleWith(b *Config) error

func (*Config) Verify

func (cfg *Config) Verify(now time.Time) error

type NameConstraints added in v0.2.1

type NameConstraints struct {
	PermittedDNSDomains []string
	ExcludedDNSDomains  []string

	PermittedIPRanges []*net.IPNet
	ExcludedIPRanges  []*net.IPNet
}

func (*NameConstraints) IsEmpty added in v0.2.1

func (nc *NameConstraints) IsEmpty() bool

func (*NameConstraints) Strings added in v0.2.1

func (nc *NameConstraints) Strings() []string

func (*NameConstraints) UnmarshalYAML added in v0.2.1

func (p *NameConstraints) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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