pub struct Oid { /* private fields */ }Expand description
An owned Object Identifier wrapping an OpenSSL ASN1_OBJECT*.
Oid::from_text accepts any dotted decimal OID string ("1.3.6.1.5.2.3.5")
or registered short name ("sha256"), returning an Oid even for OIDs that are
not in OpenSSL’s built-in NID table. For registered OIDs, Oid::nid returns
the corresponding NID; for unregistered OIDs it returns 0 (NID_undef).
Two Oid values compare equal when their ASN.1 encodings are identical,
regardless of whether either has a registered NID.
Implementations§
Source§impl Oid
impl Oid
Sourcepub fn from_text(s: &str) -> Result<Self, ErrorStack>
pub fn from_text(s: &str) -> Result<Self, ErrorStack>
Construct from a dotted decimal OID string ("1.3.6.1.5.2.3.5") or a
registered short name ("sha256").
Unlike crate::x509::nid_from_text, this succeeds for OIDs that are
not registered in OpenSSL’s built-in NID table.
§Errors
Returns an ErrorStack if s is not a valid OID string or name, or
if s contains an interior NUL byte.