Skip to content

Commit 9b27d0d

Browse files
committed
support for E attribute in CSR
1 parent 9f7129a commit 9b27d0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

csr/csr.go

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type Name struct {
3737
L string `json:"L,omitempty" yaml:"L,omitempty"` // Locality
3838
O string `json:"O,omitempty" yaml:"O,omitempty"` // OrganisationName
3939
OU string `json:"OU,omitempty" yaml:"OU,omitempty"` // OrganisationalUnitName
40+
E string `json:"E,omitempty" yaml:"E,omitempty"`
4041
SerialNumber string `json:"SerialNumber,omitempty" yaml:"SerialNumber,omitempty"`
4142
OID map[string]string `json:"OID,omitempty", yaml:"OID,omitempty"`
4243
}
@@ -195,6 +196,9 @@ func (cr *CertificateRequest) Name() (pkix.Name, error) {
195196
}
196197
name.ExtraNames = append(name.ExtraNames, pkix.AttributeTypeAndValue{Type: oid, Value: v})
197198
}
199+
if n.E != "" {
200+
name.ExtraNames = append(name.ExtraNames, pkix.AttributeTypeAndValue{Type: asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: n.E})
201+
}
198202
}
199203
name.SerialNumber = cr.SerialNumber
200204
return name, nil

0 commit comments

Comments
 (0)