Struct asn1_rs::Oid

source · []
pub struct Oid<'a> { /* private fields */ }
Expand description

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.

Implementations

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

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

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

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

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.

Get the encoded oid without the header.

👎 Deprecated since 0.2.0:

Use as_bytes instead

Get the encoded oid without the header.

Get the bytes representation of the encoded oid

Convert the OID to a string representation.

If every arc fits into a u64 a string like “1.2.840.113549.1.1.5” is returned, otherwise a hex representation.

See also the “bigint” feature of this crate.

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

Returns true if needle is a prefix of the OID.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Get the length of the object, when encoded Read more

Attempt to write the DER header to this writer.

Attempt to write the DER content (all except header) to this writer.

Write the DER encoded representation to a newly allocated Vec<u8>.

Similar to using to_vec, but uses provided values without changes. This can generate an invalid encoding for a DER object. Read more

Attempt to write the DER encoded representation (header and content) into this writer. Read more

Similar to using to_der, but uses provided values without changes. This can generate an invalid encoding for a DER object. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.