Struct ethers::core::k256::elliptic_curve::pkcs8::der::asn1::ObjectIdentifier [−][src]
pub struct ObjectIdentifier { /* fields omitted */ }
Expand description
Object identifier (OID).
OIDs are hierarchical structures consisting of “arcs”, i.e. integer identifiers.
Validity
In order for an OID to be considered valid by this library, it must meet the following criteria:
- The OID MUST have at least 3 arcs
- The first arc MUST be within the range 0-2
- The second arc MUST be within the range 0-39
- The BER/DER encoding of the OID MUST be shorter than
[
ObjectIdentifier::max_len
]
Implementations
Maximum length of a BER/DER-encoded OID in bytes.
Parse an ObjectIdentifier
from the dot-delimited string form, e.g.:
use const_oid::ObjectIdentifier;
pub const MY_OID: ObjectIdentifier = ObjectIdentifier::new("1.2.840.113549.1.1.1");
Panics
This method panics in the event the OID is malformed according to the “Validity” rules given in the toplevel documentation for this type.
For that reason this method is ONLY recommended for use in constants (where it will generate a compiler error instead).
To parse an OID from a &str
slice fallibly and without panicking,
use the FromStr
impl instead (or via str
’s parse
method).
Parse an OID from a slice of Arc
values (i.e. integers).
Parse an OID from from its BER/DER encoding.
Get the BER/DER serialization of this OID as bytes.
Note that this encoding omits the tag/length, and only contains the value portion of the encoded OID.
Return the arc with the given index, if it exists.
Iterate over the arcs (a.k.a. nodes) of an ObjectIdentifier
.
Returns Arcs
, an iterator over Arc
values representing the value
of each arc/node.
Trait Implementations
Compute the length of this value in bytes when encoded as ASN.1 DER.
Encode this value as ASN.1 DER using the provided Encoder
.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for ObjectIdentifier
impl Send for ObjectIdentifier
impl Sync for ObjectIdentifier
impl Unpin for ObjectIdentifier
impl UnwindSafe for ObjectIdentifier
Blanket Implementations
pub fn as_slice_of<T>(&self) -> Result<&[T], Error> where
T: FromByteSlice,
pub fn base32_len(&self) -> usize
pub fn base32_len(&self) -> usize
Calculate the base32 serialized length
Mutably borrows from an owned value. Read more
Is the provided Tag
decodable as a variant of this CHOICE
?
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more