trust

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package trust builds CA bundles that combine the host's Public roots with the Instance CA (Section 7.4), for clients that read a single bundle file: SSL_CERT_FILE from `gcpemu env --trust` (FR-CORE-004), the bundle injected into GKE pods (FR-INT-007) and Cloud Build steps.

Index

Constants

View Source
const BundleFile = "ca-bundle.pem"

BundleFile is the combined bundle's name in the instance directory.

Variables

This section is empty.

Functions

func Append

func Append(bundle, caPEM []byte) []byte

Append returns bundle with caPEM appended, unless it already contains it.

func Bundle

func Bundle(caPEM []byte) []byte

Bundle returns the Public roots followed by caPEM.

func PublicRootPool added in v0.15.0

func PublicRootPool() *x509.CertPool

PublicRootPool returns a new pool of the Public roots, which the caller may add to.

func PublicRoots added in v0.15.0

func PublicRoots() []byte

PublicRoots returns the Public roots (PEM): the root CAs the host trusts for public sites, without any Instance CA (Instances trust each other only by Pairing), or nil when none are found. They are read once per process: a bundle file on Linux, the keychain on macOS, the ROOT certificate store on Windows. SSL_CERT_FILE is ignored so that a bundle produced by `gcpemu env --trust` is never folded into itself.

func WriteBundle

func WriteBundle(path string, caPEM []byte) (string, error)

WriteBundle writes Bundle(caPEM) to path atomically (mode 0644: it holds only public certificates) and returns path.

Types

type Source added in v0.15.0

type Source struct {
	// Where names the store or file they came from; "" when none was found.
	Where string
	// FallbackErr is why the OS's own store could not be read, when the
	// Public roots came from a fallback file instead (macOS).
	FallbackErr error
}

Source says where the Public roots were read from.

func PublicRootsSource added in v0.15.0

func PublicRootsSource() Source

PublicRootsSource says where PublicRoots came from.

Jump to

Keyboard shortcuts

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