pub struct Decoder<'a> { /* private fields */ }
Expand description
DER decoder.
Implementations
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.
Peek at the next byte in the decoder without modifying the cursor.
Peek at the next byte in the decoder and attempt to decode it as a
Tag
value.
Does not modify the decoder’s state.
Peek forward in the decoder, attempting to decode a Header
from
the data at the current position in the decoder.
Does not modify the decoder’s state.
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 OPTIONAL
ASN.1 ANY
value.
Attempt to decode an ASN.1 BIT STRING
.
pub fn context_specific<T>(
&mut self,
tag_number: TagNumber,
tag_mode: TagMode
) -> Result<Option<T>> where
T: DecodeValue<'a> + FixedTag,
pub fn context_specific<T>(
&mut self,
tag_number: TagNumber,
tag_mode: TagMode
) -> Result<Option<T>> where
T: DecodeValue<'a> + FixedTag,
Attempt to decode an ASN.1 CONTEXT-SPECIFIC
field with the
provided TagNumber
.
Attempt to decode an ASN.1 GeneralizedTime
.
Attempt to decode an ASN.1 IA5String
.
Attempt to decode an ASN.1 OCTET STRING
.
This is supported on crate feature oid
only.
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 UTF8String
.
Attempt to decode an ASN.1 SEQUENCE
, creating a new nested
Decoder
and calling the provided argument with it.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Decoder<'a>
impl<'a> UnwindSafe for Decoder<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more