forked from Path-Check/paper-cred-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cowin.html
473 lines (431 loc) · 27.3 KB
/
cowin.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
<!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>DIVOC Credentials Generator and Verifier</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 href="icao.html">ICAO<span class="xs-hidden"> Seals</span></a>
<a class="active" 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>DIVOC's India Cowin</h1>
<div class="full-div">
<div class="two-quarter">
<h4>W3C VC Overhead</h4>
<table>
<tr><td>Context</td><td><input id="qr-head-context" type="text" placeholder="https://www.w3.org/2018/credentials/v1, https://cowin.gov.in/credentials/vaccination/v1"/></td></tr>
<tr><td>IssueDate</td><td><input id="qr-head-issuance-date" type="text" placeholder="YYMMDD"/></td></tr>
<tr><td>Issuer</td><td><input id="qr-head-issuer" type="text" placeholder="https://cowin.gov.in/"/></td></tr>
<tr><td>Type</td><td><input id="qr-head-type" type="text" placeholder="VerifiableCredential, ProofOfVaccinationCredential"/></td></tr>
<tr><td>NonTrans</td><td><input id="qr-head-nontransfer" type="text" placeholder="true"/></td></tr>
</table>
<h4>Patient</h4>
<table>
<tr><td>Type</td><td><input id="qr-pat-type" type="text" placeholder="Person"/></td></tr>
<tr><td>ID</td><td><input id="qr-pat-id" type="text" placeholder="did:in.gov.uidai..."/></td></tr>
<tr><td>Ref ID</td><td><input id="qr-pat-refid" type="text" placeholder="123123123"/></td></tr>
<tr><td>Name</td><td><input id="qr-pat-name" type="text" placeholder="Name ..."/></td></tr>
<tr><td>Gender</td><td><input id="qr-pat-gender" type="text" placeholder="Male, ..."/></td></tr>
<tr><td>Age</td><td><input id="qr-pat-age" type="text" placeholder="23..."/></td></tr>
<tr><td>Nationality</td><td><input id="qr-pat-nationality" type="text" placeholder="Indian.. "/></td></tr>
</table>
<h4>Location</h4>
<table>
<tr><td>Address 1</td><td><input id="qr-location-address1" type="text" placeholder="3rd St"/></td></tr>
<tr><td>Address 2</td><td><input id="qr-location-address2" type="text" placeholder="Apt xx"/></td></tr>
<tr><td>District</td><td><input id="qr-location-district" type="text" placeholder="Somerville"/></td></tr>
<tr><td>City</td><td><input id="qr-location-city" type="text" placeholder="Somerville"/></td></tr>
<tr><td>State</td><td><input id="qr-location-state" type="text" placeholder="MA"/></td></tr>
<tr><td>Zip</td><td><input id="qr-location-zip" type="text" placeholder="02141"/></td></tr>
<tr><td>Country</td><td><input id="qr-location-country" type="text" placeholder="USA"/></td></tr>
</table>
</div>
<div class="two-quarter">
<h4>Evidence</h4>
<table>
<tr><td>ID</td><td><input id="qr-immunization-id" type="text" placeholder="undefined"/></td></tr>
<tr><td>Type</td><td><input id="qr-immunization-type" type="text" placeholder="Vaccination"/></td></tr>
<tr><td>Manuf</td><td><input id="qr-immunization-manuf" type="text" placeholder="AstraZeneca, ..."/></td></tr>
<tr><td>Product</td><td><input id="qr-immunization-product" type="text" placeholder="COVID19"/></td></tr>
<tr><td>Batch#</td><td><input id="qr-immunization-lot" type="text" placeholder="012L20A, ..."/></td></tr>
<tr><td>Date</td><td><input id="qr-immunization-date" type="text" placeholder=""/></td></tr>
<tr><td>EffectStart</td><td><input id="qr-immunization-eff-start" type="text" placeholder="YYYYMMDD"/></td></tr>
<tr><td>EffectEnd</td><td><input id="qr-immunization-eff-end" type="text" placeholder="YYYYMMDD"/></td></tr>
<tr><td>Dose</td><td><input id="qr-immunization-dose" type="text" placeholder="1, ..."/></td></tr>
<tr><td>Doses</td><td><input id="qr-immunization-total-doses" type="text" placeholder="2, ..."/></td></tr>
<tr><td>Verifier</td><td><input id="qr-immunization-verifier" type="text" placeholder="Name"/></td></tr>
</table>
<h4>Facility</h4>
<table>
<tr><td>Name</td><td><input id="qr-facility-name" type="text" placeholder="3rd St"/></td></tr>
<tr><td>Address 1</td><td><input id="qr-facility-address1" type="text" placeholder="3rd St"/></td></tr>
<tr><td>Address 2</td><td><input id="qr-facility-address2" type="text" placeholder="Apt xx"/></td></tr>
<tr><td>District</td><td><input id="qr-facility-district" type="text" placeholder="Somerville"/></td></tr>
<tr><td>City</td><td><input id="qr-facility-city" type="text" placeholder="Somerville"/></td></tr>
<tr><td>State</td><td><input id="qr-facility-state" type="text" placeholder="MA"/></td></tr>
<tr><td>Zip</td><td><input id="qr-facility-zip" type="text" placeholder="02141"/></td></tr>
<tr><td>Country</td><td><input id="qr-facility-country" type="text" placeholder="USA"/></td></tr>
</table>
</div>
<div class="quarter">
<h4>Credentials</h4>
<label for="privkey">Private Key</label><br/>
<textarea id="privkey" rows="10" cols="30">-----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>
<br>
</div>
</div>
<div class="full-div"></div>
<div class="four-quarter">
<br>
<button class="qr-btn" onclick="generateQRCodes()">Generate Credentials</button>
<br><br>
</div>
<div class="full-div">
<div class="two-quarter">
<h4>PCF's Format (<a href='https://github.com/Path-Check/paper-cred/blob/main/payloads/cowin.1.md'>Spec</a>)</h4>
<canvas id="qr-divoc-code"></canvas><br/>
<h4 id="qr-divoc-pdf-label" style="display: none;">PDF 417 Format</h4>
<canvas id="qr-divoc-pdf" style="display: none;"></canvas>
<pre id="qr-divoc-result"></pre>
<pre id="qr-divoc-bytes" class="xs-hidden"></pre>
</div>
<div class="two-quarter">
<h4>Original DIVOC Format</h4>
<canvas id="qr-divoc-orig-code"></canvas>
<h4 id="qr-divoc-orig-pdf-label" style="display: none;">PDF 417 Format</h4>
<canvas id="qr-divoc-orig-pdf" style="display: none;"></canvas>
<pre id="qr-divoc-orig-result" style="display: none;" onclick="copyToClipboard();">
{
"@context": ["https://www.w3.org/2018/credentials/v1", "https://cowin.gov.in/credentials/vaccination/v1"],
"type": ["VerifiableCredential", "ProofOfVaccinationCredential"],
"issuer": "https://cowin.gov.in/",
"issuanceDate": "2021-01-15T17:21:13.117Z",
"nonTransferable": "true",
"credentialSubject": {
"type": "Person",
"id": "did:in.gov.uidai.aadhaar:2342343334",
"refId": "12346",
"name": "Bhaya Mitra",
"gender": "Male",
"age": "27",
"nationality": "Indian",
"address": {
"streetAddress": "",
"streetAddress2": "",
"district": "",
"city": "",
"addressRegion": "",
"addressCountry": "IN",
"postalCode": ""
}
},
"evidence": [{
"id": "https://cowin.gov.in/vaccine/undefined",
"feedbackUrl": "https://cowin.gov.in/?undefined",
"infoUrl": "https://cowin.gov.in/?undefined",
"type": ["Vaccination"],
"batch": "MB3428BX",
"vaccine": "CoVax",
"manufacturer": "COVPharma",
"date": "2020-12-02T19:21:18.646Z",
"effectiveStart": "2020-12-02",
"effectiveUntil": "2025-12-02",
"dose": "",
"totalDoses": "",
"verifier": {
"name": "Sooraj Singh"
},
"facility": {
"name": "ABC Medical Center",
"address": {
"streetAddress": "123, Koramangala",
"streetAddress2": "",
"district": "Bengaluru South",
"city": "Bengaluru",
"addressRegion": "Karnataka",
"addressCountry": "IN",
"postalCode": ""
}
}
}],
"proof": {
"type": "RsaSignature2018",
"created": "2021-01-15T17:21:13Z",
"verificationMethod": "did:india",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJQUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..mJlHZZRD7VQwVJchfI21ZavjxNKglbf3LSaF1SAjELOWn9MARALkugsmOzG0mBon9R7zXSVPkPM8EDbUZxR4FsRlAFFszFv-0BjyAeIqRv-9MRnlm4cScQi8aCBgBnvsWfNIE175cGNbPUluVv5n6G66tVinioL5IL6uCZNQnSGp4jJrEAZa0t5s3jXfq7soHz1LTfQbLs7cH5-fDi3JW1-WeF4_ELy_9l_OxAc2CoACqYLOLJB-NnPsnz2bwAvH8yXHsjZJphzaBNqpn8DmJvcRHzhz7OjpGfhyouiOyGo_XncadFmftqwfilJkC1EISkSb6QVsyhHLOudY4PTTaA"
}
}</pre>
<pre id="qr-divoc-orig-bytes" class="xs-hidden"></pre>
</div>
<div class="quarter xs-hidden">
<label for="verify">Verify a QR Code</small></label><br/>
<textarea id="qr-verify" rows="10" cols="30" 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>
<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/pcf-utils.js"></script>
<script src="js/ui-utils.js"></script>
<script src="js/divoc-sdk.min.js"></script>
<script src="js/cred-sdk.min.js"></script>
<script>
function e(elem) { return document.getElementById(elem); }
function getValueArray(elemArray) {
const fields = elemArray.map(function(elemId) {
if (!e(elemId)) console.log('Could not find ' + elemId);
return e(elemId).value;
})
return fields;
}
function signAndDisplayQR(elemPref, _type, _version, priKeyPEM, pubKeyId, payloadValueArray) {
CRED.signAndPack(_type, _version, priKeyPEM, pubKeyId, payloadValueArray).then(uri => {
PCFUtils.debugURI(uri).then( debugInfo => {
UIUtils.drawsQR(elemPref, uri, debugInfo);
CRED.unpackAndVerify(uri).then(result => {
UIUtils.drawVerifiedSymbol(elemPref+'-code',result);
});
});
});
}
function parse(str) {
if(!/^(\d){8}$/.test(str)) return "invalid date";
var y = str.substr(0,4),
m = str.substr(4,2),
d = str.substr(6,2);
return new Date(y,m-1,d);
}
function generateQRCodes() {
gtag('event', 'generateQR');
// 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 fieldArray = [
"qr-pat-id", "qr-pat-refid", "qr-pat-name", "qr-pat-age", "qr-pat-gender", "qr-pat-nationality",
"qr-location-address1", "qr-location-address2", "qr-location-district", "qr-location-city", "qr-location-zip", "qr-location-state", "qr-location-country",
"qr-immunization-date", "qr-immunization-manuf", "qr-immunization-product", "qr-immunization-lot", "qr-immunization-eff-start", "qr-immunization-eff-end",
"qr-immunization-dose", "qr-immunization-total-doses", "qr-immunization-id", "qr-immunization-verifier",
"qr-facility-name", "qr-facility-address1", "qr-facility-address2", "qr-facility-district", "qr-facility-city", "qr-facility-zip", "qr-facility-state", "qr-facility-country",
"qr-head-issuance-date",
];
signAndDisplayQR("qr-divoc", "cowin", "1", priKeyPEM, pubKeyLink, getValueArray(fieldArray));
let divocW3C = {
"@context": e("qr-head-context").value.split(', '),
"type": e("qr-head-type").value.split(', '),
"issuer": e("qr-head-issuer").value,
"issuanceDate": parse(e("qr-head-issuance-date").value).toJSON(),
"nonTransferable": e("qr-head-nontransfer").value,
"credentialSubject": {
"type": e("qr-pat-type").value,
"id": e("qr-pat-id").value,
"refId": e("qr-pat-refid").value,
"name": e("qr-pat-name").value,
"gender": e("qr-pat-gender").value,
"age": e("qr-pat-age").value,
"nationality": e("qr-pat-nationality").value,
"address": {
"streetAddress": e("qr-location-address1").value,
"streetAddress2": e("qr-location-address2").value,
"district": e("qr-location-district").value,
"city": e("qr-location-city").value,
"addressRegion": e("qr-location-state").value,
"addressCountry": e("qr-location-country").value,
"postalCode": e("qr-location-zip").value,
}
},
"evidence": [
{
"id": "https://cowin.gov.in/vaccine/" + e("qr-immunization-id").value,
"feedbackUrl": "https://cowin.gov.in/?" + e("qr-immunization-id").value,
"infoUrl": "https://cowin.gov.in/?" + e("qr-immunization-id").value,
"type": [e("qr-immunization-type").value],
"batch": e("qr-immunization-lot").value,
"vaccine": e("qr-immunization-product").value,
"manufacturer": e("qr-immunization-manuf").value,
"date": e("qr-immunization-date").value,
"effectiveStart": e("qr-immunization-eff-start").value,
"effectiveUntil": e("qr-immunization-eff-end").value,
"dose": e("qr-immunization-dose").value,
"totalDoses": e("qr-immunization-total-doses").value,
"verifier": {
"name": e("qr-immunization-verifier").value
},
"facility": {
"name": e("qr-facility-name").value,
"address": {
"streetAddress": e("qr-facility-address1").value,
"streetAddress2": e("qr-facility-address2").value,
"district": e("qr-facility-district").value,
"city": e("qr-facility-city").value,
"addressRegion": e("qr-facility-state").value,
"addressCountry": e("qr-facility-country").value,
"postalCode": e("qr-facility-zip").value,
}
}
}
]
};
DIVOC.sign(divocW3C).then(cert => {
DIVOC.pack(cert).then(packed => {
UIUtils.drawsQR("qr-divoc-orig", packed);
e("qr-divoc-orig-result").innerHTML = packed;
DIVOC.unpackAndVerify(packed).then(verified => {
if (verified) {
const imgDim={width:50,height:50};
var context = e('qr-divoc-orig-code').getContext('2d');
var imageObj = new Image();
imageObj.src = './img/ok-256.png';
imageObj.onload = function() {
context.drawImage(imageObj,
e('qr-divoc-orig-code').width / 2 - imgDim.width / 2 +1,
e('qr-divoc-orig-code').height / 2 - imgDim.height / 2,imgDim.width,imgDim.height);
};
}
});
});
e("qr-divoc-orig-result").setAttribute('data-title', JSON.stringify(cert));
});
e("qr-divoc-orig-code").style.display='block';
e("qr-divoc-orig-result").style.display='block';
}
function copyToClipboard() {
navigator.permissions.query({name: "clipboard-write"}).then(result => {
if (result.state == "granted" || result.state == "prompt") {
var copyText = e("qr-divoc-orig-result").getAttribute('data-title');
navigator.clipboard.writeText(copyText);
}
});
}
function verifyQRCode() {
gtag('event', 'verifyQR');
const payload = e("qr-verify").value;
if (payload.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;
});
} if (payload.startsWith("{")) {
DIVOC.verify(JSON.parse(payload)).then(verified => {
e("qr-verify-result").innerHTML = "W3C VC Payload";
e("qr-verify-verified").innerHTML = "Signature: " + (verified ? "Verified" : "Not Valid");
});
}
}
</script>
<script>
// Defaults
e("qr-immunization-date").value = new Date().toJSON().slice(0, 10).replaceAll("-","");
function loadDemo() {
e("qr-head-context").value = "https://www.w3.org/2018/credentials/v1, https://cowin.gov.in/credentials/vaccination/v1";
e("qr-head-issuance-date").value = new Date().toJSON().slice(0, 10).replaceAll("-","");
e("qr-head-type").value = "VerifiableCredential, ProofOfVaccinationCredential";
e("qr-head-issuer").value = "https://cowin.gov.in/";
e("qr-head-nontransfer").value = "true";
e("qr-pat-type").value = "Person";
e("qr-pat-id").value = "did:in.gov.uidai.aadhaar:2342343334";
e("qr-pat-refid").value = "12346";
e("qr-pat-name").value = "Bhaya Mitra";
e("qr-pat-age").value = "27";
e("qr-pat-gender").value = "Male";
e("qr-pat-nationality").value = "Indian";
e("qr-location-address1").value = "101-102, Mangal Ashirwad";
e("qr-location-address2").value = "S V Road";
e("qr-location-district").value = "Santacruz West";
e("qr-location-city").value = "Mumbai";
e("qr-location-zip").value = "400054";
e("qr-location-state").value = "Maharashtra";
e("qr-location-country").value = "IN";
e("qr-immunization-id").value = "";
e("qr-immunization-type").value = "Vaccination";
e("qr-immunization-manuf").value = "COVPharma";
e("qr-immunization-product").value = "CoVax";
e("qr-immunization-lot").value = "MB3428BX";
e("qr-immunization-eff-start").value = "20201202";
e("qr-immunization-eff-end").value = "20251202";
e("qr-immunization-dose").value = "1";
e("qr-immunization-total-doses").value = "1";
e("qr-immunization-verifier").value = "Sooraj Singh";
e("qr-facility-name").value = "ABC Medical Center";
e("qr-facility-address1").value = "123, Koramangala";
e("qr-facility-address2").value = "";
e("qr-facility-district").value = "Bengaluru South";
e("qr-facility-city").value = "Bengaluru";
e("qr-facility-zip").value = "";
e("qr-facility-state").value = "Karnataka";
e("qr-facility-country").value = "IN";
}
loadDemo();
</script>
<script>
async function preloadKey() {
CRED.resolveKey(e("qr-link").value);
}
window.onload = function() {
preloadKey();
}
</script>
</body>
</html>