title: PGP Encryption & PGP Decryption
body: <p>I'm having trouble decrypting files using the BouncyCastle OpenPGP API. I followed this post: <a href="http://rafayal.blogspot.com/2009/06/pgp-decryption-with-c.html" rel="nofollow">http://rafayal.blogspot.com/2009/06/pgp-decryption-with-c.html</a> to decrypt files. However, I am getting an error that states that the KeyID cannot be null whenever I instantiate the PGPDecrypt object. </p>
  
  <pre><code>PGPDecrypt test = new PGPDecrypt(@"C:\test\somefile.zip",
                                               @"C:\GnuPG\secring.gpg",
                                               "password",
                                               @"C:\test\test",
                                               @"C:\GnuPG\pubring.asc",
                                               666362230);
              FileStream fs = File.Open(@"C:\test\somefile.zip", FileMode.Open);
              test.decrypt(fs,@"C:\test\test");
  </code></pre>
  
  <p>I'm creating the key using Kleopatra on the Gpg4Win tool set. </p>
  
  <p>Within the PGPDecrypt class, when the PGPKeys object is being instantiate (specifically the PgpPublicKey object) , I am getting the error that states that the KeyID cannot be null. Can some body please help. </p>
  
  <p>Thank you so much.  </p>