Struct der::Decoder[][src]

pub struct Decoder<'a> { /* fields omitted */ }
Expand description

DER decoder.

Implementations

Create a new decoder for the given byte slice.

Decode a value which impls the Decodable trait.

Return an error with the given ErrorKind, annotating it with context about where the error occurred.

Return an error for an invalid value with the given tag.

Did the decoding operation fail due to an error?

Finish decoding, returning the given value if there is no remaining data, or an error otherwise

Have we decoded all of the bytes in this Decoder?

Returns false if we’re not finished decoding or if a fatal error has occurred.

Attempt to decode an ASN.1 ANY value.

Attempt to decode an OPTIONAL ASN.1 ANY value.

Attempt to decode ASN.1 INTEGER as i8

Attempt to decode ASN.1 INTEGER as i16

Attempt to decode unsigned ASN.1 INTEGER as u8

Attempt to decode unsigned ASN.1 INTEGER as u16

This is supported on crate feature bigint only.

Attempt to decode an ASN.1 INTEGER as a UIntBytes.

Attempt to decode an ASN.1 BIT STRING.

Attempt to decode an ASN.1 CONTEXT-SPECIFIC field with the provided TagNumber.

This method has the following behavior which is designed to simplify handling of extension fields, which are denoted in an ASN.1 schema using the ... ellipsis extension marker:

  • Skips over ContextSpecific fields with a tag number lower than the current one, consuming and ignoring them.
  • Returns Ok(None) if a ContextSpecific field with a higher tag number is encountered. These fields are not consumed in this case, allowing a field with a lower tag number to be omitted, then the higher numbered field consumed as a follow-up.
  • Returns Ok(None) if anything other than a ContextSpecific field is encountered.

Attempt to decode an ASN.1 GeneralizedTime.

Attempt to decode an ASN.1 IA5String.

Attempt to decode an ASN.1 NULL value.

Attempt to decode an ASN.1 OCTET STRING.

This is supported on crate feature oid only.

Attempt to decode an ASN.1 OBJECT IDENTIFIER.

Attempt to decode an ASN.1 OPTIONAL value.

Attempt to decode an ASN.1 PrintableString.

Attempt to decode an ASN.1 UTCTime.

Attempt to decode an ASN.1 UTF8String.

Attempt to decode an ASN.1 SEQUENCE, creating a new nested Decoder and calling the provided argument with it.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.