#[non_exhaustive]
pub enum ErrorKind {
Show 17 variants
DateTime,
Failed,
Incomplete {
expected_len: Length,
actual_len: Length,
},
Length {
tag: Tag,
},
Noncanonical {
tag: Tag,
},
OidMalformed,
OidUnknown {
oid: ObjectIdentifier,
},
SetOrdering,
Overflow,
Overlength,
TagModeUnknown,
TagNumberInvalid,
TagUnexpected {
expected: Option<Tag>,
actual: Tag,
},
TagUnknown {
byte: u8,
},
TrailingData {
decoded: Length,
remaining: Length,
},
Utf8(Utf8Error),
Value {
tag: Tag,
},
}
Expand description
Error type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DateTime
Date-and-time related errors.
Failed
This error indicates a previous DER parsing operation resulted in
an error and tainted the state of a Decoder
or Encoder
.
Once this occurs, the overall operation has failed and cannot be subsequently resumed.
Incomplete
Fields
Message is incomplete and does not contain all of the expected data.
Length
Incorrect length for a given field.
Noncanonical
Message is not canonically encoded.
OidMalformed
OID is improperly encoded.
OidUnknown
Fields
oid: ObjectIdentifier
OID value that was unrecognized by a parser for a DER-based format.
Unknown OID.
This error is intended to be used by libraries which parse DER-based formats which encounter unknown or unsupported OID libraries.
It enables passing back the OID value to the caller, which allows them to determine which OID(s) are causing the error (and then potentially contribute upstream support for algorithms they care about).
SetOrdering
SET
ordering error: items not in canonical order.
Overflow
Integer overflow occurred (library bug!).
Overlength
Message is longer than this library’s internal limits support.
TagModeUnknown
Unknown tag mode.
TagNumberInvalid
Invalid tag number.
The “tag number” is the lower 5-bits of a tag’s octet.
This error occurs in the case that all 5-bits are set to 1
,
which indicates a multi-byte tag which is unsupported by this library.
TagUnexpected
Fields
Unexpected tag.
TagUnknown
Unknown/unsupported tag.
TrailingData
Fields
Undecoded trailing data at end of message.
Utf8(Utf8Error)
UTF-8 errors.
Value
Unexpected value.