1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-14 04:39:39 +02:00

Move file-related encryption-info into ProducerOptions

This commit is contained in:
Paul Schaub 2021-07-10 12:22:47 +02:00
parent 447c08b446
commit 2ba782c451
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
7 changed files with 111 additions and 77 deletions

View file

@ -66,11 +66,14 @@ public class FileInfoTest {
ByteArrayInputStream dataIn = new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8));
ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
EncryptionStream encryptionStream = PGPainless.encryptAndOrSign()
.onOutputStream(dataOut, fileInfo)
.onOutputStream(dataOut)
.withOptions(ProducerOptions.encrypt(
EncryptionOptions
.encryptCommunications()
.addRecipient(publicKeys))
.setEncoding(fileInfo.getStreamFormat())
.setFileName(fileInfo.getFileName())
.setModificationDate(fileInfo.getModificationDate())
);
Streams.pipeAll(dataIn, encryptionStream);