From 68886613a6c0c28a79b411d2e9b230c794a317e4 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 24 Nov 2022 22:14:06 +0100 Subject: [PATCH] SOP KeyReader: wrap IOException in BadData --- .../src/main/java/org/pgpainless/sop/KeyReader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/KeyReader.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/KeyReader.java index 064a5e39..5e6f3a7d 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/KeyReader.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/KeyReader.java @@ -31,7 +31,7 @@ class KeyReader { } throw e; } catch (PGPException e) { - throw new IOException("Cannot read keys.", e); + throw new SOPGPException.BadData("Cannot read keys.", e); } if (requireContent && (keys == null || keys.size() == 0)) { @@ -41,7 +41,8 @@ class KeyReader { return keys; } - static PGPPublicKeyRingCollection readPublicKeys(InputStream certIn, boolean requireContent) throws IOException { + static PGPPublicKeyRingCollection readPublicKeys(InputStream certIn, boolean requireContent) + throws IOException { PGPPublicKeyRingCollection certs; try { certs = PGPainless.readKeyRing().publicKeyRingCollection(certIn);