Win32Exception: 参数不正确

问题描述

我正在制作一个应用程序,以简单的方式显示您保存的浏览器密码(现在我使用的是 Google Chrome)。每次运行此代码时,我都会在 byte[] newbyte = Crypt32Util.cryptUnprotectData(mybyte); 处收到错误消息。使用的代码写在下面。此代码提供了一些上下文。我从来没有遇到过这个问题,经过一些研究,我找不到明确的解决方案。我希望有人可以帮助我。

代码

Connection connection = null;
connection = DriverManager.getConnection("jdbc:sqlite:" + path_to_copied_db);
PreparedStatement statement = connection.prepareStatement("SELECT `origin_url`,`username_value`,`password_value` FROM `logins`");
ResultSet re = statement.executeQuery();

StringBuilder builder = new StringBuilder();
while (re.next()) {
    String pass = "";
    try {
        byte[] mybyte = (byte[])re.getBytes("password_value");
        byte[] newbyte = Crypt32Util.cryptUnprotectData(mybyte); //Error on this line:71
        pass = new String(newbyte);
    }catch(Win32Exception e){
        e.printstacktrace();
    }
    builder.append(user + ": " + re.getString("origin_url") + " " + re.getString("username_value") + " " + re.getBinaryStream("password_value") + "\n");
}

错误

com.sun.jna.platform.win32.Win32Exception: The parameter is incorrect.
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:128)
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:103)
at com.sun.jna.platform.win32.Crypt32Util.cryptUnprotectData(Crypt32Util.java:90)
at Client.Client.main(Client.java:71)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)