Documentation ¶
Overview ¶
Package cert contains certificate specifications and certificate-specific management.
Index ¶
- type CA
- type File
- type Spec
- func (spec *Spec) Backoff() time.Duration
- func (spec *Spec) Certificate() *x509.Certificate
- func (spec *Spec) Dequeue()
- func (spec *Spec) Identity() (*core.Identity, error)
- func (spec *Spec) IsQueued() bool
- func (spec *Spec) Lifespan() time.Duration
- func (spec *Spec) Queue()
- func (spec *Spec) Ready() bool
- func (spec *Spec) RefreshKeys() error
- func (spec *Spec) ResetBackoff()
- func (spec *Spec) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CA ¶
type CA struct { Name string `json:"name" yaml:"name"` Remote string `json:"remote" yaml:"remote"` Label string `json:"label" yaml:"label"` Profile string `json:"profile" yaml:"profile"` AuthKey string `json:"auth_key" yaml:"auth_key"` AuthKeyFile string `json:"auth_key_file" yaml:"auth_key_file"` File *File `json:"file,omitempty" yaml:"file,omitempty"` // contains filtered or unexported fields }
A CA contains the core details for a CFSSL CA. There are two ways to use this: fill out Name to refer to a global CA (e.g. as defined in the config file) or fill out Remote, Label, Profile, and AuthKey.
type File ¶
type File struct { Path string `json:"path" yaml:"path"` Owner string `json:"owner" yaml:"owner"` Group string `json:"group" yaml:"group"` Mode string `json:"mode" yaml:"mode"` // contains filtered or unexported fields }
File contains path and ownership information for a file.
func (*File) Parse ¶
Parse sets up the File structure from its string parameters; the hint is used to provide a hint as to what file is being processed for use in error messages. This includes validating that the user and group referenced exist; providing sensible defaults, and processing the mode. The method is intended to allow set up after unmarshalling from a configuration file.
type Spec ¶
type Spec struct { // This defines the service manager to use. This should be defined // globally rather than per cert- it's allowed here to allow cert // definitions to use a servicemanager of 'command' to allow freeform // invocations. ServiceManager string `json:"svcmgr" yaml:"svcmgr"` // The service is the service that uses this certificate. If // this field is not empty, the action below will be applied // to this service upon certificate renewal. It can also be // used to describe what this certificate is for. Service string `json:"service" yaml:"service"` // Action is one of empty, "nop", "reload", or "restart" (see // the svcmgr package for details). Action string `json:"action" yaml:"action"` // Request contains the CSR metadata needed to request a // certificate. Request *csr.CertificateRequest `json:"request" yaml:"request"` // Key contains the file metadata for the private key. Key *File `json:"private_key" yaml:"private_key"` // Cert contains the file metadata for the certificate. Cert *File `json:"certificate" yaml:"certificate"` // CA specifies the certificate authority that should be used. CA CA `json:"authority" yaml:"authority"` // Path points to the on-disk location of the certificate // spec. Path string // contains filtered or unexported fields }
A Spec contains information needed to monitor and renew a certificate.
func (*Spec) Certificate ¶
func (spec *Spec) Certificate() *x509.Certificate
Certificate returns the x509.Certificate associated with the spec if one exists.
func (*Spec) Dequeue ¶
func (spec *Spec) Dequeue()
Dequeue marks the spec as having been removed from the renewal queue.
func (*Spec) Ready ¶
Ready returns true if the key pair specified by the Spec exists; it doesn't check whether it needs to be renewed.
func (*Spec) RefreshKeys ¶
RefreshKeys will make sure the key pair in the Spec has loaded keys and has a valid certificate. It will handle any persistence, check that the certificate is valid (i.e. that its expiry date is within the Before date), and handle certificate reissuance as needed.
func (*Spec) ResetBackoff ¶
func (spec *Spec) ResetBackoff()
ResetBackoff resets the spec's backoff.