isEnvelope
Whether element has the shape of a digest envelope: a JSON object whose key set is exactly {alg, canon, digest, mediaType} with canon == "JCS", or the legacy {alg, digest, mediaType}, with alg == "SHA-256" and a string digest that base64url-decodes to exactly 32 bytes (the SHA-256 digest length).
Shape-based recognition can in principle yield a false positive for a caller payload that deliberately mimics the envelope; such payloads should be anchored in digest mode (or wrapped) to avoid ambiguity. The exact-key-set and digest-length requirements keep that surface as small as possible.