CML
    Preparing search index...

    Function validateC2paInitSegment

    • Validates a C2PA init segment: parses the manifest, extracts and verifies the certificate, validates the BMFF hard binding hash, verifies all session keys from the c2pa.session-keys assertion, and performs manifest integrity checks (assertion references and hashes, undeclared assertions, the hard binding count, duplicate manifest boxes, action ingredients, and claim signature verification).

      Only session keys with a valid signer binding and an unexpired validity period are included in the result. The result holds sessionKeys and merkleMaps only when every manifest integrity check passes, so check isValid before you use either list.

      The result includes LiveVideoStatusCode.SESSIONKEY_INVALID if the function finds an invalid session key (C2PA section 19.7.3). A session key is invalid if it does not conform to section 18.25.2, or if its signer binding fails verification. The function does not check every rule of section 18.25.2. An expired session key does not count as invalid. A c2pa.session-keys assertion without a session key, or with CBOR that does not decode, also causes SESSIONKEY_INVALID.

      Parameters

      Returns Promise<InitSegmentValidation>

      Structured validation result (with INIT_INVALID error code if mdat box is present)

      If no C2PA UUID box is found

      it('throws for empty bytes (no C2PA UUID box)', async () => {
      await rejects(
      () => validateC2paInitSegment(new Uint8Array(0)),
      /No C2PA UUID box/,
      )
      })