use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum JweError {
#[error("invalid compact JWE")]
InvalidCompact,
#[error("invalid compact JWE segment encoding")]
InvalidEncoding,
#[error("invalid JWE protected header")]
InvalidHeader,
#[error("unsupported JWE key-management algorithm")]
UnsupportedKeyManagementAlgorithm,
#[error("unsupported JWE content-encryption algorithm")]
UnsupportedContentEncryptionAlgorithm,
#[error("missing required JWE protected-header parameter")]
MissingRequiredHeaderParameter,
#[error("JWE protected-header policy mismatch")]
HeaderPolicyMismatch,
#[error("JWE kid policy mismatch")]
KidPolicyMismatch,
#[error("JWE typ policy mismatch")]
TypPolicyMismatch,
#[error("JWE cty policy mismatch")]
CtyPolicyMismatch,
#[error("JWE apu policy mismatch")]
ApuPolicyMismatch,
#[error("JWE apv policy mismatch")]
ApvPolicyMismatch,
#[error("invalid JWE encrypted-key segment")]
InvalidEncryptedKey,
#[error("invalid JWE content-encryption key")]
InvalidContentEncryptionKey,
#[error("invalid JWE content-cipher input")]
InvalidContentCipherInput,
#[error("JWE content decryption failed")]
Decrypt,
#[error("JWE content encryption failed")]
Encrypt,
#[error("invalid JWE key-agreement key")]
InvalidKeyAgreementKey,
#[error("invalid JWE shared secret")]
InvalidSharedSecret,
#[error("JWE key derivation failed")]
KeyDerivation,
#[error("JWE random generation failed")]
Randomness,
#[error("invalid JWE payload JSON")]
InvalidPayloadJson,
#[error("JWE input length overflow")]
LengthOverflow,
#[error("JWE input too large")]
InputTooLarge,
}