Skip to content

Commit

Permalink
csr: Add NotBefore & NotAfter to CAConfig
Browse files Browse the repository at this point in the history
Setting these was only previously possible with backdate and expiry but could
be a pain to figure out the tdeltas correctly. Sometimes its just easier to
explicitly give the timestamps.
  • Loading branch information
mmlb committed Jan 30, 2023
1 parent c5e40da commit bdadff2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions csr/csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"net/url"
"strconv"
"strings"
"time"

cferr "github.com/cloudflare/cfssl/errors"
"github.com/cloudflare/cfssl/helpers"
Expand Down Expand Up @@ -127,10 +128,12 @@ func (kr *KeyRequest) SigAlgo() x509.SignatureAlgorithm {

// CAConfig is a section used in the requests initialising a new CA.
type CAConfig struct {
PathLength int `json:"pathlen" yaml:"pathlen"`
PathLenZero bool `json:"pathlenzero" yaml:"pathlenzero"`
Expiry string `json:"expiry" yaml:"expiry"`
Backdate string `json:"backdate" yaml:"backdate"`
PathLength int `json:"pathlen" yaml:"pathlen"`
PathLenZero bool `json:"pathlenzero" yaml:"pathlenzero"`
Expiry string `json:"expiry" yaml:"expiry"`
Backdate string `json:"backdate" yaml:"backdate"`
NotBefore time.Time `json:"not_before" yaml:"not_before"`
NotAfter time.Time `json:"not_after" yaml:"not_after"`
}

// A CertificateRequest encapsulates the API interface to the
Expand Down

0 comments on commit bdadff2

Please sign in to comment.