Skip to content

Commit db3d338

Browse files
wes-smithmsporny
authored andcommitted
Add non-legacy CBOR test vectors.
1 parent 6e63d02 commit db3d338

File tree

4 files changed

+78
-16
lines changed

4 files changed

+78
-16
lines changed

contexts/vc-barcodes-v1.jsonld

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"AamvaDriversLicenseScannableInformation": "https://w3id.org/vc-barcodes#AamvaDriversLicenseScannableInformation",
88
"protectedComponentIndex": {
99
"@id": "https://w3id.org/vc-barcodes#protectedComponentIndex",
10-
"@type": "https://w3id.org/security#multibase"
10+
"@type": "https://w3id.org/security#multibase"
1111
},
1212
"OpticalBarcodeCredential": "https://w3id.org/vc-barcodes#OpticalBarcodeCredential",
1313
"TerseBitstringStatusListEntry": {

diagrams/dl-barcode.png

5.11 KB
Loading

diagrams/ead-qr.png

1.45 KB
Loading

index.html

+77-15
Original file line numberDiff line numberDiff line change
@@ -1303,30 +1303,95 @@ <h4>CBOR-LD Compression and Encoding</h4>
13031303
This results in the following encoded credentials:
13041304
<pre class="example nohighlight"
13051305
title="A CBOR-LD compressed Utopia Driver's License VC">
1306-
TODO
1306+
d90664a60183198000198001198002189d82187618a418b8a3189c18a618ce18b218d01ae592208118baa2189c18a018a8447582002018be18aa18c0a5189c186c18d60418e018e618e258417ab7c2e56b49e2cce62184ce26818e15a8b173164401b5d3bb93ffd6d2b5eb8f6ac0971502ae3dd49d17ec66528164034c912685b8111bc04cdc9ec13dbadd91cc18e418ac
1307+
1308+
diagnostic:
1309+
1636(
1310+
{
1311+
1: [32768, 32769, 32770],
1312+
157: [118, 164],
1313+
184: {156: 166, 206: 178, 208: 3851559041},
1314+
186: {156: 160, 168: h'75820020'},
1315+
190: 170,
1316+
192: {
1317+
156: 108,
1318+
214: 4,
1319+
224: 230,
1320+
226: h'7AB7C2E56B49E2CCE62184CE26818E15A8B173164401B5D3BB93FFD6D2B5EB8F6AC0971502AE3DD49D17EC66528164034C912685B8111BC04CDC9EC13DBADD91CC',
1321+
228: 172
1322+
}
1323+
}
1324+
)
13071325
</pre>
13081326
<pre class="example nohighlight"
13091327
title="A CBOR-LD compressed Utopia EAD VC">
1310-
TODO
1328+
d90664a50183198000198001198002189d82187618a418baa1189c18a218be18ae18c0a5189c186c18d20418dc18e218de58417a9ec7f688f60caa8c757592250b3f6d6e18419941f186e1ed4245770e687502d51d01cd2c2295e4338178a51a35c2f044a85598e15db9aef00261bc5c95a744e718e018b0
1329+
1330+
diagnostic:
1331+
1636(
1332+
{
1333+
1: [32768, 32769, 32770],
1334+
157: [118, 164],
1335+
186: {156: 162},
1336+
190: 174,
1337+
192: {
1338+
156: 108,
1339+
210: 4,
1340+
220: 226,
1341+
222: h'7A9EC7F688F60CAA8C757592250B3F6D6E18419941F186E1ED4245770E687502D51D01CD2C2295E4338178A51A35C2F044A85598E15DB9AEF00261BC5C95A744E7',
1342+
224: 176
1343+
}
1344+
}
1345+
)
13111346
</pre>
13121347
<p>
13131348
Encoding the Driver's License CBORLD as base64url and inserting the result into the
13141349
PDF417 bytes in the 'ZZA' field in the 'ZZ' subfile:
13151350
</p>
13161351
<pre class="example nohighlight"
1317-
title="An encoded Utopia Driver's License VCB">
1318-
TODO
1352+
title="Bytes from a PDF417 including an encoded Utopia Driver's License VCB">
1353+
bytes(@\n\x1e\rANSI000000090002DL00410267ZZ03080162DLDAQF987654321\nDCSSMITH\nDDEN\nDACJOHN\nDDFN\nDADNONE\nDDGN\nDCAC\nDCBNONE\nDCDNONE\nDBD01012024\nDBB04191988\nDBA04192030\nDBC1\nDAU069 IN\nDAYBRO\nDAG123 MAIN ST\nDAIANYVILLE\nDAJUTO\nDAKF87P20000 \nDCFUTODOCDISCRIM\nDCGUTO\nDAW158\nDCK1234567890\nDDAN\rZZZZA2QZkpgGDGYAAGYABGYACGJ2CGHYYpBi4oxicGKYYzhiyGNAa5ZIggRi6ohicGKAYqER1ggAgGL4YqhjApRicGGwY1gQY4BjmGOJYQXq3wuVrSeLM5iGEziaBjhWosXMWRAG107uT_9bSteuPasCXFQKuPdSdF-xmUoFkA0yRJoW4ERvATNyewT263ZHMGOQYrA==\r)
13191354
</pre>
13201355
<p>
13211356
Encoding the EAD CBORLD as base45 and prepending 'VC1-':
13221357
</p>
13231358
<pre class="example nohighlight"
1324-
title="An encoded Utopia Driver's License EAD">
1325-
TODO
1359+
title="An encoded Utopia EAD VCB">
1360+
VC1-SJRPWCR803A3P0098G3A3-B02-J743853U53KGK0XJ6MKJ1OI0M.FO053.33963DN04$RAQS+4SMC8C3KM7VX4VAPL9%EILI:I1O$D:23%GJ0OUCPS0H8D2FB9D5G00U39.PXG49%SOGGB*K$Z6%GUSCLWEJ8%B95MOD0P NG-I:V8N63K53
13261361
</pre>
13271362
<p>
1328-
The above can now be turned into barcodes: TODO
1363+
The above can now be turned into barcodes:
13291364
</p>
1365+
<figure id="dl-barcode">
1366+
<img style="margin: auto; display: block; border-radius:15px; width: 80%;"
1367+
src="diagrams/dl-barcode.png"
1368+
alt="A VCB from a Utopia driver's license.">
1369+
<figcaption style="text-align: center;">
1370+
A VCB from a Utopia driver's license.
1371+
</figcaption>
1372+
</figure>
1373+
</section>
1374+
<section>
1375+
<h5>Employment Authorization Document</h5>
1376+
<figure id="ead-qr-legacy">
1377+
<img style="margin: auto; display: block; border-radius:15px; width: 50%;"
1378+
src="diagrams/ead-qr.png"
1379+
alt="A VCB from a Utopia EAD.">
1380+
<figcaption style="text-align: center;">
1381+
A VCB from a Utopia EAD.
1382+
</figcaption>
1383+
</figure>
1384+
<p>
1385+
For use with the following MRZ:
1386+
</p>
1387+
<figure id="ead-back">
1388+
<img style="margin: auto; display: block; border-radius:15px; width: 50%;"
1389+
src="diagrams/ead-back.png"
1390+
alt="An MRZ on a Utopia Employment Authorization Document.">
1391+
<figcaption style="text-align: center;">
1392+
An MRZ on a Utopia Employment Authorization Document.
1393+
</figcaption>
1394+
</figure>
13301395
</section>
13311396
</section>
13321397
<section>
@@ -1340,27 +1405,24 @@ <h4>Decoding and Decompressing</h4>
13401405
We first read the data from the barcodes:
13411406
</p>
13421407
<pre class="example nohighlight"
1343-
title="An encoded Utopia Driver's License VCB">
1344-
TODO
1408+
title="Bytes from a PDF417 including an encoded Utopia Driver's License VCB">
1409+
bytes(@\n\x1e\rANSI000000090002DL00410267ZZ03080162DLDAQF987654321\nDCSSMITH\nDDEN\nDACJOHN\nDDFN\nDADNONE\nDDGN\nDCAC\nDCBNONE\nDCDNONE\nDBD01012024\nDBB04191988\nDBA04192030\nDBC1\nDAU069 IN\nDAYBRO\nDAG123 MAIN ST\nDAIANYVILLE\nDAJUTO\nDAKF87P20000 \nDCFUTODOCDISCRIM\nDCGUTO\nDAW158\nDCK1234567890\nDDAN\rZZZZA2QZkpgGDGYAAGYABGYACGJ2CGHYYpBi4oxicGKYYzhiyGNAa5ZIggRi6ohicGKAYqER1ggAgGL4YqhjApRicGGwY1gQY4BjmGOJYQXq3wuVrSeLM5iGEziaBjhWosXMWRAG107uT_9bSteuPasCXFQKuPdSdF-xmUoFkA0yRJoW4ERvATNyewT263ZHMGOQYrA==\r)
13451410
</pre>
1346-
<p>
1347-
Encoding the EAD CBORLD as base45 and prepending 'VC1-':
1348-
</p>
13491411
<pre class="example nohighlight"
13501412
title="An encoded Utopia Driver's License EAD">
1351-
TODO
1413+
VC1-SJRPWCR803A3P0098G3A3-B02-J743853U53KGK0XJ6MKJ1OI0M.FO053.33963DN04$RAQS+4SMC8C3KM7VX4VAPL9%EILI:I1O$D:23%GJ0OUCPS0H8D2FB9D5G00U39.PXG49%SOGGB*K$Z6%GUSCLWEJ8%B95MOD0P NG-I:V8N63K53
13521414
</pre>
13531415
<p>
13541416
We extract the data after 'VC1-' and the data in field 'ZZA'
13551417
in subfile 'ZZ', undoing the base encoding:
13561418
</p>
13571419
<pre class="example nohighlight"
13581420
title="A CBOR-LD compressed Utopia Driver's License VC">
1359-
TODO
1421+
d90664a60183198000198001198002189d82187618a418b8a3189c18a618ce18b218d01ae592208118baa2189c18a018a8447582002018be18aa18c0a5189c186c18d60418e018e618e258417ab7c2e56b49e2cce62184ce26818e15a8b173164401b5d3bb93ffd6d2b5eb8f6ac0971502ae3dd49d17ec66528164034c912685b8111bc04cdc9ec13dbadd91cc18e418ac
13601422
</pre>
13611423
<pre class="example nohighlight"
13621424
title="A CBOR-LD compressed Utopia EAD VC">
1363-
TODO
1425+
d90664a50183198000198001198002189d82187618a418baa1189c18a218be18ae18c0a5189c186c18d20418dc18e218de58417a9ec7f688f60caa8c757592250b3f6d6e18419941f186e1ed4245770e687502d51d01cd2c2295e4338178a51a35c2f044a85598e15db9aef00261bc5c95a744e718e018b0
13641426
</pre>
13651427
<p>
13661428
We now decompress with CBOR-LD to get the original JSON-LD VCs to be

0 commit comments

Comments
 (0)