2

我在使用 BouncyCastle OpenPGP API 解密文件时遇到问题。我按照这篇文章:http ://rafayal.blogspot.com/2009/06/pgp-decryption-with-c.html来解密文件。但是,我收到一个错误,指出每当我实例化 PGPDecrypt 对象时 KeyID 不能为空。

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");

我正在使用 Gpg4Win 工具集上的 Kleopatra 创建密钥。

在 PGPDecrypt 类中,当 PGPKeys 对象被实例化(特别是 PgpPublicKey 对象)时,我收到指出 KeyID 不能为空的错误。可以请一些人帮忙。

太感谢了。

4

0 回答 0