mattosaurus / PgpCore

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

How do I perform Single Pass Sign and Encrypt using PGPCore? #187

Closed InvincibleInDN closed 1 year ago

InvincibleInDN commented 2 years ago

I am using this library in multiple projects and all good. But this particular client, has a requirement that "The file must be encrypted and signed in a single pass using binary mode." . After multiple attempts, I figured out PGPCore is not EncryptStreamAndSign doesn't support Single Pass. Is there a option or workaround I am missing?

Thanks

mattosaurus commented 2 years ago

Hi, there's currently no workaround for this though you can output as binary by setting the armor flag to false.

You might need create your own implementation using Bouncy Castle directly for this as mentioned here.

https://jopinblog.wordpress.com/2008/06/23/pgp-single-pass-sign-and-encrypt-with-bouncy-castle/

This would be good functionality to add though so happy for you to submit a PR if you can get it working within PgpCore.

InvincibleInDN commented 2 years ago

Thanks for the suggestion.