Beispiel #1
0
        private BiometricsInformationRecord ToBiometricsInformationRecordFromString(string value)
        {
            BiometricsInformationRecord Result = null;

            if ((!string.IsNullOrEmpty(value)) && (value.Length >= 45))
            {
                byte[]       array         = InteropCommon.ToByteArrayFromString(value, _binaryConversion);
                int          BDBLength     = BitConverter.ToInt32(array, 0) - 45;
                Version      headerVersion = new Version((int)array[4], 0);
                BirDataTypes bdt           = (BirDataTypes)InteropEnum <BirDataTypes> .ToEnumFromInteger((int)array[5]);

                int        formatIDOwner = BitConverter.ToUInt16(array, 7);
                int        formatIDType  = BitConverter.ToUInt16(array, 9);
                BirPurpose BIRPurpose    = (BirPurpose)InteropEnum <BirPurpose> .ToEnumFromInteger((int)array[11]);

                int        biometricTypeInteger = BitConverter.ToInt32(array, 12);
                SensorType biometricType        = (SensorType)InteropEnum <SensorType> .ToEnumFromInteger(biometricTypeInteger);

                byte[] bdb = null;
                if (BDBLength > 0)
                {
                    bdb = new byte[BDBLength];
                    Array.Copy(array, 45, bdb, 0, BDBLength);
                }
                Result = new BiometricsInformationRecord(headerVersion, bdt, formatIDOwner, formatIDType, BIRPurpose, biometricType, bdb);
            }

            return(Result);
        }
Beispiel #2
0
        public override BiometricsInformationRecord ProcessPrematchData(BiometricsInformationRecord sampleBir, BiometricsInformationRecord prematchDataBir)
        {
            string ProcessedBIR = "";

            VerifyResult(_cco.ProcessPrematchData(InteropCommon.ToStringFromByteArray(ToByteArrayFromBiometricsInformationRecord(sampleBir), _binaryConversion), InteropCommon.ToStringFromByteArray(ToByteArrayFromBiometricsInformationRecord(prematchDataBir), _binaryConversion), ProcessedBIR));
            return(ToBiometricsInformationRecordFromString(ProcessedBIR));
        }
Beispiel #3
0
 public StoredBir(string name, string finger, string serviceObject, BiometricsInformationRecord bir)
     : base(bir)
 {
     _name          = name;
     _finger        = finger;
     _ServiceObject = serviceObject;
 }
Beispiel #4
0
 private void AddBir(string userName, string finger, string serviceObject, BiometricsInformationRecord bir)
 {
     try
     {
         StoredBir sb = new StoredBir(userName, finger, serviceObject, bir);
         Birs.Add(sb);
         lbBirs.Items.Add(sb);
         SaveBirs();
     }
     catch (Exception ae)
     {
         ShowException(ae);
     }
 }
Beispiel #5
0
        public override BiometricsVerifyResult VerifyMatch(int maximumFalseAcceptRateRequested, int maximumFalseRejectRateRequested, bool falseAcceptRatePrecedence, BiometricsInformationRecord sampleBir, BiometricsInformationRecord referenceBir, bool adaptBir)
        {
            string AdaptedBIRString = adaptBir ? "" : null;

            int[] CandidateRanking = new int[1] {
                0
            };
            bool   Result      = false;
            int    FARArchived = 0;
            int    FRRArchived = 0;
            string Payload     = "";

            VerifyResult(_cco.VerifyMatch(maximumFalseAcceptRateRequested, maximumFalseRejectRateRequested, falseAcceptRatePrecedence, InteropCommon.ToStringFromByteArray(ToByteArrayFromBiometricsInformationRecord(sampleBir), _binaryConversion), InteropCommon.ToStringFromByteArray(ToByteArrayFromBiometricsInformationRecord(referenceBir), _binaryConversion), AdaptedBIRString, Result, FARArchived, FRRArchived, Payload));
            BiometricsInformationRecord AdaptedBIR = null;

            if (adaptBir && !string.IsNullOrEmpty(AdaptedBIRString))
            {
                AdaptedBIR = ToBiometricsInformationRecordFromString(AdaptedBIRString);
            }

            return(new BiometricsVerifyResult(Result, FARArchived, FRRArchived, AdaptedBIR, InteropCommon.ToByteArrayFromString(Payload, _binaryConversion)));
        }
Beispiel #6
0
        private byte[] ToByteArrayFromBiometricsInformationRecord(BiometricsInformationRecord value)
        {
            if (value == null)
            {
                return(null);
            }

            byte[] Result = null;

            try
            {
                int length = value.BiometricDataBlockSize + 45;
                Result = new byte[length];
                Array.Clear(Result, 0, length);
                byte[] work = BitConverter.GetBytes(length);
                Array.Copy(work, Result, 4);
                Result[4]  = (byte)value.Version.Major;
                Result[5]  = (byte)(int)value.DataType;
                work       = BitConverter.GetBytes(value.FormatOwner);
                Result[6]  = work[0];
                Result[7]  = work[1];
                work       = BitConverter.GetBytes(value.FormatId);
                Result[8]  = work[0];
                Result[9]  = work[1];
                Result[11] = (byte)(int)value.Purpose;
                work       = BitConverter.GetBytes((int)value.SensorType);
                Array.Copy(work, 0, Result, 12, 4);
                if (value.BiometricDataBlockSize > 0)
                {
                    Array.Copy(value.GetBiometricDataBlock(), 0, Result, 45, value.BiometricDataBlockSize);
                }
            }
            catch
            {
                Result = null;
            }

            return(Result);
        }
Beispiel #7
0
 public override int[] IdentifyMatch(int maximumFalseAcceptRateRequested, int maximumFalseRejectRateRequested, bool falseAcceptRatePrecedence, BiometricsInformationRecord sampleBir, IEnumerable <BiometricsInformationRecord> referenceBirPopulation)
 {
     string[] ReferenceBIRPopulation = ToStringArrayFromBiometricsInformationRecords(referenceBirPopulation);
     int[]    CandidateRanking       = new int[1] {
         0
     };
     VerifyResult(_cco.IdentifyMatch(maximumFalseAcceptRateRequested, maximumFalseRejectRateRequested, falseAcceptRatePrecedence, InteropCommon.ToStringFromByteArray(ToByteArrayFromBiometricsInformationRecord(sampleBir), _binaryConversion), ReferenceBIRPopulation, CandidateRanking));
     return(CandidateRanking);
 }
Beispiel #8
0
 public override void BeginEnrollCapture(BiometricsInformationRecord referenceBir, byte[] payload)
 {
     VerifyResult(_cco.BeginEnrollCapture(InteropCommon.ToStringFromByteArray(ToByteArrayFromBiometricsInformationRecord(referenceBir), _binaryConversion), InteropCommon.ToStringFromByteArray(payload, _binaryConversion)));
 }
 private void AddBir(string userName, string finger, string serviceObject, BiometricsInformationRecord bir)
 {
     try
     {
         StoredBir sb = new StoredBir(userName, finger, serviceObject, bir);
         Birs.Add(sb);
         lbBirs.Items.Add(sb);
         SaveBirs();
     }
     catch (Exception ae)
     {
         ShowException(ae);
     }
 }
Beispiel #10
0
 public StoredBir(string name, string finger, string serviceObject, BiometricsInformationRecord bir)
     : base(bir)
 {
     _name = name;
     _finger = finger;
     _ServiceObject = serviceObject;
 }