cert

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeCACerts

func EncodeCACerts(certs []CACert) ([]byte, error)

EncodeCACerts encodes a slice of CACerts as a concatenated PEM bundle. It is the inverse of ParseCACerts. Returns nil for an empty slice so callers can treat nil as "no certificates configured".

Types

type CACert

type CACert struct {
	Fingerprint       string
	Issuer            string
	Subject           string
	NotBefore         time.Time
	NotAfter          time.Time
	Base64EncodedData string
}

func Add

func Add(existing, toAdd []CACert) []CACert

Add returns existing with any certs from toAdd whose fingerprint is not already present appended. Existing order and entries are preserved.

func ParseCACerts

func ParseCACerts(data []byte) ([]CACert, error)

func Remove

func Remove(existing, toRemove []CACert) []CACert

Remove returns existing with any certs whose fingerprint appears in toRemove filtered out.

Jump to

Keyboard shortcuts

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