示例#1
0
        void LectureEID()
        {
            FIDSmartCard card;
            FIDBelgianEidCard beid;

            string strNom = "";
            string strAdresse = "";
            Identity = new NSMutableData();
            Adresse = new NSMutableData();

            if (eID != null)
            {
                status = eID.Open();

                if (status == FIDStatusCode.OK)
                {

                    card = new FIDSmartCard();

                    card = eID.GetCard(status,true);

                    if (status == FIDStatusCode.OK)
                    {
                        beid = new FIDBelgianEidCard(card);

                        beid.ReadIdentityFile(Identity);

                        beid.ReadAddressFile(Adresse);

                        strNom = FIDBelgianEidCard.GetLastNameFromID((NSData)Identity);

                        strAdresse = FIDBelgianEidCard.GetStreetAndNumberFromAddress((NSData)Adresse) + " " +  FIDBelgianEidCard.GetMunicipalityFromAddress((NSData)Adresse);

                        msg = new UIAlertView() { Title = "MEDINECT2020", Message = strNom + " " + strAdresse };
                        msg.AddButton("OK");

                      	 msg.Show();
                    }

                }

                eID.Close();

            }
        }
示例#2
0
        void SignatureEID()
        {
            FIDSmartCard card;
            FIDBelgianEidCard beid;
            FIDPinDialogDescription pinDialog;

            string strNom = "";
            string strAdresse = "";
            Identity = new NSMutableData();
            Adresse = new NSMutableData();
            digest = new NSMutableData();
            int intEssai = 0;
            NSData strSignature;

            if (eID != null)
            {
                status = eID.Open();

                if (status == FIDStatusCode.OK)
                {
                    statusSign = FIDStatusCode.WRONG_PIN;

                    card = new FIDSmartCard();

                    card = eID.GetCard(status,true);

                    if (status == FIDStatusCode.OK)
                    {
                        beid = new FIDBelgianEidCard(card);

                        nsTexte = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
                        pinDialog = new FIDPinDialogDescription();

                        pinDialog.Lang = FIDPinDialogLang.French;
                        pinDialog.PinMaxLength = 4;
                        pinDialog.PinMinLength = 4;
                        //pinDialog.Controller = this;

                        strSignature = beid.SignData(nsTexte,FIDHashMethod.SHA1, ref statusSign, ref intEssai,digest,pinDialog);

                        InvokeOnMainThread (delegate {

                            if (statusSign == FIDStatusCode.OK)
                            {
                                msg = new UIAlertView() { Title = "MEDINECT", Message = strSignature.ToString() };
                                msg.AddButton("OK");

                      			 msg.Show();
                            }
                            else
                            {
                                msg = new UIAlertView() { Title = "MEDINECT", Message = "Erreur : " + intEssai };
                                msg.AddButton("OK");

                      			 msg.Show();
                            }
                        });
                    }

                }

                eID.Close();

            }
        }