1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-09 18:29:39 +02:00

Create dedicated KeyException class for key-related exceptions.

This commit is contained in:
Paul Schaub 2022-03-15 14:04:59 +01:00
parent 6b3f37796c
commit a22336a795
13 changed files with 186 additions and 68 deletions

View file

@ -22,6 +22,7 @@ import org.pgpainless.encryption_signing.EncryptionResult;
import org.pgpainless.encryption_signing.EncryptionStream;
import org.pgpainless.encryption_signing.ProducerOptions;
import org.pgpainless.encryption_signing.SigningOptions;
import org.pgpainless.exception.KeyException;
import org.pgpainless.key.SubkeyIdentifier;
import org.pgpainless.key.info.KeyRingInfo;
import org.pgpainless.key.protection.SecretKeyRingProtector;
@ -63,7 +64,7 @@ public class SignImpl implements Sign {
}
signingOptions.addDetachedSignature(SecretKeyRingProtector.unprotectedKeys(), key, modeToSigType(mode));
}
} catch (PGPException e) {
} catch (PGPException | KeyException e) {
throw new SOPGPException.BadData(e);
}
return this;