[−][src]Struct derp::Der
Helper for writing DER that automattically encoes tags and content lengths.
Methods
impl<'a, W: Write> Der<'a, W>
[src]
pub fn new(writer: &'a mut W) -> Self
[src]
Create a new Der
structure that writes values to the given writer.
pub fn null(&mut self) -> Result<()>
[src]
Write a NULL
tag.
pub fn element(&mut self, tag: Tag, input: &[u8]) -> Result<()>
[src]
Write an arbitrary element.
pub fn integer(&mut self, input: &[u8]) -> Result<()>
[src]
Write the given input as an integer.
pub fn positive_integer(&mut self, input: &[u8]) -> Result<()>
[src]
Write the given input as a positive integer.
pub fn nested<F: FnOnce(&mut Der<Vec<u8>>) -> Result<()>>(
&mut self,
tag: Tag,
func: F
) -> Result<()>
[src]
&mut self,
tag: Tag,
func: F
) -> Result<()>
Write a nested structure by passing in a handling function that writes to an intermediate
Vec
before writing the whole sequence to self
.
pub fn sequence<F: FnOnce(&mut Der<Vec<u8>>) -> Result<()>>(
&mut self,
func: F
) -> Result<()>
[src]
&mut self,
func: F
) -> Result<()>
Write a SEQUENCE
by passing in a handling function that writes to an intermediate Vec
before writing the whole sequence to self
.
pub fn oid(&mut self, input: &[u8]) -> Result<()>
[src]
Write an OBJECT IDENTIFIER
.
pub fn raw(&mut self, input: &[u8]) -> Result<()>
[src]
Write raw bytes to self
. This does not calculate length or apply. This should only be used
when you know you are dealing with bytes that are already DER encoded.
pub fn bit_string(&mut self, unused_bits: u8, bit_string: &[u8]) -> Result<()>
[src]
Write a BIT STRING
.
pub fn octet_string(&mut self, octet_string: &[u8]) -> Result<()>
[src]
Write an OCTET STRING
.
Auto Trait Implementations
impl<'a, W> RefUnwindSafe for Der<'a, W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<'a, W> Send for Der<'a, W> where
W: Send,
W: Send,
impl<'a, W> Sync for Der<'a, W> where
W: Sync,
W: Sync,
impl<'a, W> Unpin for Der<'a, W>
impl<'a, W> !UnwindSafe for Der<'a, W>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for 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>,