Skip to content

Commit

Permalink
pki: Add docs to some struct fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed May 18, 2020
1 parent 483e31b commit c47ddbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion modules/caddypki/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ type CA struct {
// and Mozilla Firefox trust stores. Default: true.
InstallTrust *bool `json:"install_trust,omitempty"`

Root *KeyPair `json:"root,omitempty"`
// The root certificate to use; if empty, one will be generated.
Root *KeyPair `json:"root,omitempty"`

// The intermediate (signing) certificate; if empty, one will be generated.
Intermediate *KeyPair `json:"intermediate,omitempty"`

// Optionally configure a separate storage module associated with this
Expand Down
12 changes: 10 additions & 2 deletions modules/caddypki/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,17 @@ func trusted(cert *x509.Certificate) bool {
// KeyPair represents a public-private key pair, where the
// public key is also called a certificate.
type KeyPair struct {
// The certificate. By default, this should be the path to
// a PEM file unless format is something else.
Certificate string `json:"certificate,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
Format string `json:"format,omitempty"`

// The private key. By default, this should be the path to
// a PEM file unless format is something else.
PrivateKey string `json:"private_key,omitempty"`

// The format in which the certificate and private
// key are provided. Default: pem_file
Format string `json:"format,omitempty"`
}

// Load loads the certificate and key.
Expand Down

0 comments on commit c47ddbe

Please sign in to comment.