[][src]Trait red_asn1::Asn1Object

pub trait Asn1Object: Sized + Default {
    pub fn tag() -> Tag;
pub fn build_value(&self) -> Vec<u8>;
pub fn parse_value(&mut self, raw: &[u8]) -> Result<()>; pub fn build(&self) -> Vec<u8> { ... }
pub fn parse(raw: &[u8]) -> Result<(&[u8], Self)> { ... } }

A trait to allow objects to be built/parsed from ASN1-DER

Required methods

pub fn tag() -> Tag[src]

Method to retrieve the tag of the object, used to identify each object in ASN1

pub fn build_value(&self) -> Vec<u8>[src]

Method which indicates how object value must be built

pub fn parse_value(&mut self, raw: &[u8]) -> Result<()>[src]

Method which indicates how object value must be parsed

Loading content...

Provided methods

pub fn build(&self) -> Vec<u8>[src]

To encode the object to DER, generally does not need to be overwritten. Usually, just encode_value should be overwritten

pub fn parse(raw: &[u8]) -> Result<(&[u8], Self)>[src]

To parse the object from DER, generally does not need to be overwritten. Usually, just parse_value should be overwritten

Loading content...

Implementations on Foreign Types

impl Asn1Object for bool[src]

impl Asn1Object for String[src]

impl Asn1Object for AsciiString[src]

impl<T: Asn1Object> Asn1Object for Vec<T>[src]

impl<T: Asn1Object> Asn1Object for Option<T>[src]

Loading content...

Implementors

impl Asn1Object for BitString[src]

impl Asn1Object for GeneralizedTime[src]

impl Asn1Object for Oid[src]

impl Asn1Object for OctetString[src]

impl<T: Asn1Int> Asn1Object for Enumerated<T>[src]

impl<T: Asn1Int> Asn1Object for T[src]

Loading content...