Skip to content
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

Fix warning about obsolete method #47

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions DigitaleBriefwahl/Encryption/EncryptVote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,21 @@ private static byte[] CompressData(byte[] inputData)
using var stream = new MemoryStream();
var compressedDataGenerator = new PgpCompressedDataGenerator(CompressionAlgorithmTag.Zip);

using (var compressedStream = compressedDataGenerator.Open(stream))
using var compressedStream = compressedDataGenerator.Open(stream);
var lData = new PgpLiteralDataGenerator();

// we want to Generate compressed data. This might be a user option later,
// in which case we would pass in bOut.
using (var pOut = lData.Open(
compressedStream, // the compressed output stream
PgpLiteralData.Binary,
"data", // "filename" to store
inputData.Length, // length of clear data
DateTime.UtcNow // current time
))
{
var lData = new PgpLiteralDataGenerator();

// we want to Generate compressed data. This might be a user option later,
// in which case we would pass in bOut.
using (var pOut = lData.Open(
compressedStream, // the compressed output stream
PgpLiteralData.Binary,
"data", // "filename" to store
inputData.Length, // length of clear data
DateTime.UtcNow // current time
))
{
pOut.Write(inputData, 0, inputData.Length);

lData.Close();
}
pOut.Write(inputData, 0, inputData.Length);
}
compressedDataGenerator.Close();
return stream.ToArray();
}

Expand Down