Git Product home page Git Product logo

dart_cose's Introduction

Pub Build status

dart_cose

A package that can be used to decode and validate a COSE that contains a European Digital Green Certificate (DGC).

Getting Started

Import the COSE as binary (List) and your keys in a map kid => PEM and call the decodeAndVerify function on Cose.

Example:

    final result = Cose.decodeAndVerify(
        coseIntList,
        {
          'kid': '''pem'''
        },
    );
    print(result.errorCode);
    print(result.verified);
    print(result.payload);

dart_cose's People

Contributors

ikbendewilliam avatar jbx1 avatar jeroentrappers avatar vanlooverenkoen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dart_cose's Issues

(REQUEST) Feature/Function to extract KID from EU QR

Hi, may I request to add feature/function to extract the QR KID in the protectedHeader from coseByte in dart_cose?

final protectedHeader = items[_CBOR_DATA_PROTECTED_HEADER_INDEX];
var a = Cbor();
a.decodeFromList(coseByte);
List coseElement = a.getDecodedData().first;

final protectedHeader = coseElement[_CBOR_DATA_PROTECTED_HEADER_INDEX];

var b = Cbor();
b.decodeFromList(protectedHeader);
var kid = b.getDecodedData().first;
qrKid = base64Encode(kid[4]);

Add COSE KID to `CoseResult`

Knowing which KID was found in the COSE header is useful to identify which of the certificates was used, and thus the corresponding authority or additional information that the application could know about the KID (such as the country, which should match the country of the DGC, whether it was an NHS one or the eHealth one, whether it was revoked etc.).

In cases when the KID was not found in the Map of kid-to-certificates, it is useful to know what the KID in the header was too.

Refer to corresponding pull request which adds the coseKid to the CoseResult: #11

Support test certificates

Hi Jeroen,

are test certificates also supported? I have troubles with reading test certificates. With qr codes from vaccinated people it works like a charm, but I am not able to read qr codes from tested people.

I get the following error code when reading a qr code from a tested person

CoseErrorCode (CoseErrorCode.key_not_found)

Thanks!

Alex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.