Skip to content
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

crypto/x509: Certificate Subject UID not being parsed #25667

Trane9991 opened this issue May 31, 2018 · 4 comments

crypto/x509: Certificate Subject UID not being parsed #25667

Trane9991 opened this issue May 31, 2018 · 4 comments


Copy link

@Trane9991 Trane9991 commented May 31, 2018

What version of Go are you using (go version)?


Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?


What did you do?

Trying to get the UID from certificate attributes.

What did you expect to see?

pkix.Name object with the UID field in it.

What did you see instead?

OID for the UserID is not defined in the, so it is not being parsed.

Copy link

@adamdecaf adamdecaf commented May 31, 2018

@bradfitz bradfitz added this to the Go1.12 milestone May 31, 2018
@bradfitz bradfitz changed the title x509 Certificate Subject UID not being parsed crypto/x509: Certificate Subject UID not being parsed May 31, 2018
Copy link

@odeke-em odeke-em commented Jun 1, 2018

/cc @agl too

Copy link

@FiloSottile FiloSottile commented Jun 1, 2018

It should still be accessible unparsed in the Names field.

If you think we should add an entry to the struct for it, we'll need example certificates and the use cases of it. We intentionally only parse the most popular OIDs, and leave the rest to be parsed by applications in Names.

@FiloSottile FiloSottile modified the milestones: Go1.12, Unplanned Jun 1, 2018
Copy link

@Trane9991 Trane9991 commented Jun 1, 2018

Yeah, I was able to get it this way:, but thanks for your reply, it is simple to get it from Names field (I will update my SO reply with this approach).

I'm using this to get the UID from Apple Push Notifications Certificates since app bundle id is stored there. But I think reading it from Names field is enough for my use case and I can close this issue. Let's reopen if there is more demand for this field.

@Trane9991 Trane9991 closed this Jun 1, 2018
@golang golang locked and limited conversation to collaborators Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.