private async UniTaskVoid V()
        {
            ClientCore.Start();
            ClientCore.SendMessageToMyCoreNode(MsgType.Enhanced, null);
            var c = await ClientCore.ReceiveCertification();

            Debugger.Log(c);
        }
Ejemplo n.º 2
0
        private void OnEnable()
        {
            issuerManager.SetTimeStamp(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
            var id = Hash.GetCertificateId(PhoneId.GetImei(), issuerManager.HolderName, issuerManager.TimeStamp);

            Debugger.Log(id);
            var certificate = Certificate.CreateCertificate(id, issuerManager.IssuerName, issuerManager.TimeStamp,
                                                            issuerManager.Category, issuerManager.Result);

            ClientCore.Start();
            ClientCore.SendMessageToMyCoreNode(MsgType.NewTransaction, certificate);
        }
Ejemplo n.º 3
0
        private async UniTaskVoid Verify()
        {
            ClientCore.Start();
            ClientCore.SendMessageToMyCoreNode(MsgType.Enhanced, verifierManager.CertificateId);
            var certification = await ClientCore.ReceiveCertification();

            verifierManager.SetCertification(certification);
            var hash = Hash.GetHash(verifierManager.CertificateId + verifierManager.HolderName +
                                    verifierManager.IssueDate);

            if (hash != verifierManager.Hash)
            {
                NotificationSystem.ShowDialog("エラー", "IDが違います", "ok");
            }
        }
Ejemplo n.º 4
0
        private void Start()
        {
            ClientCore.Start();

            var transaction = new List <Dictionary <string, object> >()
            {
                new Dictionary <string, object>()
                {
                    { "@context", new List <string>()
                      {
                          "https://hoge", "https://hoge/hoge"
                      } },
                    { "id", "https://id/huga" },
                    { "type", new List <string>()
                      {
                          "VerifiableCredential", "AntibodyTestCredential"
                      } },
                    { "issuer", "https://issuer/piyo" },
                    { "issuerDate", null },
                    { "credentialSubject", new List <string>()
                      {
                          "did:example:xyzzy", "SARS-CoV-2"
                      } }
                },
                new Dictionary <string, object>()
                {
                    { "proof", null }
                }
            };

            Observable.Interval(TimeSpan.FromSeconds(10))
            .Subscribe(x => {
                transaction[0]["issuerDate"] = DateTime.Now;
                ClientCore.SendMessageToMyCoreNode(MsgType.NewTransaction, Json.Serialize(transaction));
            })
            .AddTo(this);
        }