Help us shape the future of Go! Take the 2026 Go Developer Survey

ca

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CA

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

CA performs CA operations.

func New

func New(privateKey sshcert.RawPrivateKey, policyURL string, options ...Option) (*CA, error)

New creates a new CA.

func (*CA) FetchDiscovery added in v0.14.0

func (c *CA) FetchDiscovery(ctx context.Context) (*wire.Discovery, error)

FetchDiscovery fetches discovery data from the policy server. The request carries a CA-minted, request-bound JWT (pkg/serviceauth). The response's Cache-Control header is preserved on the returned Discovery so callers (the CA server's /discovery handler) can pass it through to clients; this CA client itself does not cache.

func (*CA) PolicyURL added in v0.1.0

func (c *CA) PolicyURL() string

PolicyURL returns the URL of the policy server.

func (*CA) PublicKey

func (c *CA) PublicKey() sshcert.RawPublicKey

PublicKey returns the ssh on-disk format public key for the CA.

func (*CA) RequestPolicy

func (c *CA) RequestPolicy(ctx context.Context, token string, conn policy.Connection) (*wire.PolicyResponse, error)

RequestPolicy requests policy from the policy server for a cert request. The request carries a CA-minted, request-bound JWT (pkg/serviceauth).

func (*CA) SignPublicKey

func (c *CA) SignPublicKey(rawPubKey sshcert.RawPublicKey, params *wire.CertParams) (sshcert.RawCertificate, error)

SignPublicKey signs a key to generate a certificate.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures the CA.

func WithLogger added in v0.3.3

func WithLogger(logger *slog.Logger) Option

WithLogger configures the CA to use the specified logger.

func WithTLSConfig added in v0.1.4

func WithTLSConfig(cfg tlsconfig.Config) Option

WithTLSConfig creates an HTTP client with the specified TLS configuration, using tlsconfig's shared default timeout rather than a locally-duplicated literal.

Jump to

Keyboard shortcuts

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