使用 C# 的 GnuPG 包装器

发布于 2024-07-29 05:33:09 字数 82 浏览 1 评论 0原文

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

I use GnuPG and C# to encrypt files with imported public keys. But when I try to make encryption, GnuPG encrypt file with public key of main user. I'm sure that I pass right recipient.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红颜悴 2024-08-05 05:33:09

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

http://biko.codeplex.com/

示例:

  GnuPG gpg = new GnuPG();

  gpg.Recipient = "[email protected]";
  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);

You can try using my open source and free GnuPG wrapper for C# (and VB.NET). All the code is licensed via MIT, non-GPL restrictions. You can find the release with source code at CodePlex. Look for the Alpha release to find the GPG library.

http://biko.codeplex.com/

Example:

  GnuPG gpg = new GnuPG();

  gpg.Recipient = "[email protected]";
  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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文