Map X.509 OID to human-readable attribute name Converts common X.509 Distinguished Name OIDs to their standard names. Returns the OID string itself if not recognized.
(oid_str: &str)
| 139 | /// Converts common X.509 Distinguished Name OIDs to their standard names. |
| 140 | /// Returns the OID string itself if not recognized. |
| 141 | fn oid_to_attribute_name(oid_str: &str) -> &str { |
| 142 | match oid_str { |
| 143 | "2.5.4.3" => "commonName", |
| 144 | "2.5.4.6" => "countryName", |
| 145 | "2.5.4.7" => "localityName", |
| 146 | "2.5.4.8" => "stateOrProvinceName", |
| 147 | "2.5.4.10" => "organizationName", |
| 148 | "2.5.4.11" => "organizationalUnitName", |
| 149 | "1.2.840.113549.1.9.1" => "emailAddress", |
| 150 | _ => oid_str, |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | /// Format IP address (IPv4 or IPv6) to string |
| 155 | /// |
no outgoing calls
no test coverage detected