2021-10-07 15:48:52 +02:00
|
|
|
// SPDX-FileCopyrightText: 2018 Paul Schaub <vanitasvitae@fsfe.org>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-07-18 18:23:06 +02:00
|
|
|
package org.pgpainless.encryption_signing;
|
2018-06-04 19:45:18 +02:00
|
|
|
|
2018-06-05 01:30:58 +02:00
|
|
|
import java.io.IOException;
|
2018-06-04 19:45:18 +02:00
|
|
|
import java.io.OutputStream;
|
2021-04-26 13:38:12 +02:00
|
|
|
import javax.annotation.Nonnull;
|
2018-06-28 18:25:11 +02:00
|
|
|
|
2018-06-05 01:30:58 +02:00
|
|
|
import org.bouncycastle.openpgp.PGPException;
|
2018-06-04 19:45:18 +02:00
|
|
|
|
|
|
|
public interface EncryptionBuilderInterface {
|
|
|
|
|
2020-08-24 16:00:23 +02:00
|
|
|
/**
|
|
|
|
* Create a {@link EncryptionStream} on an {@link OutputStream} that contains the plain data that
|
|
|
|
* shall be encrypted and or signed.
|
|
|
|
*
|
|
|
|
* @param outputStream output stream of the plain data.
|
|
|
|
* @return api handle
|
|
|
|
*/
|
2021-07-10 12:22:47 +02:00
|
|
|
WithOptions onOutputStream(@Nonnull OutputStream outputStream);
|
2018-06-04 19:45:18 +02:00
|
|
|
|
2021-06-29 16:43:37 +02:00
|
|
|
interface WithOptions {
|
2018-06-04 19:45:18 +02:00
|
|
|
|
2020-08-24 16:00:23 +02:00
|
|
|
/**
|
2021-05-06 00:04:03 +02:00
|
|
|
* Create an {@link EncryptionStream} with the given options (recipients, signers, algorithms...).
|
2020-08-24 16:00:23 +02:00
|
|
|
*
|
2021-05-06 00:04:03 +02:00
|
|
|
* @param options options
|
|
|
|
* @return encryption strea
|
2020-08-24 16:00:23 +02:00
|
|
|
*/
|
2021-05-06 00:04:03 +02:00
|
|
|
EncryptionStream withOptions(ProducerOptions options) throws PGPException, IOException;
|
2018-06-04 19:45:18 +02:00
|
|
|
|
2021-05-06 00:04:03 +02:00
|
|
|
}
|
2018-06-04 19:45:18 +02:00
|
|
|
}
|