mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-10 22:31:09 +01:00
Make sop decrypt throw for unencrypted data
This commit is contained in:
parent
efc0cb357b
commit
14531f0050
2 changed files with 22 additions and 0 deletions
|
|
@ -149,6 +149,10 @@ public class DecryptImpl implements Decrypt {
|
|||
decryptionStream.close();
|
||||
OpenPgpMetadata metadata = decryptionStream.getResult();
|
||||
|
||||
if (!metadata.isEncrypted()) {
|
||||
throw new SOPGPException.BadData("Data is not encrypted.");
|
||||
}
|
||||
|
||||
List<Verification> verificationList = new ArrayList<>();
|
||||
for (SignatureVerification signatureVerification : metadata.getVerifiedInbandSignatures()) {
|
||||
verificationList.add(map(signatureVerification));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue