Skip to content

Commit

Permalink
Add yaml tags to CSR structs. (#681)
Browse files Browse the repository at this point in the history
This allows the transport package to use both YAML and JSON for
storing requests.
  • Loading branch information
kisom committed Oct 19, 2016
1 parent 92f8f79 commit b4a18c5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions csr/csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ type KeyRequest interface {

// A BasicKeyRequest contains the algorithm and key size for a new private key.
type BasicKeyRequest struct {
A string `json:"algo"`
S int `json:"size"`
A string `json:"algo" yaml:"algo"`
S int `json:"size" yaml:"size"`
}

// NewBasicKeyRequest returns a default BasicKeyRequest.
Expand Down Expand Up @@ -130,20 +130,20 @@ func (kr *BasicKeyRequest) SigAlgo() x509.SignatureAlgorithm {

// CAConfig is a section used in the requests initialising a new CA.
type CAConfig struct {
PathLength int `json:"pathlen"`
PathLenZero bool `json:"pathlenzero"`
Expiry string `json:"expiry"`
PathLength int `json:"pathlen" yaml:"pathlen"`
PathLenZero bool `json:"pathlenzero" yaml:"pathlenzero"`
Expiry string `json:"expiry" yaml:"expiry"`
}

// A CertificateRequest encapsulates the API interface to the
// certificate request functionality.
type CertificateRequest struct {
CN string
Names []Name `json:"names"`
Hosts []string `json:"hosts"`
KeyRequest KeyRequest `json:"key,omitempty"`
CA *CAConfig `json:"ca,omitempty"`
SerialNumber string `json:"serialnumber,omitempty"`
Names []Name `json:"names" yaml:"names"`
Hosts []string `json:"hosts" yaml:"hosts"`
KeyRequest KeyRequest `json:"key,omitempty" yaml:"key,omitempty"`
CA *CAConfig `json:"ca,omitempty" yaml:"ca,omitempty"`
SerialNumber string `json:"serialnumber,omitempty" yaml:"serialnumber,omitempty"`
}

// New returns a new, empty CertificateRequest with a
Expand Down

0 comments on commit b4a18c5

Please sign in to comment.