[][src]Struct der_parser::oid::Oid

pub struct Oid<'a> {
    pub relative: bool,
    // some fields omitted
}

Object ID (OID) representation which can be relative or non-relative. An example for an oid in string representation is "1.2.840.113549.1.1.5".

For non-relative oids restrictions apply to the first two components.

This library contains a procedural macro oid which can be used to create oids. For example oid!(1.2.44.233) or oid!(rel 44.233) for relative oids. See the module documentation for more information.

Fields

relative: bool

Implementations

impl<'a> Oid<'a>[src]

pub const fn new(asn1: Cow<'a, [u8]>) -> Oid[src]

Create an OID from the ASN.1 DER encoded form. See the module documentation for other ways to create oids.

pub const fn new_relative(asn1: Cow<'a, [u8]>) -> Oid[src]

Create a relative OID from the ASN.1 DER encoded form. See the module documentation for other ways to create relative oids.

pub fn from<'b>(s: &'b [u64]) -> Result<Oid<'static>, ParseError>[src]

Build an OID from an array of object identifier components. This method allocates memory on the heap.

pub fn from_relative<'b>(s: &'b [u64]) -> Result<Oid<'static>, ParseError>[src]

Build a relative OID from an array of object identifier components.

pub fn to_owned(&self) -> Oid<'static>[src]

Create a deep copy of the oid.

This method allocates data on the heap. The returned oid can be used without keeping the ASN.1 representation around.

Cloning the returned oid does again allocate data.

pub fn bytes(&self) -> &[u8][src]

Get the encoded oid without the header.

pub fn to_id_string(&self) -> String[src]

Convert the OID to a string representation. The string contains the IDs separated by dots, for ex: "1.2.840.113549.1.1.5"

pub fn iter_bigint<'b>(
    &'b self
) -> impl Iterator<Item = BigUint> + FusedIterator + ExactSizeIterator + 'b
[src]

Return an iterator over the sub-identifiers (arcs).

pub fn iter<'b>(
    &'b self
) -> Option<impl Iterator<Item = u64> + FusedIterator + ExactSizeIterator + 'b>
[src]

Return an iterator over the sub-identifiers (arcs). Returns None if at least one arc does not fit into u64.

Trait Implementations

impl<'a> Clone for Oid<'a>[src]

impl<'a> Debug for Oid<'a>[src]

impl<'a> Display for Oid<'a>[src]

impl<'a> Eq for Oid<'a>[src]

impl<'a> From<Oid<'a>> for BerObject<'a>[src]

Build a DER object from an OID.

impl<'a> FromStr for Oid<'a>[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl<'a> Hash for Oid<'a>[src]

impl<'a> PartialEq<Oid<'a>> for Oid<'a>[src]

impl<'a> StructuralEq for Oid<'a>[src]

impl<'a> StructuralPartialEq for Oid<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Oid<'a>

impl<'a> Send for Oid<'a>

impl<'a> Sync for Oid<'a>

impl<'a> Unpin for Oid<'a>

impl<'a> UnwindSafe for Oid<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.