From 3921163d4866f6e157ca5eac1f1e86cc2f42a9a9 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 13 Nov 2014 10:59:53 +0900 Subject: [PATCH] Don't use deprecated PGPPublicKeyRingCollection constructor The PGPPublicKeyRingCollection constructor was deprecated in Bouncycastle v1.51. Use BcPGPPublicKeyRingCollection instead. Change-Id: I5bc4fb4927ba37ecbf7d3763809acc2f53d7fd4e (cherry picked from commit d26e43f22f2336efd18213ac88c285f8b95827cd) --- .../google/gerrit/server/contact/EncryptedContactStore.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/contact/EncryptedContactStore.java b/gerrit-server/src/main/java/com/google/gerrit/server/contact/EncryptedContactStore.java index f200879963..d82180deaf 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/contact/EncryptedContactStore.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/contact/EncryptedContactStore.java @@ -38,6 +38,7 @@ import org.bouncycastle.openpgp.PGPPublicKey; import org.bouncycastle.openpgp.PGPPublicKeyRing; import org.bouncycastle.openpgp.PGPPublicKeyRingCollection; import org.bouncycastle.openpgp.PGPUtil; +import org.bouncycastle.openpgp.bc.BcPGPPublicKeyRingCollection; import org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder; import org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator; import org.slf4j.Logger; @@ -113,7 +114,7 @@ class EncryptedContactStore implements ContactStore { private static PGPPublicKeyRingCollection readPubRing(final File pub) { try (InputStream fin = new FileInputStream(pub); InputStream in = PGPUtil.getDecoderStream(fin)) { - return new PGPPublicKeyRingCollection(in); + return new BcPGPPublicKeyRingCollection(in); } catch (IOException e) { throw new ProvisionException("Cannot read " + pub, e); } catch (PGPException e) {