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)); }
public override byte[] RetrieveDeviceAuthenticationData() { string Result = ""; VerifyResult(_cco.RetrieveDeviceAuthenticationData(ref Result)); return(InteropCommon.ToByteArrayFromString(Result, _binaryConversion)); }
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); }
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)); }
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))); }