[−][src]Struct asn1derpy::Der
DER writer
Methods
impl<N: ArrayLength<u8>> Der<N>
[src]
pub fn new() -> Self
[src]
Create a new Der
structure that writes values to the given buffer
pub fn into_inner(self) -> Bytes<N>
[src]
Return underlying buffer
pub fn raw_tlv(&mut self, tag: Tag, value: &[u8]) -> Result<(), ()>
[src]
Write an arbitrary tag-length-value
pub fn non_negative_integer(&mut self, integer: &[u8]) -> Result<(), ()>
[src]
Write the given input as integer.
Assumes input
is the big-endian representation of a non-negative Integer
Not sure about good references, maybe: https://docs.microsoft.com/en-us/windows/win32/seccertenroll/about-integer
From: https://docs.rs/ecdsa/0.3.0/src/ecdsa/convert.rs.html#205-219 Compute ASN.1 DER encoded length for the provided scalar. The ASN.1 encoding is signed, so its leading bit must have value 0; it must also be of minimal length (so leading bytes of value 0 must be removed, except if that would contradict the rule about the sign bit).
pub fn sequence<F>(&mut self, f: F) -> Result<(), ()> where
F: FnOnce(&mut Der<N>) -> Result<(), ()>,
[src]
F: FnOnce(&mut Der<N>) -> Result<(), ()>,
Write a SEQUENCE
by passing in a handling function that writes to an intermediate Vec
before writing the whole sequence to self
.
Methods from Deref<Target = Bytes<N>>
pub fn insert_slice_at(&mut self, slice: &[u8], at: usize) -> Result<(), ()>
[src]
pub fn resize_default(&mut self, new_len: usize) -> Result<(), ()>
[src]
pub fn resize_to_capacity(&mut self)
[src]
Trait Implementations
impl<N: Debug> Debug for Der<N> where
N: ArrayLength<u8>,
[src]
N: ArrayLength<u8>,
impl<N: ArrayLength<u8>> Default for Der<N>
[src]
impl<N: ArrayLength<u8>> Deref for Der<N>
[src]
impl<N: ArrayLength<u8>> DerefMut for Der<N>
[src]
Auto Trait Implementations
impl<N> Send for Der<N>
impl<N> Sync for Der<N>
impl<N> Unpin for Der<N> where
<N as ArrayLength<u8>>::ArrayType: Unpin,
<N as ArrayLength<u8>>::ArrayType: Unpin,
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> Same<T> for T
type Output = T
Should always be Self
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>,