Пример #1
0
 internal PteidId(PTEID_EId id)
 {
     try {
         version         = 0;
         deliveryEntity  = id.getIssuingEntity();
         country         = id.getCountry();
         documentType    = id.getDocumentType();
         cardNumber      = id.getDocumentNumber();
         cardNumberPAN   = id.getDocumentPAN();
         cardVersion     = id.getDocumentVersion();
         deliveryDate    = id.getValidityBeginDate();
         locale          = id.getLocalofRequest();
         validityDate    = id.getValidityEndDate();
         name            = id.getSurname();
         firstname       = id.getGivenName();
         sex             = id.getGender();
         nationality     = id.getNationality();
         birthDate       = id.getDateOfBirth();
         height          = id.getHeight();
         numBI           = id.getCivilianIdNumber();
         nameFather      = id.getSurnameFather();
         firstnameFather = id.getGivenNameFather();
         nameMother      = id.getSurnameMother();
         firstnameMother = id.getGivenNameMother();
         numNIF          = id.getTaxNo();
         numSS           = id.getSocialSecurityNumber();
         numSNS          = id.getHealthNumber();
         notes           = id.getAccidentalIndications();
         mrz1            = id.getMRZ1();
         mrz2            = id.getMRZ2();
         mrz3            = id.getMRZ3();
     } catch (Exception) {
         throw new PteidException(0);
     }
 }
Пример #2
0
        /*
         * Prints the current tries left for each pin in the card
         */
        public void showPinInfo()
        {
            Console.WriteLine("User:"******"Name: " + eid.getGivenName() + " " + eid.getSurname());
            Console.WriteLine("List of pins and respective \"tries left\":");

            //Gets the Pins objects (with the informations of all pins)
            PTEID_Pins pins = eidCard.getPins();

            //Iterates through all pins and prints the number of tries left for the user to type the correct pin
            for (uint i = 0; i < pins.count(); i++)
            {
                PTEID_Pin pin = pins.getPinByNumber(i);

                Console.WriteLine(pin.getLabel() + ":\nTries left: " + pin.getTriesLeft());
            }
        }
Пример #3
0
        /*
         * Prints address info present in the card (requires address pin)
         */
        public void ShowAddressInfo()
        {
            //The number of tries that the user has (updated with each call to verifyPin)
            uint triesLeft = uint.MaxValue;

            //Get the collection of card PINs
            PTEID_Pins pins = eidCard.getPins();

            //Get the specific PIN we want
            PTEID_Pin pin = pins.getPinByPinRef(PTEID_Pin.ADDR_PIN);

            //If the method verifyPin is called with "" as the first argument it prompts the middleware GUI for the user to insert its PIN
            //Otherwise we can provide the PIN as the first argument and the end result will be the same
            if (pin.verifyPin("", ref triesLeft, true))
            {
                //SDK class that handles address related information
                PTEID_Address address = eidCard.getAddr();
                Console.WriteLine("\n\nReading address details of: " + eid.getGivenName() + " " + eid.getSurname() + ":");

                if (address.isNationalAddress())
                {
                    Console.WriteLine("---National Address---");
                    Console.WriteLine("District:                       " + address.getDistrict());
                    Console.WriteLine("District (code):                " + address.getDistrictCode());
                    Console.WriteLine("Municipality:                   " + address.getMunicipality());
                    Console.WriteLine("Municipality (code):            " + address.getMunicipalityCode());
                    Console.WriteLine("Parish:                         " + address.getCivilParish());
                    Console.WriteLine("Parish (code):                  " + address.getCivilParishCode());
                    Console.WriteLine("Street Type (Abbreviated):      " + address.getAbbrStreetType());
                    Console.WriteLine("Street Type:                    " + address.getStreetType());
                    Console.WriteLine("Street Name:                    " + address.getStreetName());
                    Console.WriteLine("Building Type (Abbreviated):    " + address.getAbbrBuildingType());
                    Console.WriteLine("Building Type:                  " + address.getBuildingType());
                    Console.WriteLine("Door nº:                        " + address.getDoorNo());
                    Console.WriteLine("Floor:                          " + address.getFloor());
                    Console.WriteLine("Side:                           " + address.getSide());
                    Console.WriteLine("Locality:                       " + address.getLocality());
                    Console.WriteLine("Place:                          " + address.getPlace());
                    Console.WriteLine("Postal code:                    " + address.getZip4() + "-" + address.getZip3());
                    Console.WriteLine("Postal Locality:                " + address.getPostalLocality());
                }
                else
                {
                    Console.WriteLine("---Foreign Address---");
                    Console.WriteLine("Address:     " + address.getForeignAddress());
                    Console.WriteLine("City:        " + address.getForeignCity());
                    Console.WriteLine("Locality:    " + address.getForeignLocality());
                    Console.WriteLine("Postal Code: " + address.getForeignPostalCode());
                    Console.WriteLine("Region:      " + address.getForeignRegion());
                    Console.WriteLine("Country:     " + address.getForeignCountry());
                }
            }
        }
