Trait simple_asn1::ToASN1

source ·
pub trait ToASN1 {
    type Error: From<ASN1EncodeErr>;

    // Required method
    fn to_asn1_class(&self, c: ASN1Class) -> Result<Vec<ASN1Block>, Self::Error>;

    // Provided method
    fn to_asn1(&self) -> Result<Vec<ASN1Block>, Self::Error> { ... }
}
Expand description

The set of types that can automatically converted into a sequence of ASN1Blocks. You should probably use to_asn1() but implement to_asn1_class(). The former has a default implementation that passes ASN1Class::Universal as the tag to use, which should be good for most people.

Required Associated Types§

Required Methods§

Provided Methods§

source

fn to_asn1(&self) -> Result<Vec<ASN1Block>, Self::Error>

Implementors§