certificate

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamesFromConfig

func GetNamesFromConfig(
	keyPairs []*configpb.KeyPair,
	routes []*configpb.Route,
	settings []*configpb.Settings,
) (certificateNames []string, routeNames []string)

GetNamesFromConfig gets all the certificate and route host names from config.

func IterateServerCertificatesFromPEM

func IterateServerCertificatesFromPEM(data []byte) iter.Seq[*x509.Certificate]

IterateServerCertificatesFromPEM iterates all of the server certificates found in raw PEM data.

Types

type Matcher

type Matcher[Key comparable] interface {
	// MissingNames returns any route "from" hostnames which don't have
	// a matching certificate.
	MissingNames() []string
	Update(key Key, certificateNames []string, routeNames []string)
}

A Matcher matches routes with certificate names.

func NewMatcher

func NewMatcher[Key comparable]() Matcher[Key]

NewMatcher creates a new Matcher.

type NameIndex

type NameIndex[Key comparable] interface {
	// Add adds all the names to the index for the given key. Multiple
	// keys can be associated with the same names.
	Add(key Key, names []string)
	// Get returns all the names for the given key.
	Get(key Key) []string
	// Keys returns all the known keys. Order is non-deterministic.
	Keys() []Key
	// Lookup looks up any keys associated with the given name. Wildcard search
	// is supported (Lookup("*.example.com") -> would match a key for
	// "www.example.com"). Order is non-deterministic.
	Lookup(name string, allowWildcard bool) []Key
	// Names returns all the known names. Order is non-deterministic.
	Names() []string
	// Remove removes a key from the index and possibly all of its associated
	// names if they aren't referenced by any other keys.
	Remove(key Key)
}

NameIndex is used to index certificate DNS names. It supports exact and wildcard matching and dynamic updates.

func NewNameIndex

func NewNameIndex[Key comparable]() NameIndex[Key]

NewNameIndex creates a new NameIndex for the given key type. The NameIndex is not safe for concurrent use.

Jump to

Keyboard shortcuts

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