Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Gpg4win-允许应用程序池访问公钥_C#_Openpgp_Mimekit - Fatal编程技术网

C# Gpg4win-允许应用程序池访问公钥

C# Gpg4win-允许应用程序池访问公钥,c#,openpgp,mimekit,C#,Openpgp,Mimekit,我在c#控制台应用程序上实现了OpenPGP加密,该应用程序使用MimeKit和Gpg4win发送PGP加密的电子邮件。我的控制台应用程序运行良好,但当我为在IIS中运行的网站实现此功能时,找不到公钥。我收到如下错误: MimeKit.Cryptography.PublicKeyNotFoundException: The public key could not be found. at MimeKit.Cryptography.OpenPgpContext.GetPublicKey(Ma

我在c#控制台应用程序上实现了OpenPGP加密,该应用程序使用MimeKit和Gpg4win发送PGP加密的电子邮件。我的控制台应用程序运行良好,但当我为在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\application data\gnupg中\

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


提前感谢

默认情况下,应用程序池的标识设置为application pool identity,这是一个虚拟帐户,具有受限的访问权限,在这种情况下并不理想

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