Rename Nid uid/UID to prevent breakage

This commit is contained in:
Joe Wilm 2016-02-02 14:32:57 -08:00
parent 4940ca7e92
commit fe0f8ea1d8
2 changed files with 5 additions and 3 deletions

View File

@ -104,7 +104,8 @@ pub enum Nid {
G, G,
S, S,
I, I,
uid, // uniqueIdentifier /// uniqueIdentifier
UID,
CrlDistributionPoints, CrlDistributionPoints,
RSA_NP_MD5, RSA_NP_MD5,
SN, SN,
@ -170,5 +171,6 @@ pub enum Nid {
ID_QT_UNOTICE, ID_QT_UNOTICE,
RC2_64_CBC, RC2_64_CBC,
SMIMECaps, SMIMECaps,
UID = 458 // userId /// Shown as UID in cert subject
UserId = 458
} }

View File

@ -151,7 +151,7 @@ fn test_nid_uid_value() {
let cert = X509::from_pem(&mut file).ok().expect("Failed to load PEM"); let cert = X509::from_pem(&mut file).ok().expect("Failed to load PEM");
let subject = cert.subject_name(); let subject = cert.subject_name();
let cn = match subject.text_by_nid(Nid::UID) { let cn = match subject.text_by_nid(Nid::UserId) {
Some(x) => x, Some(x) => x,
None => panic!("Failed to read UID from cert"), None => panic!("Failed to read UID from cert"),
}; };