无法从WinApi板条箱调用CryptDecrypt,因为它找不到模块 [英] Cannot call CryptDecrypt from the WinApi crate because it could not find the module

查看:69
本文介绍了无法从WinApi板条箱调用CryptDecrypt,因为它找不到模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档中它表示该函数位于 winapi :: um :: wincrypt :: CryptDecrypt 中,但是当我安装板条箱并将其引入我的项目时,一切正常,直到尝试调用该函数我收到以下错误消息:

In the documentation it says that the function is in winapi::um::wincrypt::CryptDecrypt but when I install the crate and bring it in my project everything works fine until I try to call the function where I get the following error message:

error[E0433]: failed to resolve. Could not find `wincrypt` in `um`
  --> src\main.rs:68:39
   |
68 |  let decrypted_password = winapi::um::wincrypt::CryptDecrypt(password);
   |                                       ^^^^^^^^ Could not find `wincrypt` in `um`

我的目标是从Chrome存储密码的计算机上的本地数据"文件中解密密码.我正在Rust中使用称为 winapi 的Windows win32crypt API绑定.我正在尝试在Rust中完成类似于 chromepass 的事情.

My goal is to decrypt passwords from the "Local Data" file on my computer where Chrome stores passwords. I am using the Windows win32crypt API binding called winapi in Rust. I am trying to accomplish something similar to chromepass but in Rust.

推荐答案

来自板条箱级文档:

常见问题

为什么我收到有关未解决的进口的错误?

每个模块都有一个功能标志,因此您必须启用适当的功能来访问这些项目.例如,如果您要使用 winapi :: um :: winuser 中的内容,必须启用 winuser 功能.

Frequently asked questions

Why am I getting errors about unresolved imports?

Each module is gated on a feature flag, so you must enable the appropriate feature to gain access to those items. For example, if you want to use something from winapi::um::winuser you must enable the winuser feature.

在这种情况下,您需要添加 wincrypt :

In this case, you need to add wincrypt:

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["wincrypt"] }

这篇关于无法从WinApi板条箱调用CryptDecrypt,因为它找不到模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