API Digitalpersona PDF
API Digitalpersona PDF
API Digitalpersona PDF
Programmer’s Guide
Version 3.2.0
DigitalPersona, Inc.
© 2005 DigitalPersona, Inc. All Rights Reserved.
All intellectual property rights in the DigitalPersona software, firmware,
hardware and documentation included with or described in this Guide are owned
by DigitalPersona or its suppliers and are protected by United States copyright
laws, other applicable copyright laws, and international treaty provisions.
DigitalPersona and its suppliers retain all rights not expressly granted.
U.are.U®, DigitalPersona® and One Touch® are registered trademarks of
DigitalPersona, Inc.
Windows, Windows 2000, Windows 2003 and Windows XP are registered
trademarks of Microsoft Corporation. All other trademarks are property of their
respective owners.
This DigitalPersona Gold SDK for Java Programmer’s Guide and the software it
describes are furnished under license as set forth in the Installation Software
screen “License Agreement.” Except as permitted by such license, no part of this
document may be reproduced, stored, transmitted and translated, in any form
and by any means, without the prior written consent of DigitalPersona. The
contents of this manual are furnished for informational use only and are subject
to change without notice. Any mention of third-party companies and products is
for demonstration purposes only and constitutes neither an endorsement nor a
recommendation. DigitalPersona assumes no responsibility with regard to the
performance or use of these third-party products. DigitalPersona makes every
effort to ensure the accuracy of its documentation and assumes no responsibility
or liability for any errors or inaccuracies that may appear in it. This document is
subject to the DigitalPersona LIMITED WARRANTY and other general
provisions set forth in the Appendix of this manual.
Should you have any questions concerning this document, or if you need to
contact DigitalPersona for any other reason, write to:
DigitalPersona, Inc., 720 Bay Road, Suite 100, Redwood City, CA 94063 USA
Copyright i
ii Copyright
Table of Contents
1 Introduction 1
Requisite Knowledge 1
Other Support Resources 1
Typographic Conventions 2
Notational Conventions 2
Naming Conventions 3
Your Feedback Requested 3
2 API Overview 5
Getting Started with the Java SDK 5
Registration 6
Using the XTF Registration Template 7
Verification 8
Acquiring Templates 10
Template Matching 11
Template Searching 12
Priority Level 12
Fingerprint Scans 13
Deploying Applications Built with the Gold SDK 13
3 Appendix A: Java SDK API 15
Interface DpFpEventHandler 15
Fields 15
Methods 17
Class DpFpImage 17
Constructor 17
Methods 17
Class DpFpTemplate 17
Constructor 18
Methods 18
Class DpFpRegistration 18
Constructor 18
Methods 18
Class DpFpRegistrationException 19
Constructor 19
Requisite Knowledge
Any programmer using the DigitalPersona Gold SDK for Java must be
proficient in several areas of the Java programming language (version 1.2 or
higher); specifically, Java data types, event handling and exception handling.
Support Resources
In addition to this guide, the following resources are provided for additional
support to programmers using the DigitalPersona Gold SDK for Java:
• A Readme file is provided on the product CD, which contains last-minute
information about the product.
• The DigitalPersona Web site (http://www.digitalpersona.com) provides an
online technical support form in the Support section. You can describe your
issue and include your contact information and a technical support
representative will contact you by e-mail or phone.
• E-mail support is available at techsupport@digitalpersona.com.
• Phone support can be reached at (877) 378-2740 in the U.S. only.
Outside the U.S., call +1 650-474-4000.
Typographic Conventions
The following typographic conventions are used in this guide:
• Courier indicates text that is typed by the user.
Example:
“Type http://www.digitalpersona.com/ in the Address text box.”
You would only type “http://www.digitalpersona.com/” and would not type
any surrounding text.
• Text in Courier bold and surrounded by brackets [ ] indicates
information that is always supplied by you and will vary depending on a
particular circumstance.
Example:
“Type http://[your company web site URL]/ in the Address text
box.”
You would type “http://”, then type your company web site URL—not the
words “[your company web site URL]”—and then “/”.
It is also used to display information that is dynamically generated by
DigitalPersona Pro.
Notational Conventions
The following notational conventions are used in this guide to call attention to
information of special importance:
Note
A note highlights information that may help you better understand the text
and its concepts.
Warning
A warning advises you that failure to take or avoid a specific action could
result in your inability to complete the required tasks or will cause undesired
results in the use of the software or hardware.
Naming Conventions
For brevity and easier reading of this guide, the following naming conventions
are used to describe the DigitalPersona Gold SDK for Java and fingerprint
reader hardware:
• Gold SDK, Java SDK, and SDK sometimes replace the full name,
DigitalPersona Gold SDK for Java.
• Reader—in both upper and lower case—is always used without the
preceding U.are.U. It replaces the full product name, U.are.U Fingerprint
Reader.
Registration
Fingerprint registration is the process of acquiring four fingerprint scans and
deriving from them a template that can be compared with a fingerprint template
acquired during verification to determine if they came from the same finger.
This template—called a registration template—is created from four pre-
registration templates, derived from fingerprint scans of acceptable quality
acquired during the registration process.
At a minimum, a Java application implementing the registration process should
follow these behavior guidelines:
• When the registration process is initiated, the user should be prompted to
touch the fingerprint reader.
• The user should be given feedback on the quality of the acquired fingerprint
scan, indicating whether the scan is acceptable or not.
• The user should be prompted to place a finger on the reader until four
acceptable scans are acquired.
• When the registration template is created, the user should be notified that the
fingerprint is registered.
To add the fingerprint registration functionality to a Java application
1 In the Java application, create an instance of the Registration class:
Registration reg = new Registration();
2 Listen for events by passing the class performing the registration process to
an instance of the DpFpRegistration class using the setHandler method:
reg.setHandler(this);
this is any class that implements the DpFpEventHandler interface.
3 Begin the registration process by calling the register method of the
DpFpRegistration class:
reg.register();
There are several events fired during the registration process:
• EVT_WAITING_FOR_IMAGE, which you can use to prompt the user to touch
the reader.
Verification time when using the XTF template is on average 10% longer than
the basic registration. At the most, verification time with the XTF template can
be up to four times longer than the basic template.
The XTF template uses approximately four times more space than the basic
template when saved to a file or to a database. Developers who have already
created programs using the basic template and want to switch to the XTF
template must consider if the size increase will require more space allocated in
their existing databases.
Verification
In the verification process, a user touches the reader and a verification template
is created from the fingerprint scan. To prove user identity, the verification
template is compared with one or more registration templates (see
“Registration” on page 6) to determine if they are from the same finger.
A Java application implementing the verification process should follow these
behavior guidelines:
• When the verification process is initiated, the user should be prompted to
touch the reader with a registered fingerprint.
• If the fingerprint scan is acceptable, the Java application should load stored
registration templates and perform a verification.
• The user should then be informed of the match result. If a match is found, the
application can grant access to protected functions, data, etc.
To add verification functionality to a Java application
1 Load the data blob representing a fingerprint image and create a template:
DpFpTemplate regTemplate = new DpFpTemplate();
regTemplate.setData(blob);
2 Add the template to an array of DpFpTemplate[] objects by passing the
registration template data blob to an instance of DpFpTemplate using its
setData() method:
DpFpTemplate[] regTemplates = new DpFpTemplate[];
regTemplates[x] = regTemplate;
x is the array index number.
7 Then, using the getResult() method, you can determine whether there was a
match between a template in the array of registration templates and the
verification template. For example:
if (matchRes.getResult() == MatchResult.FT_SUCCESS)...
To cancel the verification operation, call the cancel method of the verification
object. When canceled, the EVT_VERIFICATION_CANCELED event is fired. If a
system error occurs during the verification operation, the
EVT_VERIFICATION_ERROR event is fired.
Acquiring Templates
In some cases, programmers will want to acquire templates without performing
the verification and registration operations.
To acquire templates without performing registration or verification
1 Create an instance of the DpFpTemplateAcquisition class:
DpFpTemplateAcquisition template =
new DpFpTemplateAcquisition();
2 Listen for template acquisition events by passing the class performing the
acquisition to an instance of the DpFpTemplateAcquisition class using the
setHandler method:
template.setHandler(this);
this is any class that implements the DpFpEventHandler interface and
contains an instance of the DpFpTemplateAcquisition class.
3 Begin the acquisition process by calling the acquireTemplate method of the
DpFpTemplateAcquisition class:
template.acquireTemplate();
There are several events fired during the verification process:
• EVT_WAITING_FOR_IMAGE, which you can use to prompt the user to touch
the reader.
• EVT_FINGER_TOUCHING, when the user places a finger on the reader. In the
event handler for this event, you can, for example, play a sound or display a
message instructing the user to remove the finger.
Template Matching
With the DigitalPersona Gold SDK for Java, programmers can match templates
outside of the fingerprint verification operation (as described in “Verification”
on page 8).
To match a verification template to a registration template(s)
1 Load each data blob representing a registration template and create a
DpFpTemplate object:
DpFpTemplate regTemplate = new DpFpTemplate();
regTemplate.setData(blob);
You must perform this operation for every registration template you want to
match and then separately for the verification template:
Template Searching
You can implement a more complete search process using the SearchLevel
methods. When searching for a matching template, the search process can be
complete after a single match occurs, or it can be continued so that each
template that matches is found and ranked for quality. The matching results are
sorted by order of best match. Use the methods in DpFpVerification and
DpFpTemplateMatching to set template searching.
Priority Level
Applications can be assigned a priority level to make them more available to
accept the fingerprint information over other applications. High priority means
that fingerprint events are sent to the application even though it might not be the
active application at the time of the fingerprint input. Normal priority means that
fingerprint events are sent to the application if its window is currently active.
Low priority means that fingerprint events are sent to the application if no other
application uses the information.
You can have only one application per machine, or per terminal session,
assigned to a high priority level and a low level priority. All other applications
are considered normal priority. Assigning high or low priority to an application
takes the priority from the last application that was assigned that priority, which
means it will stop receiving any fingerprint events.
The high and low priorities are already used by the DigitalPersona Pro
applications. In some cases, a developer might need to reassign these priorities,
but this can stop both DigitalPersona Pro and the custom application from
working. It is recommended to run only one application per machine that uses
high or low priorities. Use the methods in DpFpRegistration, DpFpVerification,
and DpFpTemplateAcquisition to set priority level.
Fingerprint Scans
By importing java.awt.Image, you can access and manipulate the fingerprint
scan acquired during the registration and verification processes. When an scan is
acquired by the reader, the EVT_IMAGE_RECEIVED event is fired and an
com.digitalpersona.uareu.toolkit.Image object is passed to the handler for this
event. To convert the image object to a java.awt.Image object, call the
getJavaImage() method:
Image image = DpFpImage.getJavaImage();
DpFpImage is the com.digitalpersona.uareu.toolkit.Image object passed to the
event handler for the EVT_IMAGE_RECEIVED event. You can then display the
image using the methods of the java.awt.Image class.
• Place the DpjFp.dll file in the Windows/System32 directory on the user’s PC.
• Install the DigitalPersona Gold, Fingerprint Recognition Software.
Warning
Failure to install the DpjFp.dll file on the user’s PC will cause a fingerprint
authentication-enabled application to fail.
Interface DpFpEventHandler
This interface provides event handling feedback for events related to the
registration, verification and template acquisition operations, as well as reader-
related events.
Fields
static int EVT_DEVICE_CONNECTION_ERROR
General device connection error occurred.
static int EVT_FINGER_REMOVED
User removed finger from reader.
static int EVT_FINGER_TOUCHING
User touched reader with finger.
static int EVT_IMAGE_RECEIVED
Fingerprint scan successfully acquired by reader. Returns
a DpFpImage object.
static int EVT_AREA_TOO_SMALL
Acquired fingerprint scan is too small to extract features;
the full fingerprint was not placed on the reader.
static int EVT_NO_CENTRAL_REGION
The fingerprint scan does not contain an adequate portion
of the center of the fingerprint.
static int EVT_NOISY_IMAGE
Fingerprint scan was too grainy; possibly, too much dirt
on the reader window.
static int EVT_FINGER_OFF_CENTER_HIGH
Fingerprint scan is too high.
static int EVT_FINGER_OFF_CENTER_LEFT
Fingerprint scan is too far left.
Methods
void dpFpOnEvent(int event, Object obj)
Class DpFpImage
public class DpFpImage extends java.lang.Object
This class represents a fingerprint scan (see “Fingerprint Scans” on page 13).
Constructor
DpFpImage(int height, int width)
Methods
byte[] getData()
java.awt.Image getJavaImage()
void setData(byte[] templateData)
Class DpFpTemplate
public class DpFpTemplate extends java.lang.Object
This class represents a fingerprint template as a byte array (see “Registration” on
page 6, “Verification” on page 8, “Acquiring Templates” on page 10 or
“Template Matching” on page 11).
Constructor
DpFpTemplate()
Methods
byte[] getData()
int getTemplateID()
void setData(byte[] templateData)
void setTemplateID(int id)
int getTemplateType()
void setTemplateType(int i)
Class DpFpRegistration
public class DpFpRegistration
extends java.lang.Object
implements java.lang.Runnable
This class provides a mechanism for performing the registration process (see
“Registration” on page 6). You can also choose to implement the XTF template
(see “Using the XTF Registration Template” on page 7.)
Constructor
DpFpRegistration()
Methods
void cancel()
void destroy()
void register()
void run()
void setHandler(com.digitalpersona.uareu.DpFpEv
entHandler handler)
bool isXTFTemplate()
void setXTFTemplate(boolean b)
int getConnectionPriority()
Class DpFpRegistrationException
public class DpFpTemplate extends java.lang.Exception
Constructor
DpFpRegistrationException(java.lang.String message)
Class DpFpVerification
public class DpFpVerification
extends java.lang.Object
implements java.lang.Runnable
This class provides a mechanism for performing the verification process (see
“Verification” on page 8).
Constructor
DpFpVerification()
Methods
void cancel()
void destroy()
double getSecurityLevel()
void run()
void setHandler(com.digitalpersona.uareu.DpFpEv
entHandler handler)
void setSecurityLevel(double d)
void verify(com.digitalpersona.uareu.toolkit.Dp
FpTemplate[] regTemplate)
void setConnectionPriority(int priority)
int getConnectionPriority()
bool getLearning()
int getSearchLevel()
void setLearning(boolean b)
void Identify(com.digitalpersona.uareu.toolkit.
DpFpTemplate[] regTemplate,
java.lang.String threadName)
void setSearchLevel(boolean b)
Class DpFpVerificationException
public class DpFpVerificationException
extends java.lang.Exception
Exception generated during the verification process.
Constructor
DpFpVerificationException(java.lang.String message)
Class DpFpTemplateAcquisition
public class DpFpTemplateAcquisition
extends java.lang.Object
implements java.lang.Runnable
This class facilitates the template acquisition process (see “Acquiring
Templates” on page 10).
Constructor
DpFpTemplateAcquisition()
Methods
void cancel()
void destroy()
void run()
void setHandler(com.digitalpersona.uareu.DpFpEv
entHandler handler)
void acquireTemplate()
void setConnectionPriority(int priority)
int getConnectionPriority()
Class DpFpTemplateAcquisitionException
public class DpFpTemplateAcquisitionException
extends java.lang.Exception
Constructor
DpFpTemplateAcquisitionException(java.lang.String message)
Class DpFpTemplateMatching
public class DpFpTemplateMatching
extends java.lang.Object
This class performs a match between a set of registration templates and a
verification template (see “Template Matching” on page 11).
Constructor
DpFpTemplateMatching()
Methods
double getSecurityLevel()
void setSecurityLevel()
DpFpMatchResult templateMatch(DpFpTemplate verTemplate,
DpFpTemplate[] regTemplates)
int getSearchLevel()
void setSearchLevel(int n)
bool getLearning()
void setLearning(boolean b)
DpFpMatchResult[] templateIdentify(DpFpTemplate
verTemplate, DpFpTemplate[] regTemplates)
Class DpFpMatchException
public class DpFpMatchException
extends java.lang.Exception
Constructors
DpFpMatchException()
DpFpMatchException(java.lang.String arg0)
DpFpMatchException(java.lang.String arg0,
java.lang.Throwable arg1)
DpFpMatchException(java.lang.Throwable arg0)
Class DpFpMatchResult
public class DpFpMatchResult
extends java.lang.Object
This class contains the result of a match between a verification template and a
set of registration templates (see “Verification” on page 8 or “Template
Matching” on page 11).
Constructor
DpFpMatchResult()
Methods
int getResult()
int getScore()
int getTemplateID()
void setTemplateID(int i)
double getFalseAcceptProbability()
Fields
static int FT_FAIL
static int FT_SUCCESS
Class DpFpToolkitException
public class DpFpToolkitException
extends java.lang.Exception
Constructors
DpFpToolkitException()
DpFpToolkitException(java.lang.String message)
DpFpToolkitException(java.lang.String arg0,
java.lang.Throwable arg1)
DpFpToolkitException(java.lang.Throwable arg0)
Class DeviceInfo
public class DeviceInfo extends java.lang.Object
This class represents the device information.
Constructor
DeviceInfo()
Methods
int getImgHeight()
com.digitalper getImgResolution()
sona.uareu.too
lkit.DeviceInf
o.Ft_Image_Res
olution
int getImgType()
int getImgWidth()
int getMaxImgSize()
int getNumIntensityLevels()
void setImgResolution(com.digitalpersona.ua
reu.toolkit.DeviceInfo.Ft_Image_Resolu
tion resolution)
Class DpFpFingerprintToolkit
public class DpFpFingerprintToolkit extends
java.lang.Object
This class represents the device information.FingerprintToolkit class provides
functions for Initialization, Termination and Settings Management, Reader
Handling, Image and Template Acquisition, Registration and Verification.
Constructor
DpFpFingerprintToolkit()
Fields
static int FT_ALLOW_LEARNING
static int FT_AREA_TOO_SMALL
static int FT_BUF_FILLED
static int FT_DEVICE_CONNECTION_ERROR
static int FT_DEVICE_ERROR
static int FT_DEVICE_PLUGGED
static int FT_DEVICE_UNPLUGGED
static int FT_ENABLE_MULT_TEMPLATE_REG
static int FT_FINGER_REMOVED
static int FT_FINGER_TOUCHING
static int FT_GOOD_FTR
static int FT_GOOD_IMG
static int FT_IMAGE_INFO
static int FT_IMAGE_READY
static int FT_IMG_TOO_DARK
static int FT_IMG_TOO_LIGHT
Methods
static FT_acquireImage(long nContext, int
DpFpImage ftrType, int ImageLen)
static FT_acquireTemplate(long nContext, int
DpFpTemplate ftrType, int templateLen)
This function acquires an scan from the specified reader,
checks its quality, and then extracts the template.
static void FT_closeContext(long nContext)
This function destroys the resources allocated for the
given context.
static void FT_connectDevice(long nContext, long
devId, int nPriority)
This function connects the device.
Place thethe
Place entire
entire
padpad
of of
your
yourfinger
finger
squarely
squarelyononthe
the
sensor
reader window
window
Apply even pressure. Pressing too hard will distort the scan; pressing too lightly
will produce a faint, unusable scan. Do not “roll” your finger.
To complete the fingerprint scan, hold your finger on the reader until you see the
reader light blink. This may take longer if the skin is dry. When the light blinks
and, if configured, a sound plays, you may lift your finger.
If the reader is capturing your fingerprint scan as indicated by the reader blink,
but DigitalPersona Pro consistently rejects it, you may need to reregister that
finger by first deleting it and then registering it again.
Under heavy usage, the window coating on some readers may turn cloudy from
the salt in perspiration. In this case, gently wipe the window with a cloth (not
paper) dampened with a mild ammonia-based glass cleaner.
The U.are.U Fingerprint Reader has been tested and found to comply with the
limits for a Class B digital device under Part 15 of the Federal Communications
Commission (FCC) rules, and it is subject to the following conditions:
a) It may not cause harmful interference, and b) It must accept any interference
received, including interference that may cause undesired operation.
This digital apparatus does not exceed the Class B limits for radio noise emission
from digital apparatus as set out in the radio interference regulations of the
Canadian Department of Communications