Function x509_parser::objects::oid2sn

source ·
pub fn oid2sn<'a>(
    oid: &'a Oid<'_>,
    registry: &'a OidRegistry<'_>
) -> Result<&'a str, NidError>
Expand description

Returns the short name corresponding to the OID

Examples found in repository?
examples/print-cert.rs (line 26)
25
26
27
28
29
30
fn format_oid(oid: &Oid) -> String {
    match oid2sn(oid, oid_registry()) {
        Ok(s) => s.to_owned(),
        _ => format!("{}", oid),
    }
}
More examples
Hide additional examples
examples/print-crl.rs (line 17)
16
17
18
19
20
21
fn format_oid(oid: &Oid) -> String {
    match oid2sn(oid, oid_registry()) {
        Ok(s) => s.to_owned(),
        _ => format!("{}", oid),
    }
}