pub trait EncodeValue {
    fn value_len(&self) -> Result<Length, Error>;
    fn encode_value(&self, encoder: &mut dyn Writer) -> Result<(), Error>;

    fn header(&self) -> Result<Header, Error>
    where
        Self: Tagged
, { ... } }
Available on crate feature pkcs8 only.
Expand description

Encode the value part of a Tag-Length-Value encoded field, sans the [Tag] and Length.

Required Methods§

fn value_len(&self) -> Result<Length, Error>

Compute the length of this value (sans [Tag]+Length header) when encoded as ASN.1 DER.

fn encode_value(&self, encoder: &mut dyn Writer) -> Result<(), Error>

Encode value (sans [Tag]+Length header) as ASN.1 DER using the provided Writer.

Provided Methods§

fn header(&self) -> Result<Header, Error>where
    Self: Tagged,

Get the Header used to encode this value.

Implementations on Foreign Types§

§

impl EncodeValue for i8

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl<T, const N: usize> EncodeValue for [T; N]where
    T: Encode,

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for i64

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for bool

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for u128

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for u64

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for String

Available on crate feature alloc only.
§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for i32

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for i128

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for i16

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for u16

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl<T> EncodeValue for Vec<T, Global>where
    T: Encode,

Available on crate feature alloc only.
§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for u32

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for ()

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, _writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for str

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

§

impl EncodeValue for u8

§

fn value_len(&self) -> Result<Length, Error>

§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<(), Error>

Implementors§

§

impl EncodeValue for ObjectIdentifier

§

impl EncodeValue for Any

Available on crate feature alloc only.
§

impl EncodeValue for BitString

Available on crate feature alloc only.
§

impl EncodeValue for BitStringRef<'_>

§

impl EncodeValue for GeneralizedTime

§

impl EncodeValue for Ia5StringRef<'_>

§

impl EncodeValue for Null

§

impl EncodeValue for OctetString

Available on crate feature alloc only.
§

impl EncodeValue for OctetStringRef<'_>

§

impl EncodeValue for SequenceRef<'_>

§

impl EncodeValue for UtcTime

§

impl EncodeValue for Utf8StringRef<'_>

§

impl EncodeValue for AnyRef<'_>

§

impl EncodeValue for DateTime

§

impl<'a> EncodeValue for PrintableStringRef<'a>

§

impl<'a> EncodeValue for TeletexStringRef<'a>

§

impl<'a> EncodeValue for UIntRef<'a>

§

impl<'a> EncodeValue for VideotexStringRef<'a>

§

impl<'a, M> EncodeValue for Mwhere
    M: Sequence<'a>,

§

impl<'a, T> EncodeValue for ContextSpecificRef<'a, T>where
    T: EncodeValue + Tagged,

§

impl<'a, T> EncodeValue for SetOfVec<T>where
    T: 'a + Decode<'a> + Encode + DerOrd,

Available on crate feature alloc only.
§

impl<'a, T> EncodeValue for EncodeValueRef<'a, T>where
    T: EncodeValue,

§

impl<'a, T, const N: usize> EncodeValue for SetOf<T, N>where
    T: 'a + Decode<'a> + Encode + DerOrd,

§

impl<T> EncodeValue for ContextSpecific<T>where
    T: EncodeValue + Tagged,

§

impl<T, const N: usize> EncodeValue for SequenceOf<T, N>where
    T: Encode,