-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: crypto/x509/pkix: add String() method to type Name #21615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you @stub42 for the issue, I've retitled it a little as a proposal(since it's a feature request that needs a judgement call) and I'll page @agl and other crypto folks. Also, in case you'd like @stub42, please feel free to submit a CL prototyping this change, it might help expedite and make it easier to review the proposal. |
Thoughts, @agl or @FiloSottile? |
Just to add my 2 cents: There is RFC2253 that could be used as the basis for the Stringer implementation. Some third party services cough*mongoDB <=3.2*cough require this form. |
A good implementation of RFC 2253 would be reasonable here. |
Change https://golang.org/cl/67270 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.9
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Linux, amd64
What did you do?
Attempt to render a pkix.Name to a string (crypto/x509/pkix)
What did you expect to see?
pkix.Name implementing the fmt.Stringer interface. The String() method would return the standard format DN string with the common fields rendered correctly (C=AU,O=CompanyOrg,CN=fred), and extra fields rendered as best they can (probably oid=val)
What did you see instead?
No String() method on pkix.Name. In addition, the oid -> name mappings are not exported, so these need to be duplicated in order to render the individual AttributeTypeAndValue components.
https://stackoverflow.com/questions/39125873/golang-subject-dn-from-x509-cert is one such implementation.
The text was updated successfully, but these errors were encountered: