title: GPG encryption in an ASP.NET C# Web application - No Public Key
body: <p>I have set-up Gpg4win on Windows Server 2008 R2 and the website is running .Net 4.5.</p>
  
  <p>I'm using the Starksoft OpenPGP dll.</p>
  
  <p>I've added the required public key to Gpg4win via remote desktop, however when testing in the browser I get the following in the browser:</p>
  
  <pre><code>gpg: EMAIL@EMAIL.COM: skipped: No public key gpg: [stdin]: encryption failed: No public key
  </code></pre>
  
  <p>I've tested locally on my machine and directly in GPA and Kleopatra on the server and the encryption is working correctly. This leads me to believe that the issue is with the public key being set-up via remote desktop and not being accessible to the application pool or similar.</p>
  
  <p>I've tried copying the pubring.gpg, secring.gpg and trustdb.gpg in to a protected subfolder of the website as suggested somewhere (I forget where now) but this has not worked.</p>
  
  <p>Any ideas how to set-up the public keys to be accessible to the IIS user? </p>