0.0.1 • Published 3 years ago

euvac v0.0.1

Weekly downloads
-
License
EUPL
Repository
-
Last release
3 years ago

Trivial/rudimentary eHN-simplified implementation

Brought in line with 1.00 of https://github.com/ehn-digital-green-development/hcert-spec/blob/main/hcert_spec.md

For round-trip testing of cose_sign.js and cose_verify.js take some JSON, e.g. { "Foo" : "Bar }, CBOR package, COSE sign, compress and base45 convert it for use in a QR:

  1. COSE sign
    1. compact the JSOn into CBOR
    2. sign and package as a COSE message
    3. ZLIB compress
    4. Base45 encode
  2. COSE verify
    1. Base45 decode
    2. ZLIB decompress
    3. check the signature on the COSE message
    4. unpack the CBOR into JSON

Test Steps

  1. Generate the CSCA and DSC with ./gen-csca-dsc.sh
  2. Ensure the dependencies are installed: npm install
  3. Run the command: echo "{'A': 1234}" | npm run sign | npm run verify
  4. You should see the output: {"A": 1234}

Or the larger example:

    echo '{ "Foo":1, "Bar":{ "Field1": "a value",   "integer":1212112121 }}' |  npm --silent run sign > barcode
    cat barcode | | npm run verify

Which should output:

{
    "Foo": 1, 
    "Bar": {
        "Field1": "a value", 
        "integer": 1212112121
   }
}