0

am trying to create a soap webservice method to match fingerprints using digitalpersona one touch for windows sdk java edition. I capture the featureset from an applet at the client side and compare it with my template on the server side. But I need to deserialize it and create the feature set again so that i can compare it with the template.

I dont know how to recreate the feature set so that i can use it for verification:

//This is for template retrieval: (no problem here) 

       String dbTemplate = result.getString("template");
            byte[] byteArray = new byte[1];
            byteArray = hexStringToByteArray(dbTemplate);
            DPFPTemplate template = DPFPGlobal.getTemplateFactory().createTemplate();
            template.deserialize(byteArray);



            byte[] fsArray = new byte[1];
            fsArray = hexStringToByteArray(ftSet);

      //the problem is here, I've already converted it back into bytearray[] but i need to deserialize it and create the feature set again.

             featureSet.deserialise(fsArray);
            DPFPFeatureSet features = extractFeatures(sample, DPFPDataPurpose.DATA_PURPOSE_VERIFICATION);

//This is for matching features and template
            DPFPVerification matcher = DPFPGlobal.getVerificationFactory().createVerification();
            DPFPVerificationResult result1 = matcher.verify(features, template);
            if (result1.isVerified()) {

                return "The fingerprint was VERIFIED.";

            } else {
                return "The fingerprint was NOT VERIFIED.";

            }

Please help me.

Div
  • 25
  • 1
  • 3
  • 12

1 Answers1

0

the best thing you can do here is not to convert the bytearray into string. if you are saving it in a database, you can automatically save it as byte array (since the blob can accept a bytearray).

you can insert it like this (just an example)

PreparedStatement st=con.prepareStatement("INSERT INTO EMPLOYEE(employee_id,template)"+"values(?,?)");
st.setInt(1,23);
st.setBytes(2, enroller.getTemplate().serialize());

Statement st = con.createStatement();
ResultSet rec = st.executeQuery("SELECT * FROM EMPLOYEE WHERE EMPLOYEE_ID=3");

Then when accessing the template, deserialize it (just follow the sdk, i think it's around page 37) Onetouch java sdk ==== link

a sample will be available below.

while(rec.next()){
    blob = rec.getBlob("template");
    int blobLength = (int)blob.length();  
    blobAsBytes = blob.getBytes(1, blobLength);
}
templater.deserialize(blobAsBytes);         
verificator.setFARRequested(DPFPVerification.MEDIUM_SECURITY_FAR);
DPFPVerificationResult result = verificator.verify(fs, templater);
if (result.isVerified())
    System.out.print("The fingerprint was VERIFIED.");
Leonid
  • 340
  • 1
  • 3
  • 16