Closed certaintls closed 4 years ago
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.
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?
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.
I see it now. Thanks. Shall I close this issue or you are still interested in making some improvement?
Let's keep this open, i will make some improvements to the DN map.
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'
This line https://github.com/Ephenodrom/Dart-Basic-Utils/blob/master/lib/src/X509Utils.dart#L50 defines it as
2.5.6.5
, but when you printdata.toJson().toString()
, the OU is2.5.4.11
, which is confirmed by a simple search https://books.google.com/books?id=kEXIBAAAQBAJ&pg=PA25&lpg=PA25&dq=2.5.4.11+organizational+unit++certificate&source=bl&ots=YRgJH0Vgp0&sig=ACfU3U10ooyCzrVNQ5GSmSqrxWfe6jqlBA&hl=en&sa=X&ved=2ahUKEwiK4LfD9qbqAhUi-2EKHXTsBWYQ6AEwA3oECAsQAQ#v=onepage&q=2.5.4.11%20organizational%20unit%20%20certificate&f=false