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
impl Asn1Object
sourcepub fn from_str(txt: &str) -> Result<Asn1Object, ErrorStack>
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
.
sourcepub fn as_slice(&self) -> &[u8] ⓘ
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>§
Trait Implementations§
source§impl AsRef<Asn1ObjectRef> for Asn1Object
impl AsRef<Asn1ObjectRef> for Asn1Object
source§fn as_ref(&self) -> &Asn1ObjectRef
fn as_ref(&self) -> &Asn1ObjectRef
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Borrow<Asn1ObjectRef> for Asn1Object
impl Borrow<Asn1ObjectRef> for Asn1Object
source§fn borrow(&self) -> &Asn1ObjectRef
fn borrow(&self) -> &Asn1ObjectRef
Immutably borrows from an owned value. Read more
source§impl Clone for Asn1Object
impl Clone for Asn1Object
source§fn clone(&self) -> Asn1Object
fn clone(&self) -> Asn1Object
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Deref for Asn1Object
impl Deref for Asn1Object
source§type Target = Asn1ObjectRef
type Target = Asn1ObjectRef
The resulting type after dereferencing.
source§fn deref(&self) -> &Asn1ObjectRef
fn deref(&self) -> &Asn1ObjectRef
Dereferences the value.
source§impl DerefMut for Asn1Object
impl DerefMut for Asn1Object
source§fn deref_mut(&mut self) -> &mut Asn1ObjectRef
fn deref_mut(&mut self) -> &mut Asn1ObjectRef
Mutably dereferences the value.
source§impl Drop for Asn1Object
impl Drop for Asn1Object
source§impl ForeignType for Asn1Object
impl ForeignType for Asn1Object
source§type CType = ASN1_OBJECT
type CType = ASN1_OBJECT
The raw C type.
source§type Ref = Asn1ObjectRef
type Ref = Asn1ObjectRef
The type representing a reference to this type.
source§unsafe fn from_ptr(ptr: *mut ASN1_OBJECT) -> Asn1Object
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
fn as_ptr(&self) -> *mut ASN1_OBJECT
Returns a raw pointer to the wrapped value.
source§impl Stackable for Asn1Object
impl Stackable for Asn1Object
source§type StackType = stack_st_ASN1_OBJECT
type StackType = stack_st_ASN1_OBJECT
The C stack type for this element. Read more
impl Send for Asn1Object
impl Sync for Asn1Object
Auto Trait Implementations§
impl Freeze for Asn1Object
impl RefUnwindSafe for Asn1Object
impl Unpin for Asn1Object
impl UnwindSafe for Asn1Object
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)