Raw segment bytes
Manifest ID from the previous segment, or null for the first segment
Optionalstate: ManifestBoxValidationStateOptional state from the previous segment for streamId/sequenceNumber checks
Validation result, the manifest ID, and state to persist for the next call
it('returns isValid=false with errorCodes for empty bytes', async () => {
const { result, nextManifestId } = await validateC2paManifestBoxSegment(
new Uint8Array(0),
null,
)
strictEqual(result.isValid, false)
strictEqual(result.errorCodes.length > 0, true)
strictEqual(result.manifest, null)
strictEqual(nextManifestId, null)
})
Validates a C2PA manifest-box live stream segment.
Parses the C2PA manifest embedded in the segment and validates per §19.7.1 and §19.7.2. Recomputes the
c2pa.hash.bmff.v3content hash from the raw segment bytes and compares it against the expected hash in the manifest assertion. Checks live-video assertions (sequenceNumber, streamId, continuityMethod) and manifest-ID chain continuity.This function is pure — it does not access any external state. The caller is responsible for persisting
nextManifestIdandnextStatebetween calls.