logo

Struct der::Encoder

source · []
pub struct Encoder<'a> { /* private fields */ }
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

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.