Interface BioMatcher
-
- All Known Subinterfaces:
OwnerBioMatcher,SharedBioMatcher
public interface BioMatcherTheBioMatcherinterface is the base interface for biometric matching. It provides the user interface for accessing biometric functionality.
Several Biometric Template Data containers (BioTemplateData) can be enrolled in the sameBioMatcher.BioMatcheris supporting both 1 to 1 matching and 1 to N matching when NBioTemplateDatainstances are enrolled.- Since:
- 3.0.5
-
-
Field Summary
Fields Modifier and Type Field Description static shortMATCH_NEEDS_MORE_DATAThis negative score value indicates that more data are needed to continue the matching session.static shortMINIMUM_SUCCESSFUL_MATCH_SCOREThe minimum successful matching score.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BioTemplateDatagetBioTemplateData(short index)Get theBioTemplateDataenrolled at the specified index.bytegetBioType()Gets the biometric type.shortgetIndexOfLastMatchingBioTemplateData()Gets the index of the last matchingBioTemplateData.shortgetMaxNbOfBioTemplateData()Gets the maximum number ofBioTemplateDatathat can be enrolled in thisBioMatcher.bytegetTriesRemaining()Gets the number of times remaining that an incorrect candidate can be presented before theBioMatcheris blocked.shortgetVersion(byte[] dest, short offset)Gets the matching algorithm version and ID.shortinitMatch(byte[] candidate, short offset, short length)Initialize or re-initialize a biometric matching session.booleanisInitialized()Indicates whether thisBioMatcherhas been loaded with at least oneBioTemplateDataand is ready for matching functions.booleanisValidated()Indicates whether a matching session was successfully since the last card reset or last call toreset().shortmatch(byte[] candidate, short offset, short length)Continues a biometric matching session.voidreset()Resets thevalidatedflag associated with thisBioMatcher.
-
-
-
Field Detail
-
MINIMUM_SUCCESSFUL_MATCH_SCORE
static final short MINIMUM_SUCCESSFUL_MATCH_SCORE
The minimum successful matching score.- See Also:
- Constant Field Values
-
MATCH_NEEDS_MORE_DATA
static final short MATCH_NEEDS_MORE_DATA
This negative score value indicates that more data are needed to continue the matching session.- See Also:
- Constant Field Values
-
-
Method Detail
-
isInitialized
boolean isInitialized()
Indicates whether thisBioMatcherhas been loaded with at least oneBioTemplateDataand is ready for matching functions. This is independent of whether or not the match process has been initialized (seeinitMatch).- Returns:
trueif initialized,falseotherwise.
-
isValidated
boolean isValidated()
Indicates whether a matching session was successfully since the last card reset or last call toreset().In addition to returning a
booleanresult, platform-implementations of this method set the result in an internal state which can be rechecked using assertion methods of theSensitiveResultclass, if supported by the platform.- Returns:
trueif validated,falseotherwise.
-
reset
void reset()
Resets thevalidatedflag associated with thisBioMatcher. This could be appropriate as a last action after an access is completed.
-
getTriesRemaining
byte getTriesRemaining()
Gets the number of times remaining that an incorrect candidate can be presented before theBioMatcheris blocked.In addition to returning a
byteresult, platform-implementations of this method set the result in an internal state which can be rechecked using assertion methods of theSensitiveResultclass, if supported by the platform.- Returns:
- the number of tries remaining.
- Throws:
Bio1toNException- with the following reason codes:Bio1toNException.NO_BIO_TEMPLATE_ENROLLEDif noBioTemplateDatahas been enrolled.
-
getBioType
byte getBioType()
Gets the biometric type. Valid types are described inBio1toNBuilder.- Returns:
- the biometric general type.
-
getVersion
short getVersion(byte[] dest, short offset)Gets the matching algorithm version and ID.- Parameters:
dest- destination byte array.offset- starting offset within the destination byte array.- Returns:
- the number of bytes written in the destination byte array.
-
initMatch
short initMatch(byte[] candidate, short offset, short length) throws Bio1toNExceptionInitialize or re-initialize a biometric matching session. If thisBioMatcheris not blocked, a matching session starts and, before any other processing, thevalidatedflag is reset, the internal match state is set toMATCH_NEEDS_MORE_DATA, and the try counter is decremented. If the try counter has reached zero, the thisBioMatcheris blocked. This method results in one of the following:- The matching session ends with success state if at least one of the
BioTemplateDataenrolled with thisBioMatcheris matching. The validated flag is set and the try counter is reset to its maximum. - The matching session ends with failed state if none of the
BioTemplateDataenrolled with thisBioMatcheris matching or if an exception is thrown during the match. The validated flag remains in the reset state. - The matching session continues if the matching needs more data. The
matchmethod has to be called to continue the matching session.
If this
BioMatcheris blocked, no matching session starts.Notes:
- A correct matching sequence is :
initMatch,[match]. CallinginitMatchis mandatory, callingmatchis optional. - If a matching session is in progress (case needs more data), a call to
initMatchmakes the current session to be discarded and starts a new matching session. - Even if a transaction is in progress, internal state such as the try counter, the validated flag and the blocking state must not be conditionally updated.
- The matching session must ignore any enrolled
BioTemplateDatathat is uninitialized.
In addition to returning a
shortresult, platform-implementations of this method set the result in an internal state which can be rechecked using assertion methods of theSensitiveResultclass, if supported by the platform.
The following code sample illustrates the use ofSensitiveResult:try { short matchResult = bioMatcher.initMatch( ...); SensitiveResult.assertEquals(matchResult); // recheck for security while (matchResult == MATCH_NEEDS_MORE_DATA) { matchResult = bioMatcher.match(...); } SensitiveResult.assertEquals(matchResult); // recheck for security if ((matchResult >= MINIMUM_SUCCESSFUL_MATCH_SCORE) { // grant service - user authenticated } else { // deny service - Bio Template mismatch } } finally { SensitiveResult.reset(); }- Parameters:
candidate- the data or part of the data of the candidate.offset- the starting offset into the candidate array where the candidate data is to be found.length- the number of bytes to be taken from the candidate array.- Returns:
- the matching score with the following meaning :
- >=
MINIMUM_SUCCESSFUL_MATCH_SCORE: the matching session is successful. - >= 0 and <
MINIMUM_SUCCESSFUL_MATCH_SCORE: the matching session has failed. - =
MATCH_NEEDS_MORE_DATA: the matching session needs more data.
- >=
- Throws:
Bio1toNException- with the following reason codes:Bio1toNException.INVALID_DATAif the submitted candidate data does not have the required format.Bio1toNException.NO_BIO_TEMPLATE_ENROLLEDif noBioTemplateDatahas been enrolled or none of the enrolledBioTemplateDatais initialized.
- The matching session ends with success state if at least one of the
-
match
short match(byte[] candidate, short offset, short length) throws Bio1toNExceptionContinues a biometric matching session. The exact return score value is implementation dependent and can be used, for example, to code a confidence rate. If a matching session is in progress, this method results in one of the following:- The matching session ends with success state if at least one of the
BioTemplateDataenrolled in thisBioMatchermatches. The validated flag is set and the try counter is reset to its maximum. - The matching session ends with failed state if none of the
BioTemplateDataenrolled in thisBioMatcheris matching or if an exception is thrown during the match. - The matching session continues if the matching needs more data. The
matchmethod has to be called to continue the matching session.
- A correct matching sequence is:
initMatch,[match]. CallinginitMatchis mandatory, callingmatchis optional. - Even if a transaction is in progress, internal state such as the try counter, the validated flag and the blocking state must not be conditionally updated.
- The matching session must ignore any enrolled
BioTemplateDatathat is uninitialized.
In addition to returning a
shortresult, platform-implementations of this method set the result in an internal state which can be rechecked using assertion methods of theSensitiveResultclass, if supported by the platform.
The following code sample illustrates the use ofSensitiveResult:try { short matchResult = bioMatcher.initMatch( ...); SensitiveResult.assertEquals(matchResult); // recheck for security while (matchResult == MATCH_NEEDS_MORE_DATA) { matchResult = bioMatcher.match(...); } SensitiveResult.assertEquals(matchResult); // recheck for security if ((matchResult >= MINIMUM_SUCCESSFUL_MATCH_SCORE) { // grant service - user authenticated } else { // deny service - Bio Template mismatch } } finally { SensitiveResult.reset(); }- Parameters:
candidate- the data or part of the data of the candidate.offset- the starting offset into the candidate array where the candidate data is to be found.length- number of bytes to be taken from the candidate array.- Returns:
- the matching score with the following meaning :
- >=
MINIMUM_SUCCESSFUL_MATCH_SCORE: the matching session is successful. - >= 0 and <
MINIMUM_SUCCESSFUL_MATCH_SCORE: the matching session has failed. - =
MATCH_NEEDS_MORE_DATA: the matching session needs more data.
- >=
- Throws:
Bio1toNException- with the following reason codes:Bio1toNException.ILLEGAL_USEif used outside a matching session.Bio1toNException.INVALID_DATAif the submitted candidate data does not have the required format.Bio1toNException.NO_BIO_TEMPLATE_ENROLLEDif noBioTemplateDatahave been enrolled or none of the enrolledBioTemplateDatais initialized.
- The matching session ends with success state if at least one of the
-
getMaxNbOfBioTemplateData
short getMaxNbOfBioTemplateData()
Gets the maximum number ofBioTemplateDatathat can be enrolled in thisBioMatcher.- Returns:
- the maximum number of
BioTemplateDatathat can be enrolled.
-
getIndexOfLastMatchingBioTemplateData
short getIndexOfLastMatchingBioTemplateData()
Gets the index of the last matchingBioTemplateData.Note: indexing starts at value "1" ("0" is an invalid value).
- Returns:
- the index of the last matching
BioTemplateData. - Throws:
Bio1toNException- with the following reason codes:Bio1toNException.ILLEGAL_USEif no successful match occurred since last reset.
-
getBioTemplateData
BioTemplateData getBioTemplateData(short index)
Get theBioTemplateDataenrolled at the specified index. This method is used to retrieve theBioTemplateDatafor readonly use.Note: indexing starts at value "1" ("0" is an invalid value).
- Parameters:
index- the index of theBioTemplateDatato retrieve.- Returns:
nullif noBioTemplateDatais available at the specified index.
-
-