pub struct DerDecoder<'a> { /* private fields */ }Expand description
DER decoder: reads TLV items from a byte slice.
Implementations§
Source§impl<'a> DerDecoder<'a>
impl<'a> DerDecoder<'a>
Sourcepub fn read_tlv(&mut self) -> Option<(u8, &'a [u8])>
pub fn read_tlv(&mut self) -> Option<(u8, &'a [u8])>
Read tag + length, return (tag, content_slice).
Sourcepub fn read_sequence(&mut self) -> Option<DerDecoder<'a>>
pub fn read_sequence(&mut self) -> Option<DerDecoder<'a>>
Read a SEQUENCE, return a sub-decoder over its content.
Sourcepub fn read_integer(&mut self) -> Option<&'a [u8]>
pub fn read_integer(&mut self) -> Option<&'a [u8]>
Read an INTEGER, return the big-endian unsigned bytes (leading zero stripped).
Sourcepub fn read_integer_u64(&mut self) -> Option<u64>
pub fn read_integer_u64(&mut self) -> Option<u64>
Read an INTEGER as u64 (small values like version fields).
Sourcepub fn read_octet_string(&mut self) -> Option<&'a [u8]>
pub fn read_octet_string(&mut self) -> Option<&'a [u8]>
Read an OCTET STRING.
Sourcepub fn read_bit_string(&mut self) -> Option<&'a [u8]>
pub fn read_bit_string(&mut self) -> Option<&'a [u8]>
Read a BIT STRING, return the data bytes (skip unused-bits byte).
Sourcepub fn read_context_explicit(&mut self, tag_num: u8) -> Option<DerDecoder<'a>>
pub fn read_context_explicit(&mut self, tag_num: u8) -> Option<DerDecoder<'a>>
Read an explicit context-tagged [N] CONSTRUCTED, return a sub-decoder over its content. Returns None if the tag number doesn’t match or the tag is absent.
Auto Trait Implementations§
impl<'a> Freeze for DerDecoder<'a>
impl<'a> RefUnwindSafe for DerDecoder<'a>
impl<'a> Send for DerDecoder<'a>
impl<'a> Sync for DerDecoder<'a>
impl<'a> Unpin for DerDecoder<'a>
impl<'a> UnsafeUnpin for DerDecoder<'a>
impl<'a> UnwindSafe for DerDecoder<'a>
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