Struct asn1::ObjectIdentifier
source · pub struct ObjectIdentifier { /* private fields */ }
Expand description
Represents an ASN.1 OBJECT IDENTIFIER
. ObjectIdentifier
s are opaque,
the only thing may be done with them is test if they are equal to another
ObjectIdentifier
. The generally recommended practice for handling them
is to create some ObjectIdentifier
constants with asn1::oid!()
and
then compare them with ObjectIdentifier
s you get from parsing.
asn1::oid!()
takes a series of arcs, for example: asn1::oid!(1, 2, 3)
.
rust-asn1 stores ObjectIdentifier
s in a fixed-size buffer, therefore
they are limited to OID values whose DER encoding fits into that buffer.
This buffer is sufficiently large to fit all known publically known OIDs,
so this should not affect most people.
Implementations§
source§impl ObjectIdentifier
impl ObjectIdentifier
sourcepub fn from_string(oid: &str) -> Option<ObjectIdentifier>
pub fn from_string(oid: &str) -> Option<ObjectIdentifier>
Parses an OID from a dotted string, e.g. "1.2.840.113549"
.
sourcepub fn from_der(data: &[u8]) -> ParseResult<ObjectIdentifier>
pub fn from_der(data: &[u8]) -> ParseResult<ObjectIdentifier>
Creates an ObjectIdentifier
from its DER representation. This does
not perform any allocations or copies.
Trait Implementations§
source§impl Clone for ObjectIdentifier
impl Clone for ObjectIdentifier
source§fn clone(&self) -> ObjectIdentifier
fn clone(&self) -> ObjectIdentifier
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ObjectIdentifier
impl Debug for ObjectIdentifier
source§impl Display for ObjectIdentifier
impl Display for ObjectIdentifier
source§impl Hash for ObjectIdentifier
impl Hash for ObjectIdentifier
source§impl PartialEq for ObjectIdentifier
impl PartialEq for ObjectIdentifier
source§fn eq(&self, other: &ObjectIdentifier) -> bool
fn eq(&self, other: &ObjectIdentifier) -> bool
self
and other
values to be equal, and is used
by ==
.