Struct openssl::asn1::Asn1Object

source ·
pub struct Asn1Object(/* private fields */);
Expand description

Object Identifier

Represents an ASN.1 Object. Typically, NIDs, or numeric identifiers are stored as a table within the Nid module. These constants are used to determine attributes of a certificate, such as mapping the attribute “CommonName” to “CN” which is represented as the OID of 13. This attribute is a constant in the nid::COMMONNAME.

OpenSSL documentation at OBJ_nid2obj

Implementations§

source§

impl Asn1Object

source

pub fn from_str(txt: &str) -> Result<Asn1Object, ErrorStack>

Constructs an ASN.1 Object Identifier from a string representation of the OID.

This corresponds to OBJ_txt2obj.

source

pub fn as_slice(&self) -> &[u8]

Return the OID as an DER encoded array of bytes. This is the ASN.1 value, not including tag or length.

Requires OpenSSL 1.1.1 or newer.

This corresponds to OBJ_get0_data.

Methods from Deref<Target = Asn1ObjectRef>§

source

pub fn nid(&self) -> Nid

Returns the NID associated with this OID.

Trait Implementations§

source§

impl AsRef<Asn1ObjectRef> for Asn1Object

source§

fn as_ref(&self) -> &Asn1ObjectRef

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<Asn1ObjectRef> for Asn1Object

source§

fn borrow(&self) -> &Asn1ObjectRef

Immutably borrows from an owned value. Read more
source§

impl Clone for Asn1Object

source§

fn clone(&self) -> Asn1Object

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Deref for Asn1Object

§

type Target = Asn1ObjectRef

The resulting type after dereferencing.
source§

fn deref(&self) -> &Asn1ObjectRef

Dereferences the value.
source§

impl DerefMut for Asn1Object

source§

fn deref_mut(&mut self) -> &mut Asn1ObjectRef

Mutably dereferences the value.
source§

impl Drop for Asn1Object

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl ForeignType for Asn1Object

§

type CType = ASN1_OBJECT

The raw C type.
§

type Ref = Asn1ObjectRef

The type representing a reference to this type.
source§

unsafe fn from_ptr(ptr: *mut ASN1_OBJECT) -> Asn1Object

Constructs an instance of this type from its raw type.
source§

fn as_ptr(&self) -> *mut ASN1_OBJECT

Returns a raw pointer to the wrapped value.
source§

impl Stackable for Asn1Object

§

type StackType = stack_st_ASN1_OBJECT

The C stack type for this element. Read more
source§

impl Send for Asn1Object

source§

impl Sync for Asn1Object

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.