This page demonstrates using the Content Authenticity Initiative JavaScript library to verify content against the IPTC Origin Verified News Publishers list. It is based on the CAI example code showing how to verify against a known certificate list.
Please give the page a moment to load, it is verifying multiple pieces of content in real time.
See below for info on how it works.
This app is a simple standalone web page. All code is embedded in the HTML source of this page.
It loads the Content Authenticity Initiative's open-source C2PA.js JavaScript library from a CDN.
It iterates over the IPTC C2PA sample content, validating against both the Content Authenticity Initiative temporary certificate list and the IPTC Origin Verified news Publisher list.
The code is vanilla JavaScript and doesn't require any external libraries apart from C2PA.js. The code is based on the CAI vanilla JavaScript example.
The tricky part is validating against the IPTC Verified News Publishers list. The C2PA.js library offers a configurable validation function, so we can take that and modify it to load the IPTC list as the "trust list".
In this way, we can show examples of content that is valid against both the CAI list and the IPTC list, valid against only one of the lists, or completely invalid content.
One quirk: The C2PA.js library seems to cache a bit too much so we need to set up two instances of the library: one for the IPTC Origin Verified News Publishers list. This makes the code a bit longer than it should be.
View source of this page to see the code.
View the developer console (right-click -> Inspect) to see more detailed output from the validator library, including the full manifest contents.