mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 14:22:05 +01:00
SOP encrypt: Throw MissingArg if no encryption method was provided.
This commit is contained in:
parent
695e03f8b6
commit
83ef9cfe80
1 changed files with 3 additions and 0 deletions
|
@ -113,6 +113,9 @@ public class EncryptImpl implements Encrypt {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ready plaintext(InputStream plaintext) throws IOException {
|
public Ready plaintext(InputStream plaintext) throws IOException {
|
||||||
|
if (!encryptionOptions.hasEncryptionMethod()) {
|
||||||
|
throw new SOPGPException.MissingArg("Missing encryption method.");
|
||||||
|
}
|
||||||
ProducerOptions producerOptions = signingOptions != null ?
|
ProducerOptions producerOptions = signingOptions != null ?
|
||||||
ProducerOptions.signAndEncrypt(encryptionOptions, signingOptions) :
|
ProducerOptions.signAndEncrypt(encryptionOptions, signingOptions) :
|
||||||
ProducerOptions.encrypt(encryptionOptions);
|
ProducerOptions.encrypt(encryptionOptions);
|
||||||
|
|
Loading…
Reference in a new issue