secrets

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package secrets resolves CA private key passwords from multiple sources.

Precedence chain (first non-empty wins):

  1. Per-CA env var: PKI_KEY_PASSWORD_<CA_NAME> (uppercase, hyphens→underscores) Example: PKI_KEY_PASSWORD_ISSUING for CA named "issuing"
  2. Global env var: PKI_KEY_PASSWORD (systemd LoadCredential injection)
  3. Secrets file: path from PKI_PASSWORD_FILE env var (format: "ca_name=password" per line)
  4. Config file value: the "password" field in ca.password JSON config

This allows deployments to keep passwords out of the JSON config file entirely, using systemd credentials or environment injection instead (Tier 1 security).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveCAKeyPassword

func ResolveCAKeyPassword(caName, configPassword string) string

ResolveCAKeyPassword resolves the CA private key password using the precedence chain. caName is the logical CA name from config (e.g., "issuing", "root"). configPassword is the value from the JSON config's ca.password field (may be empty).

Types

This section is empty.

Jump to

Keyboard shortcuts

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