Exemplo n.º 1
0
        public override void LockTag(byte[] tagId, int timeout, byte[] password)
        {
            string sTagID    = InteropCommon.ToStringFromByteArray(tagId, _binaryConversion);
            string sPassword = InteropCommon.ToStringFromByteArray(password, _binaryConversion);

            VerifyResult(_cco.LockTag(sTagID, timeout, sPassword));
        }
Exemplo n.º 2
0
        public override void WriteData(SmartCardWriteAction action, byte[] data)
        {
            int    iCount = data.GetLength(0);
            string sData  = InteropCommon.ToStringFromByteArray(data, _binaryConversion);

            VerifyResult(_cco.WriteData((int)action, iCount, sData));
        }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public override byte[] RetrieveDeviceAuthenticationData()
        {
            string Result = "";

            VerifyResult(_cco.RetrieveDeviceAuthenticationData(ref Result));
            return(InteropCommon.ToByteArrayFromString(Result, _binaryConversion));
        }
Exemplo n.º 6
0
        private string[] ToStringArrayFromBiometricsInformationRecords(IEnumerable <BiometricsInformationRecord> birPopulation)
        {
            if (birPopulation == null)
            {
                return(null);
            }

            string[] Result = null;

            try
            {
                List <string> BIRStringList = new List <string>();

                foreach (BiometricsInformationRecord BIR in birPopulation)
                {
                    string BIRString = InteropCommon.ToStringFromByteArray(ToByteArrayFromBiometricsInformationRecord(BIR), _binaryConversion);

                    if (!string.IsNullOrEmpty(BIRString))
                    {
                        BIRStringList.Add(BIRString);
                    }
                }

                if (BIRStringList.Count > 0)
                {
                    Result = BIRStringList.ToArray();
                }
            }
            catch
            {
                ;
            }

            return(Result);
        }
Exemplo n.º 7
0
        public override byte[] Read(int handle, int offset, int count)
        {
            var result = "";

            VerifyResult(_cco.Read(handle, out result, offset, count));
            return(InteropCommon.ToByteArrayFromString(result, _binaryConversion));
        }
Exemplo n.º 8
0
        public override byte[] ReadData(SmartCardReadAction action, byte[] data)
        {
            int    iCount = 0;
            string sData  = InteropCommon.ToStringFromByteArray(data, _binaryConversion);

            VerifyResult(_cco.ReadData((int)action, ref iCount, ref sData));
            return(InteropCommon.ToByteArrayFromString(sData, _binaryConversion));
        }
Exemplo n.º 9
0
        public override void WriteTagId(byte[] sourceTagId, byte[] destinationTagId, int timeout, byte[] password)
        {
            string sSourceID = InteropCommon.ToStringFromByteArray(sourceTagId, _binaryConversion);
            string sDestID   = InteropCommon.ToStringFromByteArray(destinationTagId, _binaryConversion);
            string sPassword = InteropCommon.ToStringFromByteArray(password, _binaryConversion);

            VerifyResult(_cco.WriteTagID(sSourceID, sDestID, timeout, sPassword));
        }
Exemplo n.º 10
0
        public override void WriteTagData(byte[] tagId, byte[] userData, int start, int timeout, byte[] password)
        {
            string sTagID    = InteropCommon.ToStringFromByteArray(tagId, _binaryConversion);
            string sUserData = InteropCommon.ToStringFromByteArray(userData, _binaryConversion);
            string sPassword = InteropCommon.ToStringFromByteArray(password, _binaryConversion);

            VerifyResult(_cco.WriteTagData(sTagID, sUserData, start, timeout, sPassword));
        }
Exemplo n.º 11
0
        public override void StartReadTags(RFIDReadOptions cmd, byte[] filterId, byte[] filterMask, int start, int length, byte[] password)
        {
            string sFilterID   = InteropCommon.ToStringFromByteArray(filterId, _binaryConversion);
            string sFilterMask = InteropCommon.ToStringFromByteArray(filterMask, _binaryConversion);
            string sPassword   = InteropCommon.ToStringFromByteArray(password, _binaryConversion);

            VerifyResult(_cco.StartReadTags((int)cmd, sFilterID, sFilterMask, start, length, sPassword));
        }
Exemplo n.º 12
0
        public override CashCounts ReadCashCounts()
        {
            string strCashCounts = "";
            bool   bDiscrepancy  = false;

            VerifyResult(_cco.ReadCashCounts(out strCashCounts, out bDiscrepancy));
            return(new CashCounts(InteropCommon.ToCashCountArray(strCashCounts), bDiscrepancy));
        }
Exemplo n.º 13
0
 public override void PrintMemoryBitmap(PrinterStation station, Bitmap data, int width, int alignment)
 {
     using (MemoryStream ms = new MemoryStream())
     {
         data.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
         string memorybitmap = InteropCommon.ToStringFromByteArray(ms.ToArray(), _binaryConversion);
         VerifyResult(_cco.PrintMemoryBitmap((int)station, memorybitmap, (int)OPOSPOSPrinterConstants.PTR_BMT_BMP, width, alignment));
     }
 }
Exemplo n.º 14
0
        public override void WriteTracks(byte[] track1Data, byte[] track2Data, byte[] track3Data, byte[] track4Data, int timeout)
        {
            List <string> TrackData = new List <string>();

            TrackData.Add(InteropCommon.ToStringFromByteArray(track1Data, _binaryConversion));
            TrackData.Add(InteropCommon.ToStringFromByteArray(track2Data, _binaryConversion));
            TrackData.Add(InteropCommon.ToStringFromByteArray(track3Data, _binaryConversion));
            TrackData.Add(InteropCommon.ToStringFromByteArray(track4Data, _binaryConversion));
            VerifyResult(_cco.WriteTracks(TrackData.ToArray(), timeout));
        }
Exemplo n.º 15
0
 public override void Write(int handle, byte[] data, int offset, int count)
 {
     VerifyResult(_cco.Write(handle, InteropCommon.ToStringFromByteArray(data, _binaryConversion), offset, count));
 }
Exemplo n.º 16
0
 public override void DispenseCash(IEnumerable <CashCount> cashCounts)
 {
     VerifyResult(_cco.DispenseCash(InteropCommon.ToCashCountsString(cashCounts)));
 }
Exemplo n.º 17
0
        public override void AdjustCashCounts(IEnumerable <CashCount> cashCounts)
        {
            string strCashCounts = InteropCommon.ToCashCountsString(cashCounts);

            VerifyResult(_cco.AdjustCashCounts(strCashCounts));
        }
Exemplo n.º 18
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)));
        }
Exemplo n.º 19
0
        public override void StopReadTags(byte[] password)
        {
            string sPassword = InteropCommon.ToStringFromByteArray(password, _binaryConversion);

            VerifyResult(_cco.StopReadTags(sPassword));
        }
Exemplo n.º 20
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);
 }
Exemplo n.º 21
0
 public override void BeginEnrollCapture(BiometricsInformationRecord referenceBir, byte[] payload)
 {
     VerifyResult(_cco.BeginEnrollCapture(InteropCommon.ToStringFromByteArray(ToByteArrayFromBiometricsInformationRecord(referenceBir), _binaryConversion), InteropCommon.ToStringFromByteArray(payload, _binaryConversion)));
 }
Exemplo n.º 22
0
        public override void DeauthenticateDevice(byte[] responseToken)
        {
            string sValue = InteropCommon.ToStringFromByteArray(responseToken, _binaryConversion);

            VerifyResult(_cco.DeauthenticateDevice(sValue));
        }
Exemplo n.º 23
0
 public override void UpdateStatistics(Statistic[] statistics)
 {
     VerifyResult(_cco.UpdateStatistics(InteropCommon.ToStatisticsString(statistics)));
 }
Exemplo n.º 24
0
 public override void DefineGlyph(int glyphCode, byte[] glyph)
 {
     VerifyResult(_cco.DefineGlyph(glyphCode, InteropCommon.ToStringFromByteArray(glyph, _binaryConversion)));
 }