1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-17 01:31:08 +01: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 0819592b3a
commit d6101eea8a
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
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;