DigitalPersona Java SDK-比较功能集和模板

时间:2012-11-02 16:38:37

标签: java fingerprint

我正在使用digitalpersona one touch for windows java edition,我使用applet捕获指纹模板,applet序列化模板然后将其从字节数组转换为hexstring以将其显示在隐藏文本框中并发送到服务器端并存储在mysql中。 我的代码可以检索模板,并将其转换回数组,但我不知道如何反序列化它并再次创建模板:

   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);

1 个答案:

答案 0 :(得分:0)

您必须创建一个匹配器来比较功能集和模板,如下所示:

DPFPVerification matcher = DPFPGlobal.getVerificationFactory().createVerification();
DPFPTemplate template = DPFPGlobal.getTemplateFactory().createTemplate();
template.deserialize(byteArray);
DPFPVerificationResult result = matcher.verify(featureSet, template);