You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
stub42
changed the title
No help rendering x509 certificate subject to DN string
crypto/x509: No help rendering x509 certificate subject to DN string
Aug 25, 2017
odeke-em
changed the title
crypto/x509: No help rendering x509 certificate subject to DN string
proposal: crypto/x509/pkix: add String() method to type Name
Aug 25, 2017
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.
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.
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: