pgpainless/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilderInterface....

36 lines
1007 B
Java
Raw Normal View History

2021-10-07 15:48:52 +02:00
// SPDX-FileCopyrightText: 2018 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
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-05 01:30:58 +02:00
import org.bouncycastle.openpgp.PGPException;
2018-06-04 19:45:18 +02:00
public interface EncryptionBuilderInterface {
/**
* 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
*/
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
/**
2021-05-06 00:04:03 +02:00
* Create an {@link EncryptionStream} with the given options (recipients, signers, algorithms...).
*
2021-05-06 00:04:03 +02:00
* @param options options
* @return encryption strea
*/
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
}