c# - 使用 C# 的 GnuPG 包装器

标签 c# security gnupg

我使用 GnuPG 和 C# 通过导入的公钥加密文件。但是当我尝试加密时,GnuPG 使用主用户的公钥加密文件。我确定我通过了正确的收件人。

最佳答案

您可以尝试使用我的 C#(和 VB.NET)开源和免费 GnuPG 包装器。所有代码均通过 MIT 授权,非 GPL 限制。您可以在 CodePlex 找到带有源代码的版本。查找 Alpha 版本以找到 GPG 库。

http://biko.codeplex.com/

例子:

  GnuPG gpg = new GnuPG();

  gpg.Recipient = "myfriend@domain.com";
  FileStream sourceFile = new FileStream(@"c:\temp\source.txt", FileMode.Open); 
  FileStream outputFile = new FileStream(@"c:\temp\output.txt", FileMode.Create);

  // encrypt the data using IO Streams - any type of input and output IO Stream can be used
  gpg.Encrypt(sourceFile, outputFile);

关于c# - 使用 C# 的 GnuPG 包装器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1214026/

相关文章:

c# - 在 Windows 服务中启动调试器

c# - 如何使用 DocX 控制 Word 文档中的表格列宽?

java - 使用 Objective-C 加密数据并使用 Java 问题解密

java - PrivilegedActionException 试图从 JavaScript 调用签名的 Java applet

c# - 将 TextBox 中的值传递给 ValidationRule

c# - 控制使用 SubscribedOn 后在哪个线程上处理 Rx 订阅

c# - AesManaged 的​​密码学设置和 secret 管理

php GnuPG解密超时

linux - 在 debian stretch 中添加 ppa 时找不到 S.gpg-agent.browser 错误

gnupg - GPG : How to delete bad session key and get asked for encryption password again?