certpath

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package certpath provides the filesystem boundary for persisted certificates. User-provided certificate identifiers are never used as path components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(raw string, allowWildcard bool) (string, error)

Normalize canonicalizes and validates a DNS certificate identifier. IP address certificates are accepted, and a wildcard is allowed only as the complete left-most label when allowWildcard is true. Internationalized names must be supplied in their ASCII A-label form.

func NormalizeAll

func NormalizeAll(raw []string, allowWildcard bool) ([]string, error)

NormalizeAll validates, canonicalizes, and de-duplicates domains while preserving their first-seen order.

func ReadACMEIndex

func ReadACMEIndex(cacheDir string) ([]byte, error)

ReadACMEIndex reads the fixed ACME domain index used for eager cache loads.

func ReadMetadata

func ReadMetadata(cacheDir string) ([]byte, error)

ReadMetadata reads the fixed certificate metadata document.

func ReadPair

func ReadPair(cacheDir string, namespace Namespace, domain string) ([]byte, []byte, error)

ReadPair securely reads a certificate and private key. If only the legacy domain-named pair exists, it is migrated before being returned.

func RemovePair

func RemovePair(cacheDir string, namespace Namespace, domain string) error

RemovePair removes a persisted certificate pair without following symlinks.

func WriteACMEIndex

func WriteACMEIndex(cacheDir string, data []byte) error

WriteACMEIndex atomically replaces the fixed ACME domain index.

func WriteMetadata

func WriteMetadata(cacheDir string, data []byte) error

WriteMetadata atomically replaces the fixed certificate metadata document.

func WritePair

func WritePair(cacheDir string, namespace Namespace, domain string, certPEM, keyPEM []byte) error

WritePair atomically replaces the certificate and private-key files. Each file replacement is atomic; callers must still treat the two files as a pair.

Types

type Namespace

type Namespace uint8

Namespace selects one of the fixed certificate storage locations.

const (
	ACME Namespace = iota
	Manual
)

Jump to

Keyboard shortcuts

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