Getting Started
Use our provided javascript function in your own HTML website to easily verify the digital signatures emitted by Legitimate's NFC tags
Last updated
Was this helpful?
Use our provided javascript function in your own HTML website to easily verify the digital signatures emitted by Legitimate's NFC tags
Last updated
Was this helpful?
For convenience, Legitimate provides a simple javascript implementation of the API verification mechanism required to validate the digital signatures emitted by NFC tags. You can see a full HTML example .
To get started, simply add our minified javascript function to the top of your HTML <head>
block. Make sure this is at the top of the <head>
block as it is required to load first.
This script calls the exact same API endpoint as described in Verify by passing through the verification parameters present in the URL query parameters. If the verification is successful, the contents of your HTML <body>
will be displayed as normal.
By default, the snippet will display an error message if the digital signature verification fails. You may add custom error messages by adding the following HTML elements to your page.
The inner contents of an HTML element with the following id legitimate-expired-cmac-message
will be used as the error state content if the verification fails due to the verification parameters being reused.
Our API is designed in such a way that each tag verification can only occur once with a given set of parameters. This is to prevent customers from sharing or replicating any URLs or links emitted by the NFC tag.
The inner contents of an HTML element with the following id legitimate-custom-error-message
will be used as the default error state content if the verification fails.
This script contains sensible defaults that will hide the entirety of your page's contents until after the digital signature verification is complete. You can see the un-minified implementation of this script .