mattosaurus / PgpCore

.NET Core class library for using PGP
MIT License
245 stars 98 forks source link

Getting message is not a encrypted or signed file exception when using VerifyStream on a GPG file #191

Closed jgornales closed 1 year ago

jgornales commented 1 year ago

Possibly related to https://github.com/mattosaurus/PgpCore/issues/96

Getting a Message is not a encrypted and signed file or simple signed file exception when using VerifyStream on a Kleopatra encrypted+signed gpg binary file.

mattosaurus commented 1 year ago

I think #96 was resolved in the end (though I've only just closed the issue). Are you able to provide me with some keys and encrypeted files to help me investigate further?

jgornales commented 1 year ago

Hi Matt,

We managed to make it work by using DecryptAndVerifyStream. Somehow guessed that Kleopatra signs first and then encrypts when doing sign/encrypt, so using VerifyStream alone will give the exception. But here are the testkeys and payload if you still need them. (Encrypted for testuser and signed by testadmin) test_data.zip passphrase for all priv keys is 12345678