1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-22 20:32:05 +01:00

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

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