trust

package
v0.12.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlags

func BindFlags(flags *pflag.FlagSet)

Types

type CACertsConfig

type CACertsConfig struct {
	// If nil, system certs will be used.
	CACerts CACertsSource
}

type CACertsSource

type CACertsSource source[*x509.Certificate]

func NewCACertsSource

func NewCACertsSource(certs []*x509.Certificate) CACertsSource

func NewKeyringCACertsSource

func NewKeyringCACertsSource(kr keyring.Keyring) CACertsSource

type InsecureConfig

type InsecureConfig struct {
}

type PKPConfig

type PKPConfig struct {
	Pins PinSource
}

type PinSource

type PinSource source[*pkp.PublicKeyPin]

func NewKeyringPinSource

func NewKeyringPinSource(kr keyring.Keyring) PinSource

func NewPinSource

func NewPinSource(pins []*pkp.PublicKeyPin) PinSource

type Strategy

type Strategy interface {
	TLSConfig() (*tls.Config, error)
	PersistentKey() any
}

type StrategyConfig

type StrategyConfig struct {
	PKP      *PKPConfig
	CACerts  *CACertsConfig
	Insecure *InsecureConfig
}

Configuration for various trust strategies. At least one field must be non-nil. The first non-nil field encountered (in order) will be used to configure the trust strategy.

func BuildConfigFromFlags

func BuildConfigFromFlags(flags *pflag.FlagSet) (*StrategyConfig, error)

func (*StrategyConfig) Build

func (c *StrategyConfig) Build() (Strategy, error)

Jump to

Keyboard shortcuts

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