I am attempting to decrypt a file using BouncyCastle in C# that has been encrypted with RSA via Kleopatra. Unfortunately, I am receiving an error that states "Unknown packet type encountered: 20" when processing through the first few lines of decryption. The (pseudo) code:
using (Stream inputStream = File.OpenRead(test.txt.gpg))
{
using (Stream keyIn = File.OpenRead(privatekey.asc))
{
PgpObject o = null;
PgpObjectFactory pgpF = new PgpObjectFactory(PgpUtilities.GetDecoderStream(inputStream));
PgpSecretKeyRingBundle pgpSec = new PgpSecretKeyRingBundle(PgpUtilities.GetDecoderStream(privateKeyStream));
if (pgpF != null)
{
o = pgpF.NextPgpObject(); -- THIS LINE THROWS THE UNKNOWN PACKET TYPE ERROR
}
}
}
After googling, I have seen examples that the above code snippet models, but I have not yet seen any information about unknown packet types.
Does anyone know if I am doing anything wrong, or can point me in the direction of documentation of the error code numbers?
Thank you in advance for your time.