matches
Whether envelope attests to payload, hashing the payload the way the envelope says it was hashed: JCS(payload) for envelopes with canon = "JCS", the legacy kotlinx serialization bytes for envelopes without it.
Like matches with an option for verifiers that accept only RFC 8785 anchors.
Parameters
when true, a legacy envelope (no canon member) never matches. Legacy digests cover the kotlinx serialization bytes, which depend on key order and number spelling, so a strict verifier may prefer to reject them outright. Default behaviour (matches without this flag) keeps accepting legacy envelopes so old anchors keep verifying.
Whether envelope is a digest envelope whose digest matches payloadBytes. Uses a constant-time comparison; malformed envelopes or undecodable digests yield false.