MCPcopy Index your code
hub / github.com/RustPython/RustPython / oid_to_attribute_name

Function oid_to_attribute_name

crates/stdlib/src/ssl/cert.rs:141–152  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

139/// Converts common X.509 Distinguished Name OIDs to their standard names.
140/// Returns the OID string itself if not recognized.
141fn 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///

Callers 2

name_to_pyFunction · 0.85
cert_der_to_dict_helperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected