mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 10:49:39 +02:00
PGPException is not thrown during secret key reading
This commit is contained in:
parent
6251e01d57
commit
2bd71617bd
3 changed files with 22 additions and 22 deletions
|
@ -40,7 +40,7 @@ public class KeyRingReader {
|
|||
|
||||
public static final Charset UTF8 = Charset.forName("UTF-8");
|
||||
|
||||
public @Nonnull PGPPublicKeyRing publicKeyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
public PGPPublicKeyRing publicKeyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
return readPublicKeyRing(inputStream);
|
||||
}
|
||||
|
||||
|
@ -65,15 +65,15 @@ public class KeyRingReader {
|
|||
return publicKeyRingCollection(asciiArmored.getBytes(UTF8));
|
||||
}
|
||||
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull InputStream inputStream) throws IOException, PGPException {
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
return readSecretKeyRing(inputStream);
|
||||
}
|
||||
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull byte[] bytes) throws IOException, PGPException {
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull byte[] bytes) throws IOException {
|
||||
return secretKeyRing(new ByteArrayInputStream(bytes));
|
||||
}
|
||||
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull String asciiArmored) throws IOException, PGPException {
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull String asciiArmored) throws IOException {
|
||||
return secretKeyRing(asciiArmored.getBytes(UTF8));
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ public class RejectWeakSymmetricAlgorithmDuringDecryption {
|
|||
static {
|
||||
try {
|
||||
secretKeys = PGPainless.readKeyRing().secretKeyRing(key);
|
||||
} catch (IOException | PGPException e) {
|
||||
} catch (IOException e) {
|
||||
fail("Secret key cannot be parsed.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue