cert

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 21 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CACreateCmd added in v0.0.15

type CACreateCmd struct {
	Name   string        `arg:"" name:"name" help:"Certificate authority name"`
	Expiry time.Duration `name:"expiry" help:"Lifetime, which is five years when it's not set, capped at the root's expiry"`
	Tags   []string      `name:"tag" help:"Tag. Repeat for more than one."`
	// contains filtered or unexported fields
}

func (*CACreateCmd) Run added in v0.0.15

func (cmd *CACreateCmd) Run(ctx server.Cmd) error

type CARenewCmd added in v0.0.15

type CARenewCmd struct {
	Name   string        `arg:"" name:"name" help:"Certificate authority name"`
	Serial string        `arg:"" optional:"" name:"serial" help:"Serial number, which is the latest version when it's not set"`
	Expiry time.Duration `name:"expiry" help:"Lifetime, which is the current one when it's not set, capped at the root's expiry"`
	// contains filtered or unexported fields
}

func (*CARenewCmd) Run added in v0.0.15

func (cmd *CARenewCmd) Run(ctx server.Cmd) error

type CertCommands

type CertCommands struct {
	CACreate   CACreateCmd   `cmd:"" name:"ca-create" help:"Create a certificate authority, signed by the root." group:"CERTIFICATE"`
	CARenew    CARenewCmd    `cmd:"" name:"ca-renew" help:"Renew a certificate authority. The current version stays enabled." group:"CERTIFICATE"`
	CertList   CertListCmd   `` /* 202-byte string literal not displayed */
	CertGet    CertGetCmd    `` /* 169-byte string literal not displayed */
	CertCreate CertCreateCmd `cmd:"" name:"cert-create" help:"Create a certificate, signed by a certificate authority." group:"CERTIFICATE"`
	CertRenew  CertRenewCmd  `cmd:"" name:"cert-renew" help:"Renew a certificate, which disables the current version." group:"CERTIFICATE"`
	CertUpdate CertUpdateCmd `cmd:"" name:"cert-update" help:"Enable or disable a certificate, or change its tags." group:"CERTIFICATE"`
}

CertCommands create, renew, list, get and update certificate authorities and certificates

type CertCreateCmd added in v0.0.15

type CertCreateCmd struct {
	Name     string        `arg:"" name:"name" help:"Certificate name"`
	CA       string        `arg:"" name:"ca" help:"Certificate authority name"`
	CASerial string        `arg:"" optional:"" name:"serial" help:"Certificate authority serial number, which is its latest version when it's not set"`
	Expiry   time.Duration `name:"expiry" help:"Lifetime, which is 90 days when it's not set, capped at the certificate authority's expiry"`
	SAN      []string      `` /* 133-byte string literal not displayed */
	Tags     []string      `name:"tag" help:"Tag. Repeat for more than one."`
	// contains filtered or unexported fields
}

func (*CertCreateCmd) Run added in v0.0.15

func (cmd *CertCreateCmd) Run(ctx server.Cmd) error

type CertGetCmd added in v0.0.15

type CertGetCmd struct {
	Name     string `arg:"" name:"name" help:"Certificate name"`
	Serial   string `arg:"" optional:"" name:"serial" help:"Serial number, which is the latest version when it's not set"`
	Chain    bool   `name:"chain" help:"Include the issuer chain, up to the root"`
	Key      bool   `name:"key" help:"Include the private key, of a leaf certificate"`
	Show     bool   `name:"show" help:"Print a private key when the output is a terminal, rather than a pipe or file"`
	Comments bool   `name:"comments" default:"true" negatable:"" help:"Write the certificate's details as comments before each PEM block"`
}

func (*CertGetCmd) Run added in v0.0.15

func (cmd *CertGetCmd) Run(ctx server.Cmd) error

type CertListCmd added in v0.0.15

type CertListCmd struct {
	CA      *bool    `name:"ca" negatable:"" help:"Only certificate authorities, or with --no-ca, only leaf certificates"`
	Enabled *bool    `name:"enabled" negatable:"" help:"Only enabled certificates, or with --no-enabled, only disabled ones"`
	Valid   *bool    `name:"valid" negatable:"" help:"Only certificates within their validity period, or with --no-valid, only those outside it"`
	Tags    []string `name:"tag" help:"Only certificates with the tag. Repeat to require more than one."`
	All     bool     `name:"all" help:"Every version of the certificates, rather than the latest"`
	Name    string   `name:"name" help:"The versions of the certificate with the name, the latest first"`
	Sort    string   `name:"sort" enum:",name,signer,expires" default:"" help:"Sort by name, signer or expires"`
	Desc    bool     `name:"desc" help:"Sort in descending order"`
	Offset  uint64   `name:"offset" help:"Offset within the list"`
	Limit   *uint64  `name:"limit" help:"Number of certificates to list"`
}

func (*CertListCmd) Run added in v0.0.15

func (cmd *CertListCmd) Run(ctx server.Cmd) error

type CertRenewCmd added in v0.0.15

type CertRenewCmd struct {
	Name   string        `arg:"" name:"name" help:"Certificate name"`
	Serial string        `arg:"" optional:"" name:"serial" help:"Serial number, which is the latest version when it's not set"`
	Expiry time.Duration `name:"expiry" help:"Lifetime, which is the current one when it's not set, capped at the certificate authority's expiry"`
	// contains filtered or unexported fields
}

func (*CertRenewCmd) Run added in v0.0.15

func (cmd *CertRenewCmd) Run(ctx server.Cmd) error

type CertUpdateCmd added in v0.0.15

type CertUpdateCmd struct {
	Name      string   `arg:"" name:"name" help:"Certificate name"`
	Serial    string   `arg:"" optional:"" name:"serial" help:"Serial number, which is the latest version when it's not set"`
	Enabled   *bool    `name:"enabled" negatable:"" help:"Enable the certificate, or with --no-enabled, disable it, and the certificates it signed"`
	Tags      []string `name:"tag" help:"Replace the tags. Repeat for more than one."`
	ClearTags bool     `name:"clear-tags" help:"Remove the tags"`
}

func (*CertUpdateCmd) Run added in v0.0.15

func (cmd *CertUpdateCmd) Run(ctx server.Cmd) error

type ServerFlags added in v0.0.15

type ServerFlags struct {
	Root string `` /* 251-byte string literal not displayed */
}

ServerFlags configures the certificate manager, in a pool, schema and with passphrases, which are passed to WithCertManager

func (ServerFlags) WithCertManager added in v0.0.15

func (flags ServerFlags) WithCertManager(ctx server.Cmd, pool pg.PoolConn, schema string, passphrases []string, fn func(*manager.Manager) error, opts ...manager.Opt) error

WithCertManager creates the certificate manager in the pool and schema, which is the default when it's empty, with the passphrases, for versions 1, 2 and so on, which encrypt its private keys, and the root, when it's set, and calls fn with it, with the manager's own options. Without a root, one is generated, named after the command, when none is stored and there's a passphrase to encrypt its key.

type SubjectCommands added in v0.0.15

type SubjectCommands struct {
	SubjectList   SubjectListCmd   `cmd:"" name:"subjects" help:"List subjects, with the number of certificates which use each." group:"CERTIFICATE"`
	SubjectCreate SubjectCreateCmd `cmd:"" name:"subject-create" help:"Create a subject, or show the identical one which is stored." group:"CERTIFICATE"`
	SubjectUpdate SubjectUpdateCmd `` /* 131-byte string literal not displayed */
	SubjectDelete SubjectDeleteCmd `cmd:"" name:"subject-delete" help:"Delete a subject which no certificate uses." group:"CERTIFICATE"`
}

SubjectCommands list, create, update and delete the subjects which certificates are created with

type SubjectCreateCmd added in v0.0.15

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

func (*SubjectCreateCmd) Run added in v0.0.15

func (cmd *SubjectCreateCmd) Run(ctx server.Cmd) error

type SubjectDeleteCmd added in v0.0.15

type SubjectDeleteCmd struct {
	ID uint64 `arg:"" name:"id" help:"Subject identifier"`
}

func (*SubjectDeleteCmd) Run added in v0.0.15

func (cmd *SubjectDeleteCmd) Run(ctx server.Cmd) error

type SubjectListCmd added in v0.0.15

type SubjectListCmd struct {
	Offset uint64  `name:"offset" help:"Offset within the list"`
	Limit  *uint64 `name:"limit" help:"Number of subjects to list"`
}

func (*SubjectListCmd) Run added in v0.0.15

func (cmd *SubjectListCmd) Run(ctx server.Cmd) error

type SubjectUpdateCmd added in v0.0.15

type SubjectUpdateCmd struct {
	ID            uint64  `arg:"" name:"id" help:"Subject identifier"`
	Org           *string `name:"organization" help:"Subject organization name"`
	Unit          *string `name:"organizational-unit" help:"Subject organizational unit"`
	Country       *string `name:"country" help:"Subject country code"`
	City          *string `name:"city" help:"Subject locality or city"`
	State         *string `name:"state" help:"Subject state or province"`
	StreetAddress *string `name:"street-address" help:"Subject street address"`
	PostalCode    *string `name:"postal-code" help:"Subject postal code"`
}

func (*SubjectUpdateCmd) Run added in v0.0.15

func (cmd *SubjectUpdateCmd) Run(ctx server.Cmd) error

Jump to

Keyboard shortcuts

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