pub enum ImplementationError {
ImpossibleSfvError(Error),
ParsingError(String),
LookupError(CoveredComponent),
UnsupportedAlgorithm(Algorithm),
NoSuchKey,
InvalidKeyLength,
InvalidSignatureLength,
FailedToVerify(SignatureError),
NonAsciiContentFound,
SignatureParamsSerialization,
TimeError(SystemTimeError),
WebBotAuth(WebBotAuthError),
}
Expand description
Errors that may be thrown by this module.
Variants§
ImpossibleSfvError(Error)
Errors that arise from invalid conversions from parsed structs back into structured field values, nominally “impossible” because the structs are already in a valid state.
ParsingError(String)
Errors that arise from conversions of structured field values into parsed structs, with an explanation of what wrong.
LookupError(CoveredComponent)
Errors raised when trying to get the value of a covered
component fails from a SignedMessage
or UnsignedMessage
,
likely because the message did not contain the value.
UnsupportedAlgorithm(Algorithm)
Errors raised when an incoming message references an algorithm
that isn’t currently supported by this implementation. The subset
of registered IANA signature algorithms
implemented here is provided by Algorithms
struct.
NoSuchKey
An attempt to resolve key identifier to a valid public key failed. This prevents message verification.
InvalidKeyLength
The resolved key ID did not have the sufficient length to be parsed as a valid key for the algorithm chosen.
InvalidSignatureLength
The signature provided in Signature
header was not long enough to be
a valid signature for the algorithm chosen.
FailedToVerify(SignatureError)
Verification of a parsed signature against a resolved key failed, indicating the signature was invalid.
NonAsciiContentFound
A valid signature base must contain only ASCII characters; this error is thrown if that’s not the case. This may be thrown if some of the headers included in covered components contained non-ASCII characters, for example. This will be thrown during both signing and verification, as both steps require constructing the signature base.
SignatureParamsSerialization
Signature bases are terminated with a line beginning with @signature-params
. This error
is thrown if the value of that line could not be converted into a structured field value.
This is considered “impossible” as invalid values should not be present in the structure
containing those values.
TimeError(SystemTimeError)
Verification of created
or expires
component parameter requires use of a system clock.
This error is thrown if the system clock is configured in ways that prevent adequate time
resolution, such as the clock believes the start of Unix time is in the future.
WebBotAuth(WebBotAuthError)
A wrapper around WebBotAuthError