in certViewer/cmd/web/certificates.go [459:539]
func GetAttributes(attributes Subject) string {
var attr []string
if len(attributes.Country) > 0 {
attr = append(attr, "C="+strings.Join(attributes.Country, ", C="))
}
if len(attributes.Organization) > 0 {
attr = append(attr, "O="+strings.Join(attributes.Organization, ", O="))
}
if len(attributes.OrganizationalUnit) > 0 {
attr = append(attr, "OU="+strings.Join(attributes.OrganizationalUnit, ", OU="))
}
if len(attributes.Locality) > 0 {
attr = append(attr, "L="+strings.Join(attributes.Locality, ", L="))
}
if len(attributes.StateOrProvince) > 0 {
attr = append(attr, "ST="+strings.Join(attributes.StateOrProvince, ", ST="))
}
if len(attributes.StreetAddress) > 0 {
attr = append(attr, "streetAddress="+strings.Join(attributes.StreetAddress, ", streetAddress="))
}
if len(attributes.PostalCode) > 0 {
attr = append(attr, "postalCode="+strings.Join(attributes.PostalCode, ", postalCode="))
}
if len(attributes.SerialNumber) > 0 {
attr = append(attr, "SN="+attributes.SerialNumber)
}
if len(attributes.CommonName) > 0 {
attr = append(attr, "CN="+attributes.CommonName)
}
if attributes.EmailAddress != nil && len(attributes.EmailAddress.(string)) > 0 {
attr = append(attr, "emailAddress="+attributes.EmailAddress.(string))
}
if attributes.UID != nil && len(attributes.UID.(string)) > 0 {
attr = append(attr, "UID="+attributes.UID.(string))
}
if attributes.DomainComponent != nil && len(attributes.DomainComponent) > 0 {
attr = append(attr, "DC="+strings.Join(attributes.DomainComponent, ", DC="))
}
if attributes.Name != nil && len(attributes.Name.(string)) > 0 {
attr = append(attr, "name="+attributes.Name.(string))
}
if attributes.Surname != nil && len(attributes.Surname.(string)) > 0 {
attr = append(attr, "surname="+attributes.Surname.(string))
}
if attributes.GivenName != nil && len(attributes.GivenName.(string)) > 0 {
attr = append(attr, "givenName="+attributes.GivenName.(string))
}
if attributes.Initials != nil && len(attributes.Initials.(string)) > 0 {
attr = append(attr, "initials="+attributes.Initials.(string))
}
if attributes.GenerationQualifier != nil && len(attributes.GenerationQualifier.(string)) > 0 {
attr = append(attr, "generationQualifier="+attributes.GenerationQualifier.(string))
}
if attributes.Title != nil && len(attributes.Title.(string)) > 0 {
attr = append(attr, "title="+attributes.Title.(string))
}
if attributes.Pseudonym != nil && len(attributes.Pseudonym.(string)) > 0 {
attr = append(attr, "pseudonym="+attributes.Pseudonym.(string))
}
if attributes.BusinessCategory != nil && len(attributes.BusinessCategory.(string)) > 0 {
attr = append(attr, "businessCategory="+attributes.BusinessCategory.(string))
}
if attributes.JurisdictionLocality != nil && len(attributes.JurisdictionLocality.(string)) > 0 {
attr = append(attr, "jurisdictionLocality="+attributes.JurisdictionLocality.(string))
}
if attributes.JurisdictionStateOrProvince != nil && len(attributes.JurisdictionStateOrProvince.(string)) > 0 {
attr = append(attr, "jurisdictionStateOrProvince="+attributes.JurisdictionStateOrProvince.(string))
}
if attributes.JurisdictionCountry != nil && len(attributes.JurisdictionCountry.(string)) > 0 {
attr = append(attr, "jurisdictionCountry="+attributes.JurisdictionCountry.(string))
}
if attributes.OrganizationIdentifier != nil && len(attributes.OrganizationIdentifier.(string)) > 0 {
attr = append(attr, "organizationIdentifier="+attributes.OrganizationIdentifier.(string))
}
if attributes.DNQualifier != nil && len(attributes.DNQualifier.(string)) > 0 {
attr = append(attr, "dnQualifier="+attributes.DNQualifier.(string))
}
return strings.Join(attr, ", ")
}