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

Organizational Unit number is wrong #16

Closed
certaintls opened this issue Jun 29, 2020 · 6 comments
Closed

Organizational Unit number is wrong #16

certaintls opened this issue Jun 29, 2020 · 6 comments

Comments

@Ephenodrom
Copy link
Owner

Hello @certaintls and thanks for the issue.

The number 2.5.6.5 refers to the organizationUnit Class as described here https://oidref.com/2.5.6.5. What you mean is the organizationalUnitName that has the ObjectIdentifierNumber 2.5.4.11.

In an CSR or certificate the distinguished names ( DN ) offen contain the short version like "ou" that has the number 2.5.4.11. Thats why you receive this number instead of 2.5.6.5.

I will also add the full version for some distinguished names within the map.

@certaintls
Copy link
Author

I see. Thanks for the information. Maybe I was using it wrong;

To access ou, we need to do data.subject['2.5.4.11'], but for seasonal developers who can't remember these numbers, I was trying to access it like data.subject[X509Utils.DN['organizationalUnit']], but this doesn't work.

Do you have a suggestion on how to access each field by using a human readable name?

@Ephenodrom
Copy link
Owner

Try this :

data.subject[X509Utils.DN['ou']];

As you can see on https://github.com/Ephenodrom/Dart-Basic-Utils/blob/master/lib/src/X509Utils.dart#L35.

@certaintls
Copy link
Author

I see it now. Thanks. Shall I close this issue or you are still interested in making some improvement?

@Ephenodrom
Copy link
Owner

Let's keep this open, i will make some improvements to the DN map.

Ephenodrom added a commit that referenced this issue Jul 7, 2020
@Ephenodrom
Copy link
Owner

I updated the DN list and added the following data :

    'organizationalUnitName': '2.5.4.11',
    'organizationName': '2.5.4.10',
    'stateOrProvinceName': '2.5.4.8',
    'commonName': '2.5.4.3',
    'surname': '2.5.4.4',
    'countryName': '2.5.4.6',
    'localityName': '2.5.4.7',
    'streetAddress': '2.5.4.9'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants