fn ensure_algorithm_matches<C: CoseEncryptCipher>(
header: &Header,
) -> Result<(), CryptoError>Expand description
Validates that, if the protected header declares a content-encryption algorithm, it matches
C’s.
A missing algorithm is tolerated to support legacy envelopes that were sealed without declaring
it; in that case the dispatcher has already selected the cipher via its fallback. A
present-but-wrong algorithm is rejected with CryptoError::WrongKeyType.