Struct ot_certs::asn1::der::Der

source ·
pub struct Der { /* private fields */ }

Implementations§

source§

impl Der

source

pub fn generate(gen: impl FnOnce(&mut Self) -> Result<()>) -> Result<Vec<u8>>

Trait Implementations§

source§

impl Builder for Der

source§

fn push_byte(&mut self, val: u8) -> Result<()>

Push a byte into the ASN1 output.

source§

fn push_boolean(&mut self, tag: &Tag, val: &Value<bool>) -> Result<()>

Push a tagged boolean into the ASN1 output.

source§

fn push_integer( &mut self, _name_hint: Option<String>, tag: &Tag, val: &Value<BigUint> ) -> Result<()>

Push a tagged integer into the ASN1 output. The name hint can be used by the implementation for documentation purpose, or completely ignored.

source§

fn push_integer_pad( &mut self, _name_hint: Option<String>, val: &Value<BigUint>, size: usize ) -> Result<()>

Push a byte array into the ASN1 output, representing an integer. If the provided buffer is smaller than the provided size, it will be padded with zeroes. Note that this function does not add a tag to the ASN1 output.

source§

fn push_byte_array( &mut self, _name_hint: Option<String>, val: &Value<Vec<u8>> ) -> Result<()>

Push a byte array of fixed length into the ASN1 output. Note that this function does not add a tag to the ASN1 output.

source§

fn push_string( &mut self, _name_hint: Option<String>, str_type: &Tag, val: &Value<String> ) -> Result<()>

Push a tagged string into the ASN1 output.

source§

fn push_oid(&mut self, oid: &Oid) -> Result<()>

Push a tagged object identifier into the ASN1 output.

source§

fn push_tag( &mut self, _name_hint: Option<String>, tag: &Tag, gen: impl FnOnce(&mut Self) -> Result<()> ) -> Result<()>

Push tagged content into the ASN1 output. The closure can use any available function of the builder and produces the content of the tagged data.

source§

fn push_bitstring( &mut self, name_hint: Option<String>, tag: &Tag, bits: &[Value<bool>] ) -> Result<()>

source§

fn push_octet_string( &mut self, name_hint: Option<String>, gen: impl FnOnce(&mut Self) -> Result<()> ) -> Result<()>

Push a tagged octet string into the ASN1 output. The closure can use any available function of the builder and produces the content of the octet string.
source§

fn push_seq( &mut self, name_hint: Option<String>, gen: impl FnOnce(&mut Self) -> Result<()> ) -> Result<()>

Push a sequence into the ASN1 output. The closure can use any available function of the builder and produces the content of the sequence.
source§

fn push_set( &mut self, name_hint: Option<String>, gen: impl FnOnce(&mut Self) -> Result<()> ) -> Result<()>

Push a sequence into the ASN1 output. The closure can use any available function of the builder and produces the content of the set.
source§

fn push_as_bit_string( &mut self, name_hint: Option<String>, tag: &Tag, unused_bits: usize, gen: impl FnOnce(&mut Self) -> Result<()> ) -> Result<()>

Push tagged content into the ASN1 output as a bitstring. The closure can use any available function of the builder and the resulting content will be stored as a BITSTRING using the provided tag and unused number of bits.

Auto Trait Implementations§

§

impl RefUnwindSafe for Der

§

impl Send for Der

§

impl Sync for Der

§

impl Unpin for Der

§

impl UnwindSafe for Der

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V