-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow removal of "Version" header in PGP encryption #533
Comments
@boegi1 Sorry if I'm missing something, but could call |
@cipherboy My thoughts on this were that the SetHeader(header.Key, header.Value) function already contains the logic to remove a header where the value for a key is null. I also do not see any way to remove headers from the ArmoredOutputStream other than explicitly calling the SetHeader("Version", null) function. So wouldn't implicitly using it simplify it? |
@boegi1 Right, I think this is fine for after-the-fact removal. But I'm curious about why you'd want to pass a dictionary with a header key (set to the |
@cipherboy Doesn't passing an empty header Dictionary automatically add the version header? |
Ah, so we do: using Org.BouncyCastle.Bcpg;
var headers = new Dictionary<string, string>();
ArmoredOutputStream aos = new ArmoredOutputStream(Console.OpenStandardOutput(), headers);
aos.WriteByte(0x00);
aos.Close(); I think this change makes sense, but I'll double check with @peterdettman that he doesn't think it'll break anything. Thanks! |
I chose to add constructors with an |
PGP encrypted armored files always contain the "Version" header, also after setting the header value to null (-> "Version: ").
Could you please change this, so that when setting the version header to null it's completely removed?
Proposed change (https://github.com/bcgit/bc-csharp/blob/master/crypto/src/bcpg/ArmoredOutputStream.cs):
Current implementation
Solution
The text was updated successfully, but these errors were encountered: