[−][src]Struct asn1_der::der::DerObject
A generic ASN.1-DER-object; can store any tag and payload
Fields
tag: u8
payload: Vec<u8>
Methods
impl DerObject
[src]
pub fn new(tag: u8, payload: Vec<u8>) -> Self
[src]
Creates a new ASN.1-DER-object
pub fn encoded_length(&self) -> usize
[src]
Computes the DER-encoded-length of this object without encoding it
Trait Implementations
impl FromDerObject for DerObject
[src]
fn from_der_object(der_object: DerObject) -> Result<Self>
[src]
impl IntoDerObject for DerObject
[src]
fn into_der_object(self) -> DerObject
[src]
impl FromDerEncoded for DerObject
[src]
fn from_der_encoded(data: Vec<u8>) -> Result<Self>
[src]
Create a Generic
-object from DER-encoded data
Parameters:
data
: The DER-encoded data to parse
Returns either the successfully parsed object or on error:
Asn1DerError::NotEnoughBytes
if the overall length is zero, the length-field is too short or the payload is shorter than the annotated lengthAsn1DerError::InvalidEncoding
if the length-field is invalidAsn1DerError::Unsupported
if the length is greater thanstd::usize::MAX
fn with_der_encoded(data: &[u8]) -> Result<Self>
[src]
Create a Generic
-object by decoding the DER-encoded data
Warning: The resulting object will contain a copy of the payload. However, the copying happens only if the object is valid and will be parsed and the copy includes only the payload (and not any other remaining data).
Parameters:
data
: The DER-encoded data to parse; the data may be longer than the object
Returns either the successfully parsed object or on error:
Asn1DerError::NotEnoughBytes
if the overall length is zero, the length-field is too short or the payload is shorter than the annotated lengthAsn1DerError::InvalidEncoding
if the length-field is invalidAsn1DerError::Unsupported
if the length is greater thanstd::usize::MAX
impl IntoDerEncoded for DerObject
[src]
fn into_der_encoded(self) -> Vec<u8>
[src]
DER-encodes this object
impl Default for DerObject
[src]
impl Clone for DerObject
[src]
fn clone(&self) -> DerObject
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<DerObject> for DerObject
[src]
impl Eq for DerObject
[src]
impl Debug for DerObject
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,