Struct der::Encoder[][src]

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

DER encoder.

Implementations

Create a new encoder with the given byte slice as a backing buffer.

Encode a value which impls the Encodable 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 encoding to the buffer, returning a slice containing the data written to the buffer.

Encode the provided value as an ASN.1 BIT STRING.

Encode a CONTEXT-SPECIFIC field with EXPLICIT tagging.

Encode the provided value as an ASN.1 GeneralizedTime

Encode the provided value as an ASN.1 IA5String.

Encode an ASN.1 NULL value.

Encode the provided value as an ASN.1 OCTET STRING

This is supported on crate feature oid only.

Encode an ASN.1 ObjectIdentifier

Encode the provided value as an ASN.1 PrintableString

Encode an ASN.1 SEQUENCE of the given length.

Spawns a nested Encoder which is expected to be exactly the specified length upon completion.

Encode the provided value as an ASN.1 UTCTime

Encode the provided value as an ASN.1 Utf8String

Trait Implementations

Formats the value using the given formatter. Read more

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.