Esempio n. 1
0
        public static SignedDGC VerifyData(String codeData)
        {
            try {
                // The base45 encoded data shoudl begin with HC1
                if (codeData.StartsWith("HC1:"))
                {
                    string base45CodedData = codeData.Substring(4);

                    // Base 45 decode data
                    byte[] base45DecodedData = Base45Decoding(Encoding.GetEncoding("UTF-8").GetBytes(base45CodedData));

                    // zlib decompression
                    byte[] uncompressedData = ZlibDecompression(base45DecodedData);

                    SignedDGC vacProof = new SignedDGC();
                    // Sign and encrypt data
                    byte[] signedData = VerifySignedData(uncompressedData, vacProof);

                    // Get json from CBOR representation of ProofCode
                    EU_DGC eU_DGC = GetVaccinationProofFromCbor(signedData);
                    vacProof.Dgc = eU_DGC;

                    return(vacProof);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                throw e;
            }
            return(null);
        }
Esempio n. 2
0
        protected static byte[] VerifySignedData(byte[] signedData, SignedDGC vacProof)
        {
            DGCVerifier verifier = new DGCVerifier(App.CertificateManager);

            return(verifier.Verify(signedData, vacProof));
        }
Esempio n. 3
0
        protected static byte[] VerifySignedData(byte[] signedData, SignedDGC vacProof)
        {
            DGCVerifier verifier = new DGCVerifier(new CertificateProvider());

            return(verifier.Verify(signedData, vacProof));
        }