pki

package
v0.0.0-...-2d4ef54 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package pki owns the persistent MooX private CA and deployment-time host certificate issuance. It never replaces an existing or partial CA.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCA = errors.New("MooX CA is missing, incomplete, invalid, or expired; restore the original CA rather than regenerating it")

Functions

This section is empty.

Types

type HostIdentity

type HostIdentity struct {
	HostID         string
	Address        string
	PrivateAddress string
	// Outbound 为只能出站的主机签发:证书同时带 ClientAuth,网关用它与 control 建立反向连接。
	Outbound bool
}

type IssuedCertificate

type IssuedCertificate struct {
	hostbundle.CertificateInfo
	HostID        string `json:"host_id"`
	CAFingerprint string `json:"ca_sha256"`
	Certificate   string `json:"certificate_file"`
	Key           string `json:"key_file"`
	CA            string `json:"ca_file"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func Open

func Open(dir string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) EnsureCA

func (s *Store) EnsureCA() (hostbundle.CAInfo, error)

func (*Store) ExportCA

func (s *Store) ExportCA(outputDir string) (hostbundle.CertificateInfo, error)

ExportCA publishes only the public root, after validating the original pair.

func (*Store) GoString

func (s *Store) GoString() string

func (*Store) Info

func (s *Store) Info() (hostbundle.CAInfo, error)

Info validates an existing CA without creating or repairing trust material. Normal host deployments must use this after the initial offline bootstrap.

func (*Store) Issue

func (s *Store) Issue(host HostIdentity, outputDir string) (IssuedCertificate, error)

Issue always creates a new key and certificate. The entire output directory is published together and must be absent; deployment then installs the bundle.

func (*Store) String

func (*Store) String() string

Jump to

Keyboard shortcuts

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