Skip to content

Commit

Permalink
Merge pull request #1172 from aklyachkin/master
Browse files Browse the repository at this point in the history
Support for E attribute (emailAddress) in CSR
  • Loading branch information
maxnystrom authored Feb 25, 2021
2 parents 2215630 + 9b27d0d commit b1512a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions csr/csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type Name struct {
L string `json:"L,omitempty" yaml:"L,omitempty"` // Locality
O string `json:"O,omitempty" yaml:"O,omitempty"` // OrganisationName
OU string `json:"OU,omitempty" yaml:"OU,omitempty"` // OrganisationalUnitName
E string `json:"E,omitempty" yaml:"E,omitempty"`
SerialNumber string `json:"SerialNumber,omitempty" yaml:"SerialNumber,omitempty"`
OID map[string]string `json:"OID,omitempty", yaml:"OID,omitempty"`
}
Expand Down Expand Up @@ -195,6 +196,9 @@ func (cr *CertificateRequest) Name() (pkix.Name, error) {
}
name.ExtraNames = append(name.ExtraNames, pkix.AttributeTypeAndValue{Type: oid, Value: v})
}
if n.E != "" {
name.ExtraNames = append(name.ExtraNames, pkix.AttributeTypeAndValue{Type: asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: n.E})
}
}
name.SerialNumber = cr.SerialNumber
return name, nil
Expand Down

0 comments on commit b1512a1

Please sign in to comment.