SOP KeyReader: wrap IOException in BadData

This commit is contained in:
Paul Schaub 2022-11-24 22:14:06 +01:00
parent 5bdd4f6ad0
commit 68886613a6
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 3 additions and 2 deletions

View File

@ -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);