[][src]Struct asn1derpy::Der

pub struct Der<N>(_)
where
    N: ArrayLength<u8>
;

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]

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]

impl<N: ArrayLength<u8>> Default for Der<N>[src]

impl<N: ArrayLength<u8>> Deref for Der<N>[src]

type Target = Bytes<N>

The resulting type after dereferencing.

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.