#[non_exhaustive]pub enum ErrorKind {
Show 24 variants
DateTime,
EncodingRules,
Failed,
FileNotFound,
Incomplete {
expected_len: Length,
actual_len: Length,
},
Io(ErrorKind),
IndefiniteLength,
Length {
tag: Tag,
},
Noncanonical {
tag: Tag,
},
OidMalformed,
SetDuplicate,
SetOrdering,
Overflow,
Overlength,
Pem(Error),
PermissionDenied,
Reader,
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.
§Example
use der::{asn1::OctetStringRef, Decode, ErrorKind};
let err = <&OctetStringRef>::from_der(&[0x04, 0x80, 0x00]).unwrap_err();
assert_eq!(err.kind(), ErrorKind::IndefiniteLength);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DateTime
Date-and-time related errors.
EncodingRules
Invalid encoding rules.
Failed
This error indicates a previous DER parsing operation resulted in
an error and tainted the state of a Reader or Writer.
Once this occurs, the overall operation has failed and cannot be subsequently resumed.
FileNotFound
File not found error.
Incomplete
Message is incomplete and does not contain all of the expected data.
Fields
Io(ErrorKind)
I/O errors.
IndefiniteLength
Indefinite length disallowed (or malformed when decoding BER)
Length
Incorrect length for a given field.
Noncanonical
Message is not canonically encoded.
OidMalformed
OID is improperly encoded.
SetDuplicate
SET cannot contain duplicates.
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.
Pem(Error)
PEM encoding errors.
PermissionDenied
Permission denied reading file.
Reader
Reader does not support the requested operation.
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
Unexpected tag.
Fields
TagUnknown
Unknown/unsupported tag.
TrailingData
Undecoded trailing data at end of message.
Fields
Utf8(Utf8Error)
UTF-8 errors.
Value
Unexpected value.