Using compression algorithm BZip2 the encrypted output file has no data. All other compression algorithm working only BZip2 has this issue.
PgpCompressedDataGenerator comData = new PgpCompressedDataGenerator(CompressionAlgorithmTag.BZip2, compressionOption);
Stream cos = comData.Open(bOut); // open it with the final destination
PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator();
// we want to Generate compressed data. This might be a user option later,
// in which case we would pass in bOut.
Stream pOut = lData.Open(
cos, // the compressed output stream
PgpLiteralData.Binary,
fileName, // "filename" to store
clearData.Length, // length of clear data
DateTime.UtcNow // current time
);
pOut.Write(clearData, 0, clearData.Length);
pOut.Close();
New contributor
Nigil Joy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.