pub struct DerEncoder { /* private fields */ }Expand description
DER encoder: builds a byte vector by appending TLV items.
Implementations§
Source§impl DerEncoder
impl DerEncoder
Sourcepub fn write_length(&mut self, len: usize)
pub fn write_length(&mut self, len: usize)
Append a raw DER length.
Sourcepub fn integer(&mut self, value: &[u8])
pub fn integer(&mut self, value: &[u8])
Append an INTEGER from big-endian unsigned bytes. Adds a leading 0x00 if the MSB is set (to keep it positive).
Sourcepub fn integer_u64(&mut self, v: u64)
pub fn integer_u64(&mut self, v: u64)
Append a small non-negative INTEGER from a u64 (for version fields).
Sourcepub fn octet_string(&mut self, data: &[u8])
pub fn octet_string(&mut self, data: &[u8])
Append an OCTET STRING.
Sourcepub fn bit_string(&mut self, data: &[u8])
pub fn bit_string(&mut self, data: &[u8])
Append a BIT STRING (with zero unused-bits prefix).
Sourcepub fn context_explicit(&mut self, tag_num: u8, content: &[u8])
pub fn context_explicit(&mut self, tag_num: u8, content: &[u8])
Append an explicit context-tagged [N] CONSTRUCTED wrapping.
Auto Trait Implementations§
impl Freeze for DerEncoder
impl RefUnwindSafe for DerEncoder
impl Send for DerEncoder
impl Sync for DerEncoder
impl Unpin for DerEncoder
impl UnsafeUnpin for DerEncoder
impl UnwindSafe for DerEncoder
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