mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-22 19:08:00 +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
|
||||
public Ready plaintext(InputStream plaintext) throws IOException {
|
||||
if (!encryptionOptions.hasEncryptionMethod()) {
|
||||
throw new SOPGPException.MissingArg("Missing encryption method.");
|
||||
}
|
||||
ProducerOptions producerOptions = signingOptions != null ?
|
||||
ProducerOptions.signAndEncrypt(encryptionOptions, signingOptions) :
|
||||
ProducerOptions.encrypt(encryptionOptions);
|
||||
|
|
Loading…
Reference in a new issue