rsa/pkg/inspect/x509_dn.go

19 lines
388 B
Go

package inspect
import "crypto/x509/pkix"
// appendX509DNField will append a field containing the X.509 distinguished name
// (approximately) if it contains anything more than a common name.
func appendX509DNField(in []Field, name pkix.Name) []Field {
name.CommonName = ""
s := name.String()
if s == "" {
return in
}
return append(in, Field{
Key: "Other",
Value: s,
})
}