diff --git a/pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPCertificate.java b/pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPCertificate.java index 267cfd72ce..04a384786f 100644 --- a/pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPCertificate.java +++ b/pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPCertificate.java @@ -1949,7 +1949,7 @@ else if (signature.getSignatureType() == PGPSignature.PRIMARYKEY_BINDING) throw new IncorrectOpenPGPSignatureException(this, "Key Signature is not correct."); } } - catch (PGPException e) + catch (PGPException | ClassCastException e) { this.isCorrect = false; throw new PGPSignatureException("Key Signature could not be verified.", e); @@ -1982,7 +1982,7 @@ protected void verifyUserIdSignature(OpenPGPComponentKey issuer, throw new IncorrectOpenPGPSignatureException(this, "UserID Signature is not correct."); } } - catch (PGPException e) + catch (PGPException | ClassCastException e) { this.isCorrect = false; throw new PGPSignatureException("UserID Signature could not be verified.", e); @@ -2015,7 +2015,7 @@ protected void verifyUserAttributeSignature(OpenPGPComponentKey issuer, throw new IncorrectOpenPGPSignatureException(this, "UserAttribute Signature is not correct."); } } - catch (PGPException e) + catch (PGPException | ClassCastException e) { this.isCorrect = false; throw new PGPSignatureException("Could not verify UserAttribute Signature.", e);