【发布时间】: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\
如何允许在特定应用程序池配置文件下运行的网站访问这些密钥?
提前致谢
【问题讨论】: