Skip to content

Commit 833d50f

Browse files
committed
Java 5 updates.
1 parent 79a81e2 commit 833d50f

File tree

8 files changed

+28
-524
lines changed

8 files changed

+28
-524
lines changed

pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPV6KeyGenerator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package org.bouncycastle.openpgp.api;
22

3+
import java.io.IOException;
4+
import java.util.ArrayList;
5+
import java.util.Date;
6+
import java.util.List;
7+
38
import org.bouncycastle.bcpg.AEADAlgorithmTags;
49
import org.bouncycastle.bcpg.CompressionAlgorithmTags;
510
import org.bouncycastle.bcpg.HashAlgorithmTags;
@@ -29,11 +34,6 @@
2934
import org.bouncycastle.openpgp.operator.PGPKeyPairGeneratorProvider;
3035
import org.bouncycastle.util.Arrays;
3136

32-
import java.io.IOException;
33-
import java.util.ArrayList;
34-
import java.util.Date;
35-
import java.util.List;
36-
3737
/**
3838
* High-level generator class for OpenPGP v6 keys.
3939
*/
@@ -521,7 +521,7 @@ public WithPrimaryKey withPrimaryKey(
521521
* @throws PGPException if the key cannot be generated
522522
*/
523523
public WithPrimaryKey withPrimaryKey(
524-
PGPKeyPair primaryKeyPair,
524+
final PGPKeyPair primaryKeyPair,
525525
SignatureSubpacketsFunction directKeySubpackets,
526526
PBESecretKeyEncryptor keyEncryptor)
527527
throws PGPException

pg/src/main/java/org/bouncycastle/openpgp/operator/jcajce/JceAEADUtil.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44
import java.io.InputStream;
55
import java.io.OutputStream;
66
import java.security.GeneralSecurityException;
7-
import java.security.InvalidAlgorithmParameterException;
8-
import java.security.InvalidKeyException;
97

10-
import javax.crypto.BadPaddingException;
118
import javax.crypto.Cipher;
12-
import javax.crypto.IllegalBlockSizeException;
139
import javax.crypto.SecretKey;
1410
import javax.crypto.spec.SecretKeySpec;
1511

@@ -297,8 +293,7 @@ static byte[] processAeadKeyData(JceAEADUtil aeadUtil, int mode, int encAlgorith
297293
JceAEADCipherUtil.setUpAeadCipher(c, secretKey, mode, iv, 128, aad);
298294
return c.doFinal(keyData, keyOff, keyLen);
299295
}
300-
catch (InvalidAlgorithmParameterException | InvalidKeyException |
301-
IllegalBlockSizeException | BadPaddingException e)
296+
catch (GeneralSecurityException e)
302297
{
303298
throw new PGPException("Exception recovering AEAD protected private key material", e);
304299
}

pg/src/main/java/org/bouncycastle/openpgp/operator/jcajce/JcePublicKeyKeyEncryptionMethodGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected byte[] encryptSessionInfo(PGPPublicKey pubKey,
104104
if (pubKey.getAlgorithm() == PublicKeyAlgorithmTags.ECDH)
105105
{
106106
byte[] sessionInfo = createSessionInfo(isV3 ? optSymAlgId : (byte)0, sessionKey);
107-
ECDHPublicBCPGKey ecKey = (ECDHPublicBCPGKey)pubKey.getPublicKeyPacket().getKey();
107+
final ECDHPublicBCPGKey ecKey = (ECDHPublicBCPGKey)pubKey.getPublicKeyPacket().getKey();
108108
String keyEncryptionOID = RFC6637Utils.getKeyEncryptionOID(ecKey.getSymmetricKeyAlgorithm()).getId();
109109
PublicKeyPacket pubKeyPacket = pubKey.getPublicKeyPacket();
110110

pg/src/main/jdk1.5/org/bouncycastle/openpgp/operator/bc/BcPublicKeyKeyEncryptionMethodGenerator.java

Lines changed: 0 additions & 215 deletions
This file was deleted.

0 commit comments

Comments
 (0)