【问题标题】:Gpg4win - allowing app pool access to public keysGpg4win - 允许应用程序池访问公钥
【发布时间】:2016-02-09 13:16:16
【问题描述】:

我使用 MimeKit 和 Gpg4win 在发送 PGP 加密电子邮件的 c# 控制台应用程序上实现了 OpenPGP 加密。我的控制台应用程序运行良好,但是当我为在 IIS 中运行的网站实现此功能时,找不到公钥。我收到这样的错误:

MimeKit.Cryptography.PublicKeyNotFoundException: The public key could not be found.
  at MimeKit.Cryptography.OpenPgpContext.GetPublicKey(MailboxAddress mailbox)
  at MimeKit.Cryptography.OpenPgpContext.GetPublicKeys(IEnumerable`1 mailboxes)
  at MimeKit.Cryptography.OpenPgpContext.Encrypt(IEnumerable`1 recipients, Stream content)
  at MimeKit.Cryptography.MultipartEncrypted.Create(OpenPgpContext ctx, IEnumerable`1 recipients, MimeEntity entity)

我很确定这仅在我的控制台应用程序中有效,因为我在我的用户配置文件下运行它,并且 Gpg4win 将我的公钥存储在我的配置文件应用程序数据下,即在 C:\Documents and Settings\me\应用程序数据\gnupg\

如何允许在特定应用程序池配置文件下运行的网站访问这些密钥?

提前致谢

【问题讨论】:

    标签: c# openpgp mimekit


    【解决方案1】:

    默认情况下,应用程序池的身份设置为应用程序池身份,一个虚拟帐户,访问受限,在这种情况下并不理想。

    创建另一个帐户并授予此访问权限和对公钥的必要权限,然后将此帐户用作应用程序池身份。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-24
      相关资源
      最近更新 更多