-
Notifications
You must be signed in to change notification settings - Fork 29
/
cowin.html
431 lines (386 loc) · 25.8 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
<!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>
<label for="privkeyDivoc">DIVOC Private Key</label><br/>
<textarea id="privkeyDivoc" rows="10" cols="30">-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAnXQalrgztecTpc+INjRQ8s73FSE1kU5QSlwBdICCVJBUKiuQUt7s+Z5epgCvLVAOCbP1mm5lV7bfgV/iYWDio7lzX4MlJwDedWLiufr3Ajq+79CQiqPaIbZTo0i13zijKtX7wgxQ78wT/HkJRLkFpmGeK3za21tEfttytkhmJYlwaDTEc+Kx3RJqVhVh/dfwJGeuV4Xc/e2NH++ht0ENGuTk44KpQ+pwQVqtW7lmbDZQJoOJ7HYmmoKGJ0qt2hrj15uwcD1WEYfY5N7N0ArTzPgctExtZFDmituLGzuAZfv2AZZ9/7Y+igshzfB0reIFdUKw3cdVTzfv5FNrIqN5pwIDAQABAoIBAHPILMUoLt5UTd5f/YnebqgeCRNAmGOBcwk7HtbMqQoGF93qqvZFd30XOAJZ/ncTpz77Vl95ToxxrWk1WQLCe+ZpOK3Dgk5sFSm8zXx1T64UBNPUSnWoh37C1D39+b9rppCZScgnxlyPdSLy3h3q8Hyoy+auqUEkm/ms5W2lT3fJscyN1IAyHrhsOBWjl3Ilq5GxBo5tbYv/Fb1pQiP/p2SIHA1+2ASXNYQP100F5Vn0V6SFtBXTCQnwcvbP083NvlGxs9+xRs3MCUcxCkKepWuzYwOZDmu/2yCz1/EsP6wlsYEHmCZLdIb0tQt0caqzB/RoxfBpNRIlhOtqHvBzUgECgYEAzIRn5Y7lqO3N+V29wXXtVZjYWvBh7xUfOxAwVYv0rKI0y9kHJHhIrU+wOVOKGISxBKmzqBQRPvXtXW8E0/14Zz82g60rRwtNjvW0UoZAY3KPouwruUIjAe2UnKZcQ//MBTrvds8QGpL6nxvPsBqU0y2K+ySAOxBtNtGEjzv8nxUCgYEAxRbMWukIbgVOuQjangkfJEfA1UaRFQqQ8jUmT9aiq2nREnd4mYP8kNKzJa9L7zj6Un6yLH5DbGspZ2gGODeRw3uVFN8XSzRdLvllNEyiG/waiysUtXfG2DPOR6xD8tXXDMm/tl9gTa8cbkvqYy10XT9MpfOAsusEZVmc0/DBBMsCgYAYdAxoKjnThPuHwWma5BrIjUnxNaTADWp6iWj+EYnjylE9vmlYNvmZn1mWwSJV5Ce2QwQ0KJIXURhcf5W4MypeTfSase3mxLc1TLOO2naAbYY3GL3xnLLK3DlUsZ9+kes3BOD097UZOFG3DIA8sjDxPxTLCoY6ibBFSa/r4GRIMQKBgQCranDCgPu79RHLDVBXM0fKnj2xQXbd/hqjDmcL+Xnx7E7S6OYTXyBENX1qwVQh9ESDi34cBJVPrsSME4WVT3+PreS0CnSQDDMfr/m9ywkTnejYMdgJHOvtDuHSpJlUk3g+vxnm3H0+E5d+trhdGiOjFnLrwyWkd5OTMqWcEEFQkQKBgFfXObDz/7KqeSaAxI8RzXWbI3Fa492b4qQUhbKYVpGn98CCVEFJr11vuB/8AXYCa92OtbwgMw6Ah5JOGzRScJKdipoxo7oc2LJ9sSjjw3RB/aWl35ChvnCJhmfSL8Usbj0nWVTrPwRLjMC2bIxkLtnm9qYXPumW1EjEbusjVMpN
-----END RSA PRIVATE KEY-----</textarea>
<br>
<label for="pubKeyIdDivoc">Public kID</label><br/>
<textarea id="pubKeyIdDivoc" rows="1" cols="30">did:india</textarea>
<br>
<label for="pubkeyDivoc">Public Key</label><br/>
<textarea id="pubKeyDivoc" rows="6" cols="30">-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnXQalrgztecTpc+INjRQ8s73FSE1kU5QSlwBdICCVJBUKiuQUt7s+Z5epgCvLVAOCbP1mm5lV7bfgV/iYWDio7lzX4MlJwDedWLiufr3Ajq+79CQiqPaIbZTo0i13zijKtX7wgxQ78wT/HkJRLkFpmGeK3za21tEfttytkhmJYlwaDTEc+Kx3RJqVhVh/dfwJGeuV4Xc/e2NH++ht0ENGuTk44KpQ+pwQVqtW7lmbDZQJoOJ7HYmmoKGJ0qt2hrj15uwcD1WEYfY5N7N0ArTzPgctExtZFDmituLGzuAZfv2AZZ9/7Y+igshzfB0reIFdUKw3cdVTzfv5FNrIqN5pwIDAQAB
-----END PUBLIC KEY-----</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();"></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 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;
// Where to Download the public key
const pubKeyIdDivoc = e("pubKeyIdDivoc").value;
const privkeyDivoc = e('privkeyDivoc').value;
const pubKeyDivoc = e('pubKeyDivoc').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, privkeyDivoc, pubKeyDivoc).then(cert => {
DIVOC.pack(cert).then(packed => {
UIUtils.drawsQR("qr-divoc-orig", packed);
e("qr-divoc-orig-result").innerHTML = packed;
DIVOC.unpackAndVerify(packed, pubKeyDivoc).then(verified => {
if (verified.status == "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>