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
}
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
}
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
}
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"`
}
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"`
}
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
}
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"`
}
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
}
type SubjectDeleteCmd ¶ added in v0.0.15
type SubjectDeleteCmd struct {
ID uint64 `arg:"" name:"id" help:"Subject identifier"`
}
type SubjectListCmd ¶ added in v0.0.15
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"`
}