Пример #4
0
 /*
  * Prints main info present in the card (that doesn't need address pin)
  */
 public void ShowCardInfo()
 {
     Console.WriteLine("\n\nReading card details:");
     Console.WriteLine("Name:                       " + eid.getGivenName() + " " + eid.getSurname());
     Console.WriteLine("Card Type:                  " + eid.getDocumentType());
     Console.WriteLine("Card Version:               " + eid.getDocumentVersion());
     Console.WriteLine("Card Number:                " + eid.getDocumentNumber());
     Console.WriteLine("Local of Request:           " + eid.getLocalofRequest());
     Console.WriteLine("Issuing Entity:             " + eid.getIssuingEntity());
     Console.WriteLine("Issuing Date:               " + eid.getValidityBeginDate());
     Console.WriteLine("Validity End Date:          " + eid.getValidityEndDate());
     Console.WriteLine("PAN Number:                 " + eid.getDocumentPAN());
     Console.WriteLine("Civilian ID :               " + eid.getCivilianIdNumber());
     Console.WriteLine("Tax ID:                     " + eid.getTaxNo());
     Console.WriteLine("Social Security ID:         " + eid.getSocialSecurityNumber());
     Console.WriteLine("Health ID:                  " + eid.getHealthNumber());
     Console.WriteLine("Parents:                    " + eid.getParents());
     Console.WriteLine("Father:                     " + eid.getGivenNameFather() + " " + eid.getSurnameFather());
     Console.WriteLine("Mother:                     " + eid.getGivenNameMother() + " " + eid.getSurnameMother());
     Console.WriteLine("Indications:                " + eid.getAccidentalIndications());
     Console.WriteLine("Nationality:                " + eid.getNationality());
     Console.WriteLine("Country:                    " + eid.getCountry());
     Console.WriteLine("Date of birth:              " + eid.getDateOfBirth());
     Console.WriteLine("Height:                     " + eid.getHeight());
     Console.WriteLine("Gender:                     " + eid.getGender());
     Console.WriteLine("MRZ (Machine Readable Zone): " + eid.getMRZ1());
     Console.WriteLine("                             " + eid.getMRZ2());
     Console.WriteLine("                             " + eid.getMRZ3());
 }
Пример #5
0
 internal PTEID_ID(PTEID_EId id)
 {
     try {
         version = 0;
         deliveryEntity = id.getIssuingEntity();
         country = id.getCountry();
         documentType = id.getDocumentType();
         cardNumber = id.getDocumentNumber();
         cardNumberPAN = id.getDocumentPAN();
         cardVersion = id.getDocumentVersion();
         deliveryDate = id.getValidityBeginDate();
         locale = id.getLocalofRequest();
         validityDate = id.getValidityEndDate();
         name = id.getSurname();
         firstname = id.getGivenName();
         sex = id.getGender();
         nationality = id.getNationality();
         birthDate = id.getDateOfBirth();
         height = id.getHeight();
         numBI = id.getCivilianIdNumber();
         nameFather = id.getSurnameFather();
         firstnameFather = id.getGivenNameFather();
         nameMother = id.getSurnameMother();
         firstnameMother = id.getGivenNameMother();
         numNIF = id.getTaxNo();
         numSS = id.getSocialSecurityNumber();
         numSNS = id.getHealthNumber();
         notes = id.getAccidentalIndications();
         mrz1 = id.getMRZ1();
         mrz2 = id.getMRZ2();
         mrz3 = id.getMRZ3();
     } catch (Exception) {
         throw new PteidException(0);
     }
 }