pub enum Error {
InvalidArmor(String),
Base64Error(String),
UnexpectedEnd(usize),
InvalidPacketHeader(usize),
UnknownPacketTag(u8),
InvalidPacketFormat(usize, String),
ChecksumMismatch {
expected: u32,
actual: u32,
},
InvalidTimestamp(u32),
}Expand description
Errors that can occur during GPG packet parsing.
These errors cover armor decoding failures, binary parsing errors, and data validation issues.
Variants§
InvalidArmor(String)
The ASCII armor format is invalid (missing headers, malformed structure).
Base64Error(String)
Base64 decoding failed (invalid characters or padding).
UnexpectedEnd(usize)
Reached end of data unexpectedly while parsing.
The usize indicates the byte position where more data was expected.
InvalidPacketHeader(usize)
The packet header byte is invalid (bit 7 not set).
The usize indicates the byte position of the invalid header.
UnknownPacketTag(u8)
The packet tag value is not recognized.
InvalidPacketFormat(usize, String)
The packet body format is invalid.
Contains the byte position and a description of the error.
ChecksumMismatch
The CRC24 checksum in the armor doesn’t match the computed checksum.
Fields
InvalidTimestamp(u32)
A timestamp value could not be converted to a valid date/time.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()