[][src]Trait asn1_der::typed::DerDecodable

pub trait DerDecodable<'a>: Sized {
    fn load(object: DerObject<'a>) -> Result<Self, Asn1DerError>;

    fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError> { ... }
fn decode_at(
        raw: &'a [u8],
        header_start: usize
    ) -> Result<Self, Asn1DerError> { ... }
fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
        source: &mut A,
        sink: B
    ) -> Result<Self, Asn1DerError> { ... } }

A trait for DER decodable types

Required methods

fn load(object: DerObject<'a>) -> Result<Self, Asn1DerError>

Loads object as Self

Loading content...

Provided methods

fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>

Decodes an object as Self

fn decode_at(raw: &'a [u8], header_start: usize) -> Result<Self, Asn1DerError>

Decodes an object as Self

fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
    source: &mut A,
    sink: B
) -> Result<Self, Asn1DerError>

Reads an object from source by parsing the length field and copying the necessary bytes into sink and decoding it from sink

Loading content...

Implementations on Foreign Types

impl<'a> DerDecodable<'a> for bool[src]

impl<'a> DerDecodable<'a> for u8[src]

impl<'a> DerDecodable<'a> for u16[src]

impl<'a> DerDecodable<'a> for u32[src]

impl<'a> DerDecodable<'a> for u64[src]

impl<'a> DerDecodable<'a> for u128[src]

impl<'a> DerDecodable<'a> for usize[src]

impl<'a> DerDecodable<'a> for i8[src]

impl<'a> DerDecodable<'a> for i16[src]

impl<'a> DerDecodable<'a> for i32[src]

impl<'a> DerDecodable<'a> for i64[src]

impl<'a> DerDecodable<'a> for i128[src]

impl<'a> DerDecodable<'a> for isize[src]

impl<'a> DerDecodable<'a> for ()[src]

impl<'a, T: DerDecodable<'a>> DerDecodable<'a> for Option<T>[src]

impl<'a> DerDecodable<'a> for Vec<u8>[src]

impl<'a> DerDecodable<'a> for String[src]

Loading content...

Implementors

impl<'a> DerDecodable<'a> for DerObject<'a>[src]

impl<'a> DerDecodable<'a> for Boolean<'a>[src]

impl<'a> DerDecodable<'a> for Integer<'a>[src]

impl<'a> DerDecodable<'a> for Null<'a>[src]

impl<'a> DerDecodable<'a> for OctetString<'a>[src]

impl<'a> DerDecodable<'a> for Sequence<'a>[src]

fn load(object: DerObject<'a>) -> Result<Self, Asn1DerError>[src]

Loads the Sequence and performs a shallow validation that each underlying object is a valid DER object

Note: This function does not look "into" the underlying elements nor does it perform any type-specific validation – only the tag-length constructions are validated.

impl<'a> DerDecodable<'a> for Utf8String<'a>[src]

impl<'a, T: DerDecodable<'a>> DerDecodable<'a> for SequenceVec<T>[src]

Loading content...