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:
parent
447c08b446
commit
2ba782c451
7 changed files with 111 additions and 77 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue