Struct asn1_der::DerObject [−][src]
A generic DER object
Fields
tag: DerTag
A DER tag that represents this object’s type
value: DerValue
The DER object’s payload
Implementations
impl DerObject
[src]
pub fn new(tag: DerTag, value: DerValue) -> Self
[src]
Creates a new DER object from tag
and value
(the length is computed from value
)
pub fn from_raw(tag: u8, bytes: impl Into<Vec<u8>>) -> Self
[src]
Creates a new DER object from tag
and value
(the length is computed from value
)
Parameters:
tag
: The DER tag value that represents the object’s typevalue
: The DER payload bytes that this object should carry
pub fn deserialize<'a>(
source: impl Iterator<Item = &'a u8>
) -> Result<Self, Asn1DerError>
[src]
source: impl Iterator<Item = &'a u8>
) -> Result<Self, Asn1DerError>
DER-deserializes the data from source
pub fn serialized_len(&self) -> usize
[src]
The length of the DER-serialized representation of self
pub fn serialize<'a>(
&self,
buf: impl Iterator<Item = &'a mut u8>
) -> Result<usize, Asn1DerError>
[src]
&self,
buf: impl Iterator<Item = &'a mut u8>
) -> Result<usize, Asn1DerError>
DER-serializes self
into buf
and returns the amount of bytes written
pub fn compute_serialized_len(payload_len: usize) -> usize
[src]
Efficiently computes the length of the DER-serialized representation of an object with
payload_len
payload bytes
Trait Implementations
impl Clone for DerObject
[src]
impl Debug for DerObject
[src]
impl Eq for DerObject
[src]
impl FromDerObject for DerObject
[src]
fn from_der_object(der_object: DerObject) -> Result<Self, Asn1DerError>
[src]
fn deserialize<'a>(
source: impl Iterator<Item = &'a u8>
) -> Result<Self, Asn1DerError>
[src]
source: impl Iterator<Item = &'a u8>
) -> Result<Self, Asn1DerError>
impl IntoDerObject for DerObject
[src]
fn into_der_object(self) -> DerObject
[src]
fn serialized_len(&self) -> usize
[src]
fn serialize<'a>(
self,
buf: impl Iterator<Item = &'a mut u8>
) -> Result<usize, Asn1DerError>
[src]
self,
buf: impl Iterator<Item = &'a mut u8>
) -> Result<usize, Asn1DerError>
impl PartialEq<DerObject> for DerObject
[src]
impl StructuralEq for DerObject
[src]
impl StructuralPartialEq for DerObject
[src]
Auto Trait Implementations
impl RefUnwindSafe for DerObject
impl Send for DerObject
impl Sync for DerObject
impl Unpin for DerObject
impl UnwindSafe for DerObject
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,