<!doctype html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<link rel="stylesheet" href="css/style.v2.css">
|
|
<link rel="stylesheet" href="css/topnav.css">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="shortcut icon" href="https://www.pathcheck.org/hubfs/Favicon.png">
|
|
<title>ICAO's Visible Digital Seal</title>
|
|
|
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DTDMHW3NV6"></script>
|
|
<script>
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
gtag('config', 'G-DTDMHW3NV6');
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="topnav">
|
|
<div class="topnavContainer">
|
|
<a class="active" href="index.html">Signers</a>
|
|
<a href="verify.html"><span class="xs-hidden">Universal </span>Verifier</a>
|
|
<a class="xs-hidden" href="debug.html">QR Debugger</a>
|
|
<a class="xs-hidden" href="https://github.com/Path-Check/paper-cred-demo">Source Code</a>
|
|
<a href="https://github.com/Path-Check/paper-cred"><span class="xs-hidden"> QR </span>Specs</a>
|
|
<a href="http://vaccine-docs.pathcheck.org"><span class="xs-hidden">Vaccine </span>Docs</a>
|
|
<a class="xs-hidden" href="http://pathcheck.org">About PathCheck</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="subnav">
|
|
<div class="subnavContainer">
|
|
<a href="index.v5.html">PCF<span class="xs-hidden">'s 4 QRs</span></a>
|
|
<a href="eu.dgc.html">EU<span class="xs-hidden"> Covid Pass</span></a>
|
|
<a class="active" href="icao.html">ICAO<span class="xs-hidden"> Seals</span></a>
|
|
<a href="cowin.html">DIVOC<span class="xs-hidden">/India</span></a>
|
|
<a class="xs-hidden" href="opencerta.html"><span class="xs-hidden">Open</span>Certa</a>
|
|
<a href="vial.html">Vial<span class="xs-hidden"> Label</span></a>
|
|
<a href="us.ma.id.html"><span class="xs-hidden">Mass </span>ID</a>
|
|
<a href="banknote.html">Cash<span class="xs-hidden"> Bills</span></a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="center">
|
|
<h1>ICAO's<span class="xs-hidden"> Visible</span> Digital Seal</h1>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4>Proof of Vaccination</h4>
|
|
<table>
|
|
<tr><td>Name</td><td><input id="qr-vax-pid-n" type="text" placeholder=""/></td></tr>
|
|
<tr><td>DoB</td><td><input id="qr-vax-pid-dob-date" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Sex</td><td><input id="qr-vax-pid-sex" type="text" placeholder=""/></td></tr>
|
|
<tr><td>ID</td><td><input id="qr-vax-pid-i" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Other ID</td><td><input id="qr-vax-pid-ai" type="text" placeholder=""/></td></tr>
|
|
|
|
<tr><td>UVCI</td><td><input id="qr-vax-uvci" type="text" placeholder=""/></td></tr>
|
|
</table>
|
|
<h4>Vaccine Info</h4>
|
|
<table>
|
|
<tr><td>Prophylaxis</td><td><input id="qr-vax-ve-des" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Brand</td><td><input id="qr-vax-ve-nam" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Disease</td><td><input id="qr-vax-ve-dis" type="text" placeholder=""/></td></tr>
|
|
|
|
<tr><td>Date</td><td><input id="qr-vax-ve-vd-dvc-date" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Dose #</td><td><input id="qr-vax-ve-vd-seq" type="text" placeholder=""/></td></tr>
|
|
|
|
<tr><td>Country</td><td><input id="qr-vax-ve-vd-ctr" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Centre</td><td><input id="qr-vax-ve-vd-adm" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Lot #</td><td><input id="qr-vax-ve-vd-lot" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Next</td><td><input id="qr-vax-ve-vd-dvn-date" type="text" placeholder=""/></td></tr>
|
|
</table>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4>Proof of Testing</h4>
|
|
<table>
|
|
<tr><td>Name</td><td><input id="qr-test-pid-n" type="text" placeholder=""/></td></tr>
|
|
<tr><td>DoB</td><td><input id="qr-test-pid-dob-date" type="text" placeholder=""/></td></tr>
|
|
<tr><td>DocType</td><td><input id="qr-test-pid-dt" type="text" placeholder=""/></td></tr>
|
|
<tr><td>DocNumber</td><td><input id="qr-test-pid-dn" type="text" placeholder=""/></td></tr>
|
|
|
|
<tr><td>UTCI</td><td><input id="qr-test-utci" type="text" placeholder=""/></td></tr>
|
|
</table>
|
|
<h4>Service Center</h4>
|
|
<table>
|
|
<tr><td>Name</td><td><input id="qr-test-sp-spn" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Country</td><td><input id="qr-test-sp-ctr" type="text" placeholder=""/></td></tr>
|
|
|
|
<tr><td>Phone</td><td><input id="qr-test-sp-cd-p" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Email</td><td><input id="qr-test-sp-cd-e" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Address</td><td><input id="qr-test-sp-cd-a" type="text" placeholder=""/></td></tr>
|
|
|
|
<tr><td>Date Colect</td><td><input id="qr-test-dat-sc-timestamp" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Date Result</td><td><input id="qr-test-dat-ri-timestamp" type="text" placeholder=""/></td></tr>
|
|
|
|
<tr><td>Test Type</td><td><input id="qr-test-tr-tc" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Result</td><td><input id="qr-test-tr-r" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Collec Method</td><td><input id="qr-test-tr-m" type="text" placeholder=""/></td></tr>
|
|
<tr><td>Optional</td><td><input id="qr-test-opt" type="text" placeholder=""/></td></tr>
|
|
|
|
</table>
|
|
</div>
|
|
|
|
<div class="quarter">
|
|
<h4>CRED Credentials</h4>
|
|
<label for="privkey">Private Key</label><br/>
|
|
<textarea id="privkey" rows="10" style="width: 100%;">-----BEGIN EC PARAMETERS-----
|
|
BgUrgQQACg==
|
|
-----END EC PARAMETERS-----
|
|
-----BEGIN EC PRIVATE KEY-----
|
|
MHQCAQEEIPWKbSezZMY1gCpvN42yaVv76Lo47FvSsVZpQl0a5lWRoAcGBSuBBAAK
|
|
oUQDQgAE6DeIun4EgMBLUmbtjQw7DilMJ82YIvOR2jz/IK0R/F7/zXY1z+gqvFXf
|
|
DcJqR5clbAYlO9lHmvb4lsPLZHjugQ==
|
|
-----END EC PRIVATE KEY-----</textarea>
|
|
<br><br>
|
|
<label for="pubkey">Public Key</label><br/>
|
|
<textarea id="qr-link" rows="1" cols="30">1A9.PCF.PW</textarea>
|
|
|
|
<h4>EU HC1 Credentials</h4>
|
|
<label for="privkey">P8 Private Key</label><br/>
|
|
<textarea id="privkeyEU" rows="10" style="width: 100%;">-----BEGIN PRIVATE KEY-----
|
|
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgZgp3uylFeCIIXozb
|
|
ZkCkSNr4DcLDxplZ1ax/u7ndXqahRANCAARkJeqyO85dyR+UrQ5Ey8EdgLyf9Nts
|
|
CrwORAj6T68/elL19aoISQDbzaNYJjdD77XdHtd+nFGTQVpB88wPTwgb
|
|
-----END PRIVATE KEY-----</textarea>
|
|
<br>
|
|
<label for="pubkeyId">Public kID</label><br/>
|
|
<textarea id="qr-linkEU" rows="1" cols="30">Rjene8QvRwA=</textarea>
|
|
<br>
|
|
<label for="pubkey">PublicKey Certificate</label><br/>
|
|
<textarea id="pubkeyEU" rows="10" style="width: 100%;">-----BEGIN CERTIFICATE-----
|
|
MIIBYDCCAQYCEQCAG8uscdLb0ppaneNN5sB7MAoGCCqGSM49BAMCMDIxIzAhBgNV
|
|
BAMMGk5hdGlvbmFsIENTQ0Egb2YgRnJpZXNsYW5kMQswCQYDVQQGEwJGUjAeFw0y
|
|
MTA0MjcyMDQ3MDVaFw0yNjAzMTIyMDQ3MDVaMDYxJzAlBgNVBAMMHkRTQyBudW1i
|
|
ZXIgd29ya2VyIG9mIEZyaWVzbGFuZDELMAkGA1UEBhMCRlIwWTATBgcqhkjOPQIB
|
|
BggqhkjOPQMBBwNCAARkJeqyO85dyR+UrQ5Ey8EdgLyf9NtsCrwORAj6T68/elL1
|
|
9aoISQDbzaNYJjdD77XdHtd+nFGTQVpB88wPTwgbMAoGCCqGSM49BAMCA0gAMEUC
|
|
IQDvDacGFQO3tuATpoqf40CBv09nfglL3wh5wBwA1uA7lAIgZ4sOK2iaaTsFNqEN
|
|
AF7zi+d862ePRQ9Lwymr7XfwVm0=
|
|
-----END CERTIFICATE-----</textarea>
|
|
</div>
|
|
</div>
|
|
<br>
|
|
<div class="four-quarter">
|
|
<button class="qr-btn" onclick="generateQRCodes()">Create Certificates</button>
|
|
</div>
|
|
<div class="four-quarter">
|
|
<h2>PathCheck CRED-style URI</h2>
|
|
</div>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4 id="qr-vax-code-label" style="display: none;">Immunization QR</h4>
|
|
<canvas id="qr-vax-code"></canvas><br/>
|
|
<h4 id="qr-vax-pdf-label" style="display: none;">PDF 417 Format</h4>
|
|
<canvas id="qr-vax-pdf"></canvas><br/>
|
|
<pre id="qr-vax-result"></pre>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4 id="qr-test-code-label" style="display: none;">Test QR</h4>
|
|
<canvas id="qr-test-code"></canvas><br/>
|
|
<h4 id="qr-test-pdf-label" style="display: none;">PDF 417 Format</h4>
|
|
<canvas id="qr-test-pdf"></canvas><br/>
|
|
<pre id="qr-test-result"></pre>
|
|
</div>
|
|
|
|
<div class="quarter xs-hidden">
|
|
<label for="verify">Verify a QR Code</label>
|
|
<textarea id="qr-verify" rows="10" cols="33" placeholder="cred:type:version:signature:pubkey:payload"></textarea>
|
|
<br><br>
|
|
<button class="qr-btn" onclick="verifyQRCode()">Verify</button>
|
|
<br><br>
|
|
<pre id="qr-verify-result"></pre>
|
|
<pre id="qr-verify-verified"></pre>
|
|
</div>
|
|
</div>
|
|
<div class="four-quarter">
|
|
<h2>Original ICAO Model</h2>
|
|
</div>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4 id="qr-vax-icao-code-label" style="display: none;">Immunization QR</h4>
|
|
<canvas id="qr-vax-icao-code"></canvas><br/>
|
|
<h4 id="qr-vax-icao-pdf-label" style="display: none;">PDF 417 Format</h4>
|
|
<canvas id="qr-vax-icao-pdf"></canvas><br/>
|
|
<pre id="qr-vax-icao-result"></pre>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4 id="qr-test-icao-code-label" style="display: none;">Test QR</h4>
|
|
<canvas id="qr-test-icao-code"></canvas><br/>
|
|
<h4 id="qr-test-icao-pdf-label" style="display: none;">PDF 417 Format</h4>
|
|
<canvas id="qr-test-icao-pdf"></canvas><br/>
|
|
<pre id="qr-test-icao-result"></pre>
|
|
</div>
|
|
|
|
<div class="quarter">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="four-quarter">
|
|
<h2>Using HC1 EU Model</h2>
|
|
</div>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4 id="qr-vax-hc1-code-label" style="display: none;">Immunization QR</h4>
|
|
<canvas id="qr-vax-hc1-code"></canvas><br/>
|
|
<h4 id="qr-vax-hc1-pdf-label" style="display: none;">PDF 417 Format</h4>
|
|
<canvas id="qr-vax-hc1-pdf"></canvas><br/>
|
|
<pre id="qr-vax-hc1-result"></pre>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4 id="qr-test-hc1-code-label" style="display: none;">Test QR</h4>
|
|
<canvas id="qr-test-hc1-code"></canvas><br/>
|
|
<h4 id="qr-test-hc1-pdf-label" style="display: none;">PDF 417 Format</h4>
|
|
<canvas id="qr-test-hc1-pdf"></canvas><br/>
|
|
<pre id="qr-test-hc1-result"></pre>
|
|
</div>
|
|
|
|
<div class="quarter">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="four-quarter">
|
|
<h2>Comparison Tables</h2>
|
|
<h4>URI Size (in A/N bytes and in chars) and Time (in milliseconds)</h4>
|
|
</div>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Immunization QR</h4>
|
|
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">URI Bytes</th>
|
|
<th style="text-align: right;">URI Chars</th>
|
|
<th style="text-align: right;">Sign Time</th>
|
|
<th style="text-align: right;">Verify Time</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;">CRED</td>
|
|
<td style="text-align: right;" id="qr-vax-time-uri"></td>
|
|
<td style="text-align: right;" id="qr-vax-time-json"></td>
|
|
<td style="text-align: right;" id="qr-vax-time-sign"></td>
|
|
<td style="text-align: right;" id="qr-vax-time-verify"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;">ICAO</td>
|
|
<td style="text-align: right;" id="qr-vax-icao-time-uri"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-time-json"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-time-sign"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-time-verify"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;">HC1</td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-time-uri"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-time-json"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-time-sign"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-time-verify"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Test QR</h4>
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">URI Bytes</th>
|
|
<th style="text-align: right;">URI Chars</th>
|
|
<th style="text-align: right;">Sign Time</th>
|
|
<th style="text-align: right;">Verify Time</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" >CRED</td>
|
|
<td style="text-align: right;" id="qr-test-time-uri"></td>
|
|
<td style="text-align: right;" id="qr-test-time-json"></td>
|
|
<td style="text-align: right;" id="qr-test-time-sign"></td>
|
|
<td style="text-align: right;" id="qr-test-time-verify"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;">ICAO</td>
|
|
<td style="text-align: right;" id="qr-test-icao-time-uri"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-time-json"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-time-sign"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-time-verify"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;">HC1</td>
|
|
<td style="text-align: right;" id="qr-test-hc1-time-uri"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-time-json"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-time-sign"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-time-verify"></td>
|
|
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="four-quarter">
|
|
<h4>QR Size in Bytes (bits * bits / 8)</h4>
|
|
</div>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Immunization QR</h4>
|
|
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">ECC 7%</th>
|
|
<th style="text-align: right;">ECC 15%</th>
|
|
<th style="text-align: right;">ECC 25%</th>
|
|
<th style="text-align: right;">ECC 30%</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-comp-uri">CRED</td>
|
|
<td style="text-align: right;" id="qr-vax-comp-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-comp-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-comp-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-comp-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-icao-comp-uri">ICAO</td>
|
|
<td style="text-align: right;" id="qr-vax-icao-comp-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-comp-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-comp-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-comp-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-hc1-comp-uri">HC1</td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-comp-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-comp-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-comp-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-comp-ecch"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Test QR</h4>
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">ECC 7%</th>
|
|
<th style="text-align: right;">ECC 15%</th>
|
|
<th style="text-align: right;">ECC 25%</th>
|
|
<th style="text-align: right;">ECC 30%</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-comp-uri">CRED</td>
|
|
<td style="text-align: right;" id="qr-test-comp-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-comp-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-comp-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-comp-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-icao-comp-uri">ICAO</td>
|
|
<td style="text-align: right;" id="qr-test-icao-comp-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-comp-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-comp-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-comp-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-hc1-comp-uri">HC1</td>
|
|
<td style="text-align: right;" id="qr-test-hc1-comp-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-comp-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-comp-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-comp-ecch"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="four-quarter">
|
|
<h4>QR Size (bits x bits)</h4>
|
|
</div>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Immunization QR</h4>
|
|
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">ECC 7%</th>
|
|
<th style="text-align: right;">ECC 15%</th>
|
|
<th style="text-align: right;">ECC 25%</th>
|
|
<th style="text-align: right;">ECC 30%</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-bits-uri">CRED</td>
|
|
<td style="text-align: right;" id="qr-vax-bits-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-bits-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-bits-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-bits-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-icao-bits-uri">ICAO</td>
|
|
<td style="text-align: right;" id="qr-vax-icao-bits-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-bits-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-bits-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-bits-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-hc1-bits-uri">HC1</td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-bits-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-bits-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-bits-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-bits-ecch"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Test QR</h4>
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">ECC 7%</th>
|
|
<th style="text-align: right;">ECC 15%</th>
|
|
<th style="text-align: right;">ECC 25%</th>
|
|
<th style="text-align: right;">ECC 30%</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-bits-uri">CRED</td>
|
|
<td style="text-align: right;" id="qr-test-bits-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-bits-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-bits-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-bits-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-icao-bits-uri">ICAO</td>
|
|
<td style="text-align: right;" id="qr-test-icao-bits-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-bits-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-bits-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-bits-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-hc1-bits-uri">HC1</td>
|
|
<td style="text-align: right;" id="qr-test-hc1-bits-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-bits-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-bits-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-bits-ecch"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="four-quarter">
|
|
<h4>Minimum Printed Size (in millimiters at 150 DPI)</h4>
|
|
</div>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Immunization QR</h4>
|
|
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">ECC 7%</th>
|
|
<th style="text-align: right;">ECC 15%</th>
|
|
<th style="text-align: right;">ECC 25%</th>
|
|
<th style="text-align: right;">ECC 30%</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-size-uri">CRED</td>
|
|
<td style="text-align: right;" id="qr-vax-size-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-size-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-size-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-size-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-icao-size-uri">ICAO</td>
|
|
<td style="text-align: right;" id="qr-vax-icao-size-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-size-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-size-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-size-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size-uri">HC1</td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size-ecch"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Test QR</h4>
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">ECC 7%</th>
|
|
<th style="text-align: right;">ECC 15%</th>
|
|
<th style="text-align: right;">ECC 25%</th>
|
|
<th style="text-align: right;">ECC 30%</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-size-uri">CRED</td>
|
|
<td style="text-align: right;" id="qr-test-size-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-size-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-size-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-size-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-icao-size-uri">ICAO</td>
|
|
<td style="text-align: right;" id="qr-test-icao-size-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-size-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-size-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-size-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-hc1-size-uri">HC1</td>
|
|
<td style="text-align: right;" id="qr-test-hc1-size-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-size-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-size-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-size-ecch"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="four-quarter">
|
|
<h4>Minimum Printed Size (in millimiters at 300 DPI)</h4>
|
|
</div>
|
|
<div class="full-div">
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Immunization QR</h4>
|
|
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">ECC 7%</th>
|
|
<th style="text-align: right;">ECC 15%</th>
|
|
<th style="text-align: right;">ECC 25%</th>
|
|
<th style="text-align: right;">ECC 30%</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-size300-uri">CRED</td>
|
|
<td style="text-align: right;" id="qr-vax-size300-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-size300-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-size300-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-size300-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-icao-size300-uri">ICAO</td>
|
|
<td style="text-align: right;" id="qr-vax-icao-size300-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-size300-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-size300-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-icao-size300-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size300-uri">HC1</td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size300-eccl"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size300-eccm"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size300-eccq"></td>
|
|
<td style="text-align: right;" id="qr-vax-hc1-size300-ecch"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
<div class="two-quarter">
|
|
<h4 style="text-align: center;">Test QR</h4>
|
|
<table class="comparison">
|
|
<tr>
|
|
<th style="text-align: right;">Tech</th>
|
|
<th style="text-align: right;">ECC 7%</th>
|
|
<th style="text-align: right;">ECC 15%</th>
|
|
<th style="text-align: right;">ECC 25%</th>
|
|
<th style="text-align: right;">ECC 30%</th>
|
|
</th>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-size300-uri">CRED</td>
|
|
<td style="text-align: right;" id="qr-test-size300-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-size300-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-size300-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-size300-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-icao-size300-uri">ICAO</td>
|
|
<td style="text-align: right;" id="qr-test-icao-size300-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-size300-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-size300-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-icao-size300-ecch"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right;" id="qr-test-hc1-size300-uri">HC1</td>
|
|
<td style="text-align: right;" id="qr-test-hc1-size300-eccl"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-size300-eccm"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-size300-eccq"></td>
|
|
<td style="text-align: right;" id="qr-test-hc1-size300-ecch"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div style="position:fixed;top:calc(50% - 250px);right:0;transition:width 300ms ease-out;width:0;" data-qa="side_panel"> <a class="typeform-share button" href="https://form.typeform.com/to/cGJGC6zl?typeform-medium=embed-snippet" data-mode="side_panel" style="box-sizing:border-box;position:absolute;top:300px;width:200px;height:48px;padding:0 20px;margin:0;cursor:pointer;background:#0F69BE;border-radius:4px 4px 0px 0px;box-shadow:0px 2px 12px rgba(0, 0, 0, 0.06), 0px 2px 4px rgba(0, 0, 0, 0.08);display:flex;align-items:center;justify-content:flex-start;transform:rotate(-90deg);transform-origin:bottom left;color:white;text-decoration:none;z-index:9999;" data-width="320" data-height="500" target="_blank"> <span class="icon" style="width:32px;position:relative;text-align:center;transform:rotate(90deg) scale(0.85);left:-8px;"> <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' style="margin-top:10px;"> <path d='M21 0H0V9L10.5743 24V16.5H21C22.6567 16.5 24 15.1567 24 13.5V3C24 1.34325 22.6567 0 21 0ZM7.5 9.75C6.672 9.75 6 9.07875 6 8.25C6 7.42125 6.672 6.75 7.5 6.75C8.328 6.75 9 7.42125 9 8.25C9 9.07875 8.328 9.75 7.5 9.75ZM12.75 9.75C11.922 9.75 11.25 9.07875 11.25 8.25C11.25 7.42125 11.922 6.75 12.75 6.75C13.578 6.75 14.25 7.42125 14.25 8.25C14.25 9.07875 13.578 9.75 12.75 9.75ZM18 9.75C17.172 9.75 16.5 9.07875 16.5 8.25C16.5 7.42125 17.172 6.75 18 6.75C18.828 6.75 19.5 7.42125 19.5 8.25C19.5 9.07875 18.828 9.75 18 9.75Z' fill='white' /> </svg> </span> <span style="text-decoration:none;font-size:18px;font-family:Helvetica,Arial,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;"> Suggestions? </span> </a> </div> <script> (function() { var qs,js,q,s,d=document, gi=d.getElementById, ce=d.createElement, gt=d.getElementsByTagName, id="typef_orm_share", b="https://embed.typeform.com/"; if(!gi.call(d,id)){ js=ce.call(d,"script"); js.id=id; js.src=b+"embed.js"; q=gt.call(d,"script")[0]; q.parentNode.insertBefore(js,q) } })() </script>
|
|
|
|
|
|
<div class="footer">
|
|
<div class="footerContainer">
|
|
<img src="https://www.pathcheck.org/hubfs/pathcheck-foundation-logo-white.svg" alt="pathcheck-foundation-logo-white" width="264" style="width: 264px; max-width: 264px; margin: 0px 0px 5px;">
|
|
<span style="font-size: 14px;">
|
|
<br>©2021. PathCheck Foundation – a 501(c)(3) nonprofit.
|
|
<br>Content is distributed under the Creative Commons CC-BY License unless otherwise stated. PathCheck is a trademark of PathCheck Foundation.
|
|
</span>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script src="js/qrcode.min.js"></script>
|
|
|
|
<script src="js/libbcmath.js" type="text/javascript"></script>
|
|
<script src="js/bcmath.js" type="text/javascript"></script>
|
|
<script src="js/pdf417.js" type="text/javascript"></script>
|
|
|
|
<script src="js/cred-sdk.min.js"></script>
|
|
|
|
<script src="js/he.js"></script>
|
|
<script src="js/ajv7.min.js"></script>
|
|
<script src="js/json-beautify.min.js"></script>
|
|
|
|
<script src="js/pcf-utils.js"></script>
|
|
<script src="js/ui-utils.js"></script>
|
|
|
|
<script src="js/dcc-sdk.min.js"></script>
|
|
<script src="js/vds-sdk.min.js"></script>
|
|
|
|
|
|
<script>
|
|
function e(elem) {
|
|
if (!document.getElementById(elem)) console.log("Not existant", elem);
|
|
return document.getElementById(elem);
|
|
}
|
|
|
|
function replacer(key, value) {
|
|
if(value instanceof Map) {
|
|
return {
|
|
dataType: 'Map',
|
|
value: Array.from(value.entries()), // or with spread: value: [...value]
|
|
};
|
|
} else {
|
|
return value;
|
|
}
|
|
}
|
|
function reviver(key, value) {
|
|
if(typeof value === 'object' && value !== null) {
|
|
if (value.Map) {
|
|
return new Map(value.Map);
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function getValueArray(elemArray) {
|
|
const fields = elemArray.map(function(elemId) {
|
|
if (elemId.endsWith('-date')) {
|
|
// Sends dates always in seconds since epoch
|
|
return dateInYYYYMMDD(e(elemId).value).toString();
|
|
}
|
|
if (elemId.endsWith('-timestamp')) {
|
|
// Sends dates always in seconds since epoch
|
|
return dateInSecondsToEpoch(e(elemId).value).toString();
|
|
}
|
|
return e(elemId).value;
|
|
})
|
|
return fields;
|
|
}
|
|
|
|
function dateInYYYYMMDD(str) {
|
|
let d = new Date(str)
|
|
return "" + d.getFullYear() +
|
|
("0"+(d.getMonth()+1)).slice(-2) +
|
|
("0" + d.getDate()).slice(-2);
|
|
}
|
|
|
|
function dateInSecondsToEpoch(str) {
|
|
return new Date(str).getTime()/1000;
|
|
}
|
|
|
|
function clearQR(elemPrefix) {
|
|
e(elemPrefix+'-code').getContext('2d').clearRect(0, 0, e(elemPrefix+'-code').width, e(elemPrefix+'-code').height);
|
|
e(elemPrefix+'-result').innerHTML = "";
|
|
}
|
|
|
|
async function clear() {
|
|
clearQR('qr-vax');
|
|
clearQR('qr-test');
|
|
}
|
|
|
|
function signAndDisplayQR(elemPref, _type, _version, priKeyPEM, pubKeyId, payloadValueArray) {
|
|
const t0 = performance.now();
|
|
const uri = CRED.signAndPack(_type, _version, priKeyPEM, pubKeyId, payloadValueArray).then(uri => {
|
|
const t1 = performance.now();
|
|
PCFUtils.debugURI(uri).then( debugInfo => {
|
|
const params = { margin:0, width:e(elemPref+'-code').scrollWidth, errorCorrectionLevel: 'Q', color: {dark: '#3654DD' }};
|
|
|
|
// Builds QR Element
|
|
QRCode.toCanvas(e(elemPref+'-code'), uri, params, function (error) {})
|
|
PDF417.draw(uri, e(elemPref+"-pdf"));
|
|
|
|
e(elemPref+"-code-label").style.display = '';
|
|
e(elemPref+"-pdf-label").style.display = '';
|
|
|
|
// Updates screen elements.
|
|
e(elemPref+"-result").innerHTML= debugInfo;
|
|
|
|
e(elemPref+"-time-sign").innerHTML = Math.round(t1-t0);
|
|
e(elemPref+"-time-uri").innerHTML = Math.round(uri.length * 5.5/8);
|
|
e(elemPref+"-time-json").innerHTML = Math.round(uri.length);
|
|
|
|
studyQR(uri, elemPref);
|
|
|
|
const v0 = performance.now();
|
|
CRED.unpackAndVerify(uri).then(result => {
|
|
const v1 = performance.now();
|
|
e(elemPref+"-time-verify").innerHTML=Math.round(v1-v0);
|
|
UIUtils.drawVerifiedSymbol(elemPref+'-code',result);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
function signAndDisplayEUQR(elemPref, json, priKeyPEM, pubKeyPem) {
|
|
const eut0 = performance.now();
|
|
DCC.makeCWT(json).then(cwt => {
|
|
DCC.signAndPack(cwt, pubKeyPem, priKeyPEM).then(uri => {
|
|
const eut1 = performance.now();
|
|
displayEUQR(uri, elemPref, eut1-eut0, pubKeyPem)
|
|
});
|
|
});
|
|
}
|
|
|
|
function displayEUQR(uri, elemPref, deltaTime, pubKeyPem) {
|
|
const params = { margin:0, width:e(elemPref+'-code').scrollWidth, errorCorrectionLevel: 'Q', color: {dark: '#3654DD' }};
|
|
|
|
// Builds QR Element
|
|
QRCode.toCanvas(e(elemPref+'-code'), uri, params, function (error) {})
|
|
PDF417.draw(uri, e(elemPref+"-pdf"));
|
|
|
|
e(elemPref+"-code-label").style.display = '';
|
|
e(elemPref+"-pdf-label").style.display = '';
|
|
|
|
// Updates screen elements.
|
|
e(elemPref+"-result").innerHTML=
|
|
"<span class='schema'>" + uri.substring(0,3) + "</span></a>:" +
|
|
"<span class='message'>" + uri.substring(4) + "</span><br>";
|
|
|
|
e(elemPref+"-result").innerHTML +=
|
|
"<pre>HC1:<span class='message'>Payload</span></pre>"
|
|
|
|
studyQR(uri, elemPref);
|
|
|
|
e(elemPref+"-time-sign").innerHTML=Math.round(deltaTime);
|
|
e(elemPref+"-time-uri").innerHTML = Math.round(uri.length * 5.5/8);
|
|
e(elemPref+"-time-json").innerHTML = Math.round(uri.length);
|
|
|
|
const v0 = performance.now();
|
|
DCC.unpackAndVerify(uri, pubKeyPem).then(verified => {
|
|
const v1 = performance.now();
|
|
e(elemPref+"-time-verify").innerHTML=Math.round(v1-v0);
|
|
UIUtils.drawVerifiedSymbol(elemPref+'-code',verified);
|
|
});
|
|
}
|
|
|
|
function signAndDisplayQRICAO(elemPref, payload, prikey, certificate) {
|
|
const icaot0 = performance.now();
|
|
const uri = VDS.signAndPack(payload, certificate, prikey).then(uri => {
|
|
const icaot1 = performance.now();
|
|
const params = { margin:0, width:e(elemPref+'-code').scrollWidth, errorCorrectionLevel: 'Q', color: {dark: '#3654DD' }};
|
|
|
|
// Builds QR Element
|
|
QRCode.toCanvas(e(elemPref+'-code'), uri, params, function (error) {})
|
|
PDF417.draw(uri, e(elemPref+"-pdf"));
|
|
|
|
e(elemPref+"-code-label").style.display = '';
|
|
e(elemPref+"-pdf-label").style.display = '';
|
|
|
|
// Updates screen elements.
|
|
e(elemPref+"-result").innerHTML= "<span class='message'>" + uri + "</span><br>";
|
|
|
|
e(elemPref+"-result").innerHTML +=
|
|
"<pre><span class='message'>iJSON</span></pre>"
|
|
|
|
e(elemPref+"-time-sign").innerHTML = Math.round(icaot1-icaot0);
|
|
e(elemPref+"-time-uri").innerHTML = Math.round(uri.length * 5.5/8);
|
|
e(elemPref+"-time-json").innerHTML = Math.round(uri.length);
|
|
|
|
studyQR(uri, elemPref);
|
|
|
|
const v0 = performance.now();
|
|
VDS.unpackAndVerify(uri).then(result => {
|
|
const v1 = performance.now();
|
|
e(elemPref+"-time-verify").innerHTML=Math.round(v1-v0);
|
|
UIUtils.drawVerifiedSymbol(elemPref+'-code',result);
|
|
});
|
|
});
|
|
}
|
|
|
|
function studyQR(uri, elemPref) {
|
|
let qrQ = QRCode.create(uri, { margin:0, width:275, errorCorrectionLevel: 'Q', color: {dark: '#3654DD' }});
|
|
let qrH = QRCode.create(uri, { margin:0, width:275, errorCorrectionLevel: 'H', color: {dark: '#3654DD' }});
|
|
let qrM = QRCode.create(uri, { margin:0, width:275, errorCorrectionLevel: 'M', color: {dark: '#3654DD' }});
|
|
let qrL = QRCode.create(uri, { margin:0, width:275, errorCorrectionLevel: 'L', color: {dark: '#3654DD' }});
|
|
|
|
if (e(elemPref+"-comp-eccl")) {
|
|
e(elemPref+"-comp-eccl").innerHTML = qrSizeBytes(qrL);
|
|
e(elemPref+"-comp-eccm").innerHTML = qrSizeBytes(qrM);
|
|
e(elemPref+"-comp-eccq").innerHTML = qrSizeBytes(qrQ);
|
|
e(elemPref+"-comp-ecch").innerHTML = qrSizeBytes(qrH);
|
|
}
|
|
|
|
if (e(elemPref+"-bits-eccl")) {
|
|
e(elemPref+"-bits-eccl").innerHTML = qrSizeBits(qrL);
|
|
e(elemPref+"-bits-eccm").innerHTML = qrSizeBits(qrM);
|
|
e(elemPref+"-bits-eccq").innerHTML = qrSizeBits(qrQ);
|
|
e(elemPref+"-bits-ecch").innerHTML = qrSizeBits(qrH);
|
|
}
|
|
|
|
if (e(elemPref+"-size-eccl")) {
|
|
e(elemPref+"-size-eccl").innerHTML = qrSizeMillimiters(qrL, 150);
|
|
e(elemPref+"-size-eccm").innerHTML = qrSizeMillimiters(qrM, 150);
|
|
e(elemPref+"-size-eccq").innerHTML = qrSizeMillimiters(qrQ, 150);
|
|
e(elemPref+"-size-ecch").innerHTML = qrSizeMillimiters(qrH, 150);
|
|
}
|
|
|
|
if (e(elemPref+"-size300-eccl")) {
|
|
e(elemPref+"-size300-eccl").innerHTML = qrSizeMillimiters(qrL, 300);
|
|
e(elemPref+"-size300-eccm").innerHTML = qrSizeMillimiters(qrM, 300);
|
|
e(elemPref+"-size300-eccq").innerHTML = qrSizeMillimiters(qrQ, 300);
|
|
e(elemPref+"-size300-ecch").innerHTML = qrSizeMillimiters(qrH, 300);
|
|
}
|
|
}
|
|
|
|
function describe(qr) {
|
|
return qr.modules.size + "x" + qr.modules.size + " " + qrSizeBytes(qr) + " bytes ";
|
|
}
|
|
|
|
function qrSizeBytes(qr) {
|
|
return Math.round((qr.modules.size*qr.modules.size)/8)
|
|
}
|
|
|
|
function qrSizeBits(qr) {
|
|
return qr.modules.size + "x" + qr.modules.size;
|
|
}
|
|
|
|
function qrSizeMillimiters(qr, dpi) {
|
|
// 150 DPI Printer
|
|
// 3x3 printer dots per QR bit.
|
|
const side = Math.round(qr.modules.size * (25.4/(dpi/3)));
|
|
return side + "x" + side;
|
|
}
|
|
|
|
function generateQRCodes() {
|
|
gtag('event', 'generateQR');
|
|
|
|
clear();
|
|
|
|
// Where to Download the public key
|
|
const pubKeyLink = e("qr-link").value.trim().replace("http://","");
|
|
|
|
// PEM code of the private key
|
|
const priKeyPEM = e('privkey').value;
|
|
|
|
const vaccineArray = getValueArray(["qr-vax-uvci","qr-vax-pid-n","qr-vax-pid-dob-date","qr-vax-pid-sex","qr-vax-pid-i","qr-vax-pid-ai",
|
|
"qr-vax-ve-des","qr-vax-ve-nam","qr-vax-ve-dis","qr-vax-ve-vd-dvc-date","qr-vax-ve-vd-seq","qr-vax-ve-vd-ctr",
|
|
"qr-vax-ve-vd-adm","qr-vax-ve-vd-lot","qr-vax-ve-vd-dvn-date"]);
|
|
signAndDisplayQR("qr-vax", "icao.vacc","1", priKeyPEM, pubKeyLink, vaccineArray);
|
|
|
|
const testArray = getValueArray(["qr-test-utci","qr-test-pid-n","qr-test-pid-dob-date","qr-test-pid-dt","qr-test-pid-dn","qr-test-sp-spn",
|
|
"qr-test-sp-ctr","qr-test-sp-cd-p","qr-test-sp-cd-e","qr-test-sp-cd-a","qr-test-dat-sc-timestamp","qr-test-dat-ri-timestamp",
|
|
"qr-test-tr-tc","qr-test-tr-r","qr-test-tr-m","qr-test-opt"]);
|
|
signAndDisplayQR("qr-test", "icao.test","1", priKeyPEM, pubKeyLink, testArray);
|
|
|
|
// PEM code of the private key
|
|
const priKeyEUPEM = e('privkeyEU').value;
|
|
const pubKeyEUPEM = e('pubkeyEU').value;
|
|
|
|
const vaxMsg = {
|
|
"msg": {
|
|
"uvci": e("qr-vax-uvci").value,
|
|
"pid": {
|
|
"n": e("qr-vax-pid-n").value,
|
|
"dob": e("qr-vax-pid-dob-date").value,
|
|
"sex": e("qr-vax-pid-sex").value,
|
|
"i": e("qr-vax-pid-i").value,
|
|
"ai": e("qr-vax-pid-ai").value
|
|
},
|
|
"ve": [{
|
|
"des": e("qr-vax-ve-des").value,
|
|
"nam": e("qr-vax-ve-nam").value,
|
|
"dis": e("qr-vax-ve-dis").value,
|
|
"vd": [{
|
|
"dvc": e("qr-vax-ve-vd-dvc-date").value,
|
|
"seq": e("qr-vax-ve-vd-seq").value,
|
|
"ctr": e("qr-vax-ve-vd-ctr").value,
|
|
"adm": e("qr-vax-ve-vd-adm").value,
|
|
"lot": e("qr-vax-ve-vd-lot").value,
|
|
"dvn": e("qr-vax-ve-vd-dvn-date").value}
|
|
]
|
|
}]
|
|
}
|
|
};
|
|
|
|
msg = vaxMsg.msg;
|
|
|
|
let vax = {
|
|
"data": {
|
|
"hdr": {
|
|
"t": "icao.vacc",
|
|
"v": 1,
|
|
"is": "UTO"
|
|
},
|
|
msg,
|
|
}
|
|
};
|
|
|
|
signAndDisplayEUQR("qr-vax-hc1", vaxMsg, priKeyEUPEM, pubKeyEUPEM);
|
|
signAndDisplayQRICAO("qr-vax-icao", vax, priKeyEUPEM, pubKeyEUPEM);
|
|
|
|
let testMsg = {
|
|
"msg": {
|
|
"utci": e("qr-test-utci").value,
|
|
"pid": {
|
|
"n": e("qr-test-pid-n").value,
|
|
"dob": e("qr-test-pid-dob-date").value,
|
|
"dt": e("qr-test-pid-dt").value,
|
|
"dn": e("qr-test-pid-dn").value
|
|
},
|
|
"sp": {
|
|
"spn": e("qr-test-sp-spn").value,
|
|
"ctr": e("qr-test-sp-ctr").value,
|
|
"cd": {
|
|
"p": e("qr-test-sp-cd-p").value,
|
|
"e": e("qr-test-sp-cd-e").value,
|
|
"a": e("qr-test-sp-cd-a").value
|
|
}
|
|
},
|
|
"dat": {
|
|
"sc": e("qr-test-dat-sc-timestamp").value,
|
|
"ri": e("qr-test-dat-ri-timestamp").value
|
|
},
|
|
"tr": {
|
|
"tc": e("qr-test-tr-tc").value,
|
|
"r": e("qr-test-tr-r").value,
|
|
"m": e("qr-test-tr-m").value
|
|
},
|
|
"opt": e("qr-test-opt").value
|
|
}
|
|
}
|
|
|
|
msg = testMsg.msg;
|
|
|
|
let test = {
|
|
"data": {
|
|
"hdr": {
|
|
"t": "icao.test",
|
|
"v": 1,
|
|
"is": "UTO"
|
|
},
|
|
msg,
|
|
}
|
|
};
|
|
|
|
signAndDisplayEUQR("qr-test-hc1", testMsg, priKeyEUPEM, pubKeyEUPEM);
|
|
signAndDisplayQRICAO("qr-test-icao", test, priKeyEUPEM, pubKeyEUPEM);
|
|
}
|
|
|
|
function getEUPayload(cwt) {
|
|
if (cwt instanceof Map) {
|
|
return cwt.get(-260).get(1);
|
|
}
|
|
return cwt;
|
|
}
|
|
|
|
function schemaValidator() {
|
|
var ajv = new ajv7.default({strict: "log", validateFormats: false});
|
|
|
|
let client = new XMLHttpRequest();
|
|
client.open('GET', 'https://raw.githubusercontent.com/ehn-digital-green-development/ehn-dgc-schema/main/DGC.combined-schema.json', false);
|
|
client.setRequestHeader("Accept", "application/vnd.github.v3+json");
|
|
client.send();
|
|
|
|
const schema = JSON.parse(client.response);
|
|
delete schema['$schema'];
|
|
return ajv.compile(schema);
|
|
}
|
|
|
|
function verifyQRCode() {
|
|
gtag('event', 'verifyQR');
|
|
|
|
if (e("qr-verify").value.startsWith('CRED:')) {
|
|
PCFUtils.debugParseURI(e("qr-verify").value).then(result => {
|
|
e("qr-verify-result").innerHTML = result;
|
|
});
|
|
PCFUtils.debugVerify(e("qr-verify").value).then(debug => {
|
|
e('qr-verify-verified').innerHTML = debug;
|
|
});
|
|
} else {
|
|
e("qr-verify-result").innerHTML = "Checking";
|
|
DCC.unpackAndVerify(e("qr-verify").value, e('pubkeyEU').value).then(json => {
|
|
const validator = schemaValidator();
|
|
const valid = validator(getEUPayload(json));
|
|
if (json) {
|
|
e("qr-verify-result").innerHTML = "Data: " + he.encode(beautify(json, replacer, 2, 80));
|
|
e('qr-verify-verified').innerHTML = "Signature Verified " + (valid? " and Schema is Valid" : " but Schema has errors " + JSON.stringify(validator.errors));
|
|
} else {
|
|
e('qr-verify-verified').innerHTML = "Could not Verify";
|
|
}
|
|
});
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<script>
|
|
function fillTo(str, toSize) {
|
|
let missing = toSize - str.length;
|
|
if (missing == 0) return str;
|
|
return fillTo(str + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, missing), toSize);
|
|
}
|
|
|
|
function loadDemo() {
|
|
e("qr-vax-uvci").value = "U32870";
|
|
e("qr-vax-pid-n").value = "Smith Bill";
|
|
e("qr-vax-pid-dob-date").value = "1990-01-02";
|
|
e("qr-vax-pid-sex").value = "M";
|
|
e("qr-vax-pid-i").value = "A1234567Z";
|
|
e("qr-vax-pid-ai").value = "L4567890Z";
|
|
|
|
e("qr-vax-ve-des").value = "XM68M6";
|
|
e("qr-vax-ve-nam").value = "Comirnaty";
|
|
e("qr-vax-ve-dis").value = "RA01.0";
|
|
e("qr-vax-ve-vd-dvc-date").value = "2021-03-03";
|
|
e("qr-vax-ve-vd-seq").value = "1";
|
|
e("qr-vax-ve-vd-ctr").value = "UTO";
|
|
e("qr-vax-ve-vd-adm").value = "RIVM";
|
|
e("qr-vax-ve-vd-lot").value = "VC35679";
|
|
e("qr-vax-ve-vd-dvn-date").value = "2021-03-24";
|
|
|
|
e("qr-test-utci").value = "U01932";
|
|
e("qr-test-pid-n").value = "Cook Gerald";
|
|
e("qr-test-pid-dob-date").value = "1990-01-29";
|
|
e("qr-test-pid-dt").value = "P";
|
|
e("qr-test-pid-dn").value = "E1234567P";
|
|
e("qr-test-sp-spn").value = "General Hospital";
|
|
e("qr-test-sp-ctr").value = "UTO";
|
|
e("qr-test-sp-cd-p").value = "+00068765432";
|
|
e("qr-test-sp-cd-e").value = "[email protected]";
|
|
e("qr-test-sp-cd-a").value = "12 Utopia Street";
|
|
e("qr-test-dat-sc-timestamp").value = "2020-12-12T12:00:00+08:00";
|
|
e("qr-test-dat-ri-timestamp").value = "2021-02-11T14:00:00+08:00";
|
|
e("qr-test-tr-tc").value = "molecular(PCR)";
|
|
e("qr-test-tr-r").value = "negative";
|
|
e("qr-test-tr-m").value = "nasopharyngeal";
|
|
e("qr-test-opt").value = "ID12345";
|
|
}
|
|
|
|
loadDemo();
|
|
</script>
|
|
|
|
<script>
|
|
async function preloadKey() {
|
|
let cache = {}
|
|
cache[e('qr-linkEU').value] = e('pubkeyEU').value.replace("-----BEGIN CERTIFICATE-----", "").replace("-----END CERTIFICATE-----", "").replace(/\n/g,'');
|
|
DCC.addCachedCerts(cache);
|
|
|
|
CRED.resolveKey(e("qr-link").value);
|
|
}
|
|
window.onload = function() {
|
|
preloadKey();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|
|
|