0

Am using digitalpersona one touch for windows java edition, I captured a fingerprint template using an applet, the applet serialize the template then convert it from a byte array to a hexstring to display it in a hidden textbox and is sent to server side and stored in mysql. My code can retrieve the template,and convert it back to an array but i dont know how to deserialize it and create the template again:

   Connection con = null;  
try {
    Class.forName("com.mysql.jdbc.Driver");
     con = DriverManager.getConnection("jdbc:mysql://localhost:3306/biodb", "root", "1234");
    PreparedStatement st;
    st = con.prepareStatement("select template from login where username = ? ");
    st.setString(1, username);

    ResultSet result = st.executeQuery();

    if (result.next()) { //.next() returns true if there is a next row returned by the query.

        String dbTemplate = result.getString("template");
          byte[] data = new byte[1];
            data = hexStringToByteArray(dbTemplate);
           DPFPTemplate t = DPFPGlobal.getTemplateFactory().createTemplate();
            t.deserialize(data);
Div
  • 25
  • 1
  • 3
  • 12

1 Answers1

0

You have to create a matcher to compare the featureSet and the tmeplate, something like this:

DPFPVerification matcher = DPFPGlobal.getVerificationFactory().createVerification();
DPFPTemplate template = DPFPGlobal.getTemplateFactory().createTemplate();
template.deserialize(byteArray);
DPFPVerificationResult result = matcher.verify(featureSet, template);
Nickmancol
  • 1,034
  • 7
  • 16
  • yes thanks but just like you called the getTemplateFactory what should i write for the featureSet?? Because, my featureSet as well need to be deserialize. But i cant seem to get it right. As i dont know what method to call. Can you guide me please? – Div Nov 03 '12 at 15:52
  • Should it be like this: ` sample.deserialize(FtSetbyteArray); DPFPFeatureSet featureSet = extractFeatures(sample, DPFPDataPurpose.DATA_PURPOSE_VERIFICATION);` – Div Nov 03 '12 at 19:12