#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum HttpSigError {
#[error("covered component `{0}` is not present in the message")]
MissingComponent(String),
#[error("unsupported component identifier `{0}`")]
UnsupportedComponent(String),
#[error("component `{0}` has a value containing CR or LF")]
InvalidComponentValue(String),
#[error("required component `{0}` is not covered by the signature")]
MissingRequiredComponent(String),
#[error("unexpected algorithm `{found}`, expected `ed25519`")]
UnsupportedAlg {
found: String,
},
#[error("signature `expires` precedes `created`")]
InvalidTimeWindow,
#[error("signature is older than the allowed maximum age")]
TooOld,
#[error("could not parse structured field: {0}")]
Parse(String),
#[error("signature label mismatch")]
LabelMismatch,
#[error("malformed signature")]
MalformedSignature,
#[error("signature verification failed")]
InvalidSignature,
#[error("signature has expired")]
Expired,
#[error("signature created in the future")]
CreatedInFuture,
#[error("the WIMSE profile requires the `{0}` signature parameter")]
MissingParameter(&'static str),
#[error("the WIMSE profile forbids the `{0}` signature parameter")]
ForbiddenParameter(&'static str),
#[error("unexpected signature tag `{found}`, expected `wimse-workload-to-workload`")]
WrongTag {
found: String,
},
#[error("audience mismatch")]
AudienceMismatch,
#[error("the response's `wimse-req-nonce` does not match the request's nonce")]
RequestNonceMismatch,
}