Raw segment bytes
Manifest ID from the last segment that updated the state, or null for the first segment
Optionalstate: ManifestBoxValidationStateOptional state from the last segment that updated the state, for the streamId and sequenceNumber checks
Optionaloptions: ManifestBoxValidationOptionsOptional custom continuity method validator
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. The live-video and BMFF hash fields of the result come only from assertions whose hash matches a claim reference. CheckisValidbefore you use any field. A validator for an implementer-defined continuity method can be registered via ManifestBoxValidationOptions.This function is pure — it does not access any external state. The caller is responsible for persisting
nextManifestIdandnextStatebetween calls. A segment that fails verification, is on another stream, or does not move the sequence number forward returns the receivedlastManifestIdandstateunchanged. A segment that fails only the continuity check still updates them.