pub struct DerObject<'a> { /* private fields */ }
Expand description
An untyped DER object
Implementations§
source§impl<'a> DerObject<'a>
impl<'a> DerObject<'a>
sourcepub fn new<S: Sink + Into<&'a [u8]>>(
tag: u8,
value: &[u8],
sink: S
) -> Result<Self, Asn1DerError>
pub fn new<S: Sink + Into<&'a [u8]>>(
tag: u8,
value: &[u8],
sink: S
) -> Result<Self, Asn1DerError>
Writes a new DER object with tag
and value
into sink
and returns a view over it
sourcepub fn new_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
tag: u8,
len: usize,
value: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
pub fn new_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
tag: u8,
len: usize,
value: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
Writes a new DER object with tag
, len
and value
into sink
and returns a view over it
sourcepub fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>
pub fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>
Decodes an object from raw
sourcepub fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
source: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
pub fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
source: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
Reads a DER-TLV structure from source
by parsing the length field and copying the
necessary bytes into sink
and returns a view over it