mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 18:59:39 +02:00
Remove unnecessary throws declarations
This commit is contained in:
parent
81bb8cba54
commit
09f94944b3
13 changed files with 19 additions and 35 deletions
|
@ -530,7 +530,7 @@ public class ModificationDetectionTests {
|
|||
);
|
||||
}
|
||||
|
||||
private PGPSecretKeyRingCollection getDecryptionKey() throws IOException, PGPException {
|
||||
private PGPSecretKeyRingCollection getDecryptionKey() throws IOException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.readKeyRing().secretKeyRing(keyAscii);
|
||||
return new PGPSecretKeyRingCollection(Collections.singletonList(secretKeys));
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
|||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Arrays;
|
||||
|
@ -165,7 +164,7 @@ public class EncryptionOptionsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testAddRecipients_PGPPublicKeyRingCollection() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
||||
public void testAddRecipients_PGPPublicKeyRingCollection() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
PGPPublicKeyRing secondKeyRing = KeyRingUtils.publicKeyRingFrom(
|
||||
PGPainless.generateKeyRing().modernKeyRing("other@pgpainless.org"));
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ public class CertifyCertificateTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testScopedDelegation() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
||||
public void testScopedDelegation() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
PGPSecretKeyRing aliceKey = PGPainless.generateKeyRing()
|
||||
.modernKeyRing("Alice <alice@pgpainless.org>");
|
||||
PGPSecretKeyRing caKey = PGPainless.generateKeyRing()
|
||||
|
|
|
@ -7,7 +7,6 @@ package org.pgpainless.key.generation;
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Date;
|
||||
|
@ -26,14 +25,15 @@ import org.pgpainless.key.generation.type.rsa.RsaLength;
|
|||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.timeframe.TestTimeFrameProvider;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class GenerateKeyWithAdditionalUserIdTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void test() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException {
|
||||
Date now = new Date();
|
||||
public void test() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
||||
Date now = DateUtil.now();
|
||||
Date expiration = TestTimeFrameProvider.defaultExpirationForCreationDate(now);
|
||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||
.setPrimaryKey(KeySpec.getBuilder(
|
||||
|
|
|
@ -8,7 +8,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Iterator;
|
||||
|
@ -36,8 +35,7 @@ public class BCUtilTest {
|
|||
|
||||
@Test
|
||||
public void keyRingToCollectionTest()
|
||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException,
|
||||
IOException {
|
||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException {
|
||||
PGPSecretKeyRing sec = PGPainless.buildKeyRing()
|
||||
.setPrimaryKey(KeySpec.getBuilder(
|
||||
KeyType.RSA(RsaLength._3072),
|
||||
|
|
|
@ -56,7 +56,7 @@ public class KeyRingsFromCollectionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void selectPublicKeyRingFromPublicKeyRingCollectionTest() throws IOException, PGPException {
|
||||
public void selectPublicKeyRingFromPublicKeyRingCollectionTest() throws IOException {
|
||||
PGPPublicKeyRing emil = TestKeys.getEmilPublicKeyRing();
|
||||
PGPPublicKeyRing juliet = TestKeys.getJulietPublicKeyRing();
|
||||
PGPPublicKeyRingCollection collection = new PGPPublicKeyRingCollection(Arrays.asList(emil, juliet));
|
||||
|
@ -68,7 +68,7 @@ public class KeyRingsFromCollectionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void selectPublicKeyRingMapFromPublicKeyRingCollectionMapTest() throws IOException, PGPException {
|
||||
public void selectPublicKeyRingMapFromPublicKeyRingCollectionMapTest() throws IOException {
|
||||
PGPPublicKeyRing emil = TestKeys.getEmilPublicKeyRing();
|
||||
PGPPublicKeyRing juliet = TestKeys.getJulietPublicKeyRing();
|
||||
MultiMap<String, PGPPublicKeyRingCollection> map = new MultiMap<>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue