Class BiometricsProperties

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
de.gmxhome.conrad.jpos.jpos_base.biometrics.BiometricsProperties
All Implemented Interfaces:
BiometricsInterface, JposBaseInterface

public class BiometricsProperties extends JposCommonProperties implements BiometricsInterface
Class containing the biometrics specific properties, their default values and default implementations of BiometricsInterface. For details about properties, methods and method parameters, see UPOS specification, chapter Biometrics.
  • Field Details

    • CapPrematchData

      public boolean CapPrematchData
      UPOS property CapPrematchData. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapRawSensorData

      public boolean CapRawSensorData
      UPOS property CapRawSensorData. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapRealTimeData

      public boolean CapRealTimeData
      UPOS property CapRealTimeData. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapSensorColor

      public int CapSensorColor
      UPOS property CapSensorColor. Default: CSC_MONO. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapSensorOrientation

      public int CapSensorOrientation
      UPOS property CapSensorOrientation. Default: CSO_NORMAL. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapSensorTypeDef

      public int CapSensorTypeDef
      Default value of CapSensorType property. Default: CST_PASSWORD. Should be updated before calling initOnEnable the first time.
    • CapSensorType

      public Integer CapSensorType
      UPOS property CapSensorType. Default: null. Must be overwritten by objects derived from JposDevice at least when the device is enabled the first time.
    • CapTemplateAdaptation

      public boolean CapTemplateAdaptation
      UPOS property CapTemplateAdaptation. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • AlgorithmDef

      public int AlgorithmDef
      Default value of Algorithm property. Default: 0. Should be updated before calling initOnClaim the first time.
    • Algorithm

      public Integer Algorithm
      UPOS property Algorithm. Default: null. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • AlgorithmList

      public String AlgorithmList
      UPOS property AlgorithmList. Default: "". Should be overwritten by objects derived from JposDevice within the changeDefaults method.
    • BIR

      public byte[] BIR
      UPOS property BIR. Default: null.
    • RawSensorData

      public byte[] RawSensorData
      UPOS property RawSensorData. Default: null.
    • RealTimeDataEnabled

      public boolean RealTimeDataEnabled
      UPOS property RealTimeDataEnabled. Set to false in initOnOpen method..
    • SensorBPP

      public Integer SensorBPP
      UPOS property SensorBPP. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults method.
    • SensorColor

      public int SensorColor
      UPOS property SensorColor. Default: SC_MONO. Can be overwritten by objects derived from JposDevice within the changeDefaults method, must be overwritten if CapSensorColor does not contain CSC_MONO.
    • SensorHeight

      public Integer SensorHeight
      UPOS property SensorHeight. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults method.
    • SensorOrientationDef

      public int SensorOrientationDef
      Default value of SensorOrientation property. Default: SC_MONO. Should be updated before calling initOnClaim the first time. Must be overwritten if CapSensorOrientation does not contain CSO_NORMAL.
    • SensorOrientation

      public Integer SensorOrientation
      UPOS property SensorOrientation.
    • SensorTypeDef

      public Integer SensorTypeDef
      Default value of SensorType property. Default: null. Must be overwritten before any call to method initOnClaim.
    • SensorType

      public Integer SensorType
      UPOS property SensorType. Default: null. Must be overwritten by objects derived from JposDevice at least when the device is enabled the first time.
    • SensorWidth

      public Integer SensorWidth
      UPOS property SensorWidth. Default: null. Must be overwritten by objects derived from JposDevice within the changeDefaults method.
  • Constructor Details

    • BiometricsProperties

      protected BiometricsProperties(int dev)
      Constructor.
      Parameters:
      dev - Device index
  • Method Details

    • initOnOpen

      public void initOnOpen()
      Description copied from class: JposCommonProperties
      Initialization of properties that must be initialized during open.
      Overrides:
      initOnOpen in class JposCommonProperties
    • initOnClaim

      public void initOnClaim()
      Description copied from class: JposCommonProperties
      Initialize properties that must be initialized whenever the device will be claimed.
      Overrides:
      initOnClaim in class JposCommonProperties
    • initOnFirstEnable

      public boolean initOnFirstEnable()
      Description copied from class: JposCommonProperties
      Initialize properties that must be initialized whenever the device will be enabled the first time-
      Overrides:
      initOnFirstEnable in class JposCommonProperties
      Returns:
      Returns true in case of first enable.
    • algorithm

      public void algorithm(int newAlgorithm) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of setting Algorithm. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is claimed,
      • Device is not enabled,
      • newAlgorithm is between 0 and the number of algorithms specified in AlgorithmList.
      Specified by:
      algorithm in interface BiometricsInterface
      Parameters:
      newAlgorithm - New value for Algorithm property.
      Throws:
      jpos.JposException - If an error occurs.
    • realTimeDataEnabled

      public void realTimeDataEnabled(boolean newRealTimeDataEnabled) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of setting RealTimeDataEnabled. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • CapRealTimeData is true or newRealTimeData is false,
      • internal property AllowAlwaysSetProperties is true or newRealTimeDataEnabled equals the previous value of RealTimeDataEnabled.
      Specified by:
      realTimeDataEnabled in interface BiometricsInterface
      Parameters:
      newRealTimeDataEnabled - New value for RealTimeDataEnabled property.
      Throws:
      jpos.JposException - If an error occurs.
    • sensorColor

      public void sensorColor(int newSensorColor) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of setting SensorColor. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is open,
      • newSensorColor is one of SC_MONO, SC_GRAYSCALE, SC_16, SC_256 or SC_FULL,
      • the corresponding bit in CapSensorColor is set,
      • internal property AllowAlwaysSetProperties is true or newSensorColor equals the previous value of SensorColor.
      Specified by:
      sensorColor in interface BiometricsInterface
      Parameters:
      newSensorColor - New value for SensorColor property.
      Throws:
      jpos.JposException - If an error occurs.
    • sensorOrientation

      public void sensorOrientation(int newSensorOrientation) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of setting SensorOrientation. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is claimed,
      • Device is not enabled,
      • newSensorOrientation is one of SO_NORMAL, SO_RIGHT, SO_INVERTED or SO_LEFT,
      • the corresponding bit in CapSensorOrientation is set.
      Specified by:
      sensorOrientation in interface BiometricsInterface
      Parameters:
      newSensorOrientation - New value for SensorOrientation property.
      Throws:
      jpos.JposException - If an error occurs.
    • sensorType

      public void sensorType(int newSensorType) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of setting SensorType. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • newSensorType is one of ST_FACIAL_FEATURES, ST_VOICE, ST_FINGERPRINT, ST_IRIS, ST_RETINA, ST_HAND_GEOMETRY, ST_SIGNATURE_DYNAMICS, ST_KEYSTROKE_DYNAMICS, ST_LIP_MOVEMENT, ST_THERMAL_FACE_IMAGE, ST_THERMAL_HAND_IMAGE, ST_GAIT or ST_PASSWORD,
      • the corresponding bit in CapSensorType is set.
      Specified by:
      sensorType in interface BiometricsInterface
      Parameters:
      newSensorType - New value for SensorType property.
      Throws:
      jpos.JposException - If an error occurs.
    • beginEnrollCapture

      public void beginEnrollCapture(byte[] referenceBIR, byte[] payload) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of BeginEnrollCapture method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • referenceBIR and payload are not null (null arguments will be passed as byte[0]),
      • CapTemplateAdaptation or isEmpty(referenceBIR, true) is true.
      Specified by:
      beginEnrollCapture in interface BiometricsInterface
      Parameters:
      referenceBIR - Optional BIR to be adapted (updated).
      payload - Data that will be stored by the BSP.
      Throws:
      jpos.JposException - If an error occurs.
    • beginVerifyCapture

      public void beginVerifyCapture() throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of BeginVerifyCapture method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      beginVerifyCapture in interface BiometricsInterface
      Throws:
      jpos.JposException - If an error occurs.
    • endCapture

      public void endCapture() throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of EndCapture method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      endCapture in interface BiometricsInterface
      Throws:
      jpos.JposException - If an error occurs.
    • identify

      public void identify(int maxFARRequested, int maxFRRRequested, boolean fARPrecedence, byte[][] referenceBIRPopulation, int[][] candidateRanking, int timeout) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of Identify method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • maxFARRequested and maxFRRRequested have been checked with checkFARorFRRLimit,
      • timeout is positive or FOREVER,
      • referenceBIRPopulation has a length > 0,
      • each referenceBIR in referenceBIRPopulation is valid (checkBIRPurpose(referenceBIR, null) is true),
      • candidateRanking is a valid reference (non-null int[1][]).
      Even if FAR and FRR are specified to be percentage values in the UPOS specification, the corresponding values have been specified as probability value in 1/Integer.MAX_VALUE units in the BioAPI.
      Specified by:
      identify in interface BiometricsInterface
      Parameters:
      maxFARRequested - The requested FAR criterion for successful verification.
      maxFRRRequested - The requested FRR criterion for successful verification.
      fARPrecedence - If both criteria are provided, this parameter indicates which takes precedence.
      referenceBIRPopulation - An array of BIRs against which the Identify match is performed.
      candidateRanking - Array reference of BIR indices from the referenceBIRPopulation listed in rank order.
      timeout - Timeout for successful biometric capture.
      Throws:
      jpos.JposException - If an error occurs.
    • identifyMatch

      public void identifyMatch(int maxFARRequested, int maxFRRRequested, boolean fARPrecedence, byte[] sampleBIR, byte[][] referenceBIRPopulation, int[][] candidateRanking) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of IdentifyMatch method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • maxFARRequested and maxFRRRequested have been checked with checkFARorFRRLimit,
      • sampleBIR is not empty (isDataEmpty(sampleBIR, true) is false),
      • referenceBIRPopulation has a length > 0,
      • each referenceBIR in referenceBIRPopulation is valid (checkBIRPurpose(referenceBIR, null) is true),
      • candidateRanking is a valid reference (non-null int[1][]).
      Specified by:
      identifyMatch in interface BiometricsInterface
      Parameters:
      maxFARRequested - The requested FAR criterion for successful verification.
      maxFRRRequested - The requested FRR criterion for successful verification.
      fARPrecedence - If both criteria are provided, this parameter indicates which takes precedence.
      sampleBIR - The BIR to be identified.
      referenceBIRPopulation - An array of BIRs against which the Identify match is performed.
      candidateRanking - Array reference of BIR indices from the referenceBIRPopulation listed in rank order.
      Throws:
      jpos.JposException - If an error occurs.
    • processPrematchData

      public void processPrematchData(byte[] sampleBIR, byte[] prematchDataBIR, byte[][] processedBIR) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of ProcessPrematchData method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • sampleBIR and prematchDataBIR are not empty (isEmpty(sampleBIR, true) and isEmpty(prematchDataBIR, true) are false),
      • processedBIR is a valid reference (non-null byte[1][]),
      • CapPrematchData is true.
      Specified by:
      processPrematchData in interface BiometricsInterface
      Parameters:
      sampleBIR - BIR to be processed.
      prematchDataBIR - BIR containing prematch data.
      processedBIR - Reference for the new constructed BIR.
      Throws:
      jpos.JposException - If an error occurs.
    • verify

      public void verify(int maxFARRequested, int maxFRRRequested, boolean fARPrecedence, byte[] referenceBIR, byte[][] adaptedBIR, boolean[] result, int[] fARAchieved, int[] fRRAchieved, byte[][] payload, int timeout) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of Verify method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • maxFARRequested and maxFRRRequested have been checked with checkFARorFRRLimit,
      • timeout is positive or FOREVER,
      • referenceBIR is valid (checkBIRPurpose(referenceBIR, null) is true),
      • adaptedBIR is a valid reference (non-null byte[1][]),
      • result is a valid reference (non-null boolean[1]),
      • fARAchieved and fRRAchieved are a valid references (non-null int[1]),
      • payload is a valid reference (non-null byte[1][]),
      • adaptedBIR is a valid reference (non-null byte[1][]),
      • candidateRanking is a valid reference (non-null int[1][]).
      Specified by:
      verify in interface BiometricsInterface
      Parameters:
      maxFARRequested - The requested FAR criterion for successful verification.
      maxFRRRequested - The requested FRR criterion for successful verification.
      fARPrecedence - If both criteria are provided, this parameter indicates which takes precedence.
      referenceBIR - The BIR to be verified against.
      adaptedBIR - Reference of the adapted BIR.
      result - Reference of the result.
      fARAchieved - Reference to FAR Value indicating the closeness of the match.
      fRRAchieved - Reference to FRR Value indicating the closeness of the match.
      payload - Reference to optional payload.
      timeout - Timeout for successful verification.
      Throws:
      jpos.JposException - If an error occurs.
    • verifyMatch

      public void verifyMatch(int maxFARRequested, int maxFRRRequested, boolean fARPrecedence, byte[] sampleBIR, byte[] referenceBIR, byte[][] adaptedBIR, boolean[] result, int[] fARAchieved, int[] fRRAchieved, byte[][] payload) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Final part of VerifyMatch method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • maxFARRequested and maxFRRRequested have been checked with checkFARorFRRLimit,
      • timeout is positive or FOREVER,
      • sampleBIR is not empty (isDataEmpty(sampleBIR, true) is false),
      • referenceBIR is valid (checkBIRPurpose(referenceBIR, null) is true),
      • adaptedBIR is a valid reference (non-null byte[1][]),
      • result is a valid reference (non-null boolean[1]),
      • fARAchieved and fRRAchieved are a valid references (non-null int[1]),
      • payload is a valid reference (non-null byte[1][]),
      • adaptedBIR is a valid reference (non-null byte[1][]),
      • candidateRanking is a valid reference (non-null int[1][]).
      Specified by:
      verifyMatch in interface BiometricsInterface
      Parameters:
      maxFARRequested - The requested FAR criterion for successful verification.
      maxFRRRequested - The requested FRR criterion for successful verification.
      fARPrecedence - If both criteria are provided, this parameter indicates which takes precedence.
      sampleBIR - The BIR to be identified.
      referenceBIR - The BIR to be verified against.
      adaptedBIR - Reference of the adapted BIR.
      result - Reference of the result.
      fARAchieved - Reference to FAR Value indicating the closeness of the match.
      fRRAchieved - Reference to FRR Value indicating the closeness of the match.
      payload - Reference to optional payload.
      Throws:
      jpos.JposException - If an error occurs.
    • checkFARorFRRLimit

      public void checkFARorFRRLimit(int limit, String name) throws jpos.JposException
      Description copied from interface: BiometricsInterface
      Checks whether a FAR or FRR limit is valid. Negative FAR or FRR limits are invalid. Depending on the interpretation of FAR and FRR values as specified in the UPOS specification (percentage values) or as used in the BioAPI reference implementation (probability in units of 1/Integer.MAX_VALUE), it can be necessary to override this method within the implementation class. The default implementation is interpretation as specified in UPOS specification, throwing a JposException if limit is less than zero or greater than 100 (percentage values).
      Specified by:
      checkFARorFRRLimit in interface BiometricsInterface
      Parameters:
      limit - FAR or FRR limit to be checked.
      name - limit name (maxFARRequested or maxFRRRequested).
      Throws:
      jpos.JposException - If limit is out of range, at least if negative.
    • checkBIRPurpose

      public boolean checkBIRPurpose(byte[] bir, Boolean verify)
      Description copied from interface: BiometricsInterface
      Checks if a BIR is valid for a given purpose.
      Specified by:
      checkBIRPurpose in interface BiometricsInterface
      Parameters:
      bir - The BIR to be checked.
      verify - Must be set to true to check for validity for verification, to false for validity check for identification or to null for validity check for use as reference BIR.
      Returns:
      true if the BIR is valid for the specified purpose, false otherwise.
    • isDataEmpty

      public boolean isDataEmpty(byte[] data, boolean isBIR)
      Description copied from interface: BiometricsInterface
      Checks whether a given BIR or payload is empty. In the default implementation, empty means the given data is null or all bytes of data are zero. In addition, if isBIR is true, data is also empty if data.length is not greater than the BIR header length (16) or the Length field of the BIR is equal to the header length.
      Specified by:
      isDataEmpty in interface BiometricsInterface
      Parameters:
      data - The BIR or payload to be checked.
      isBIR - True in case of a BIR, false for payload value.
      Returns:
      true if data is empty, false otherwise.