Skip to content

Commit 69cadc1

Browse files
committed
get PGPObjectFactory from OpenPGPImplementation
1 parent d7b75d4 commit 69cadc1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.bouncycastle.openpgp.PGPUserAttributeSubpacketVector;
2525
import org.bouncycastle.openpgp.PGPUtil;
2626
import org.bouncycastle.openpgp.api.util.UTCUtil;
27-
import org.bouncycastle.openpgp.bc.BcPGPObjectFactory;
2827
import org.bouncycastle.openpgp.operator.PGPContentVerifierBuilderProvider;
2928
import org.bouncycastle.util.Iterable;
3029
import org.bouncycastle.util.encoders.Hex;
@@ -131,7 +130,7 @@ public static OpenPGPCertificate fromBytes(
131130
ByteArrayInputStream bIn = new ByteArrayInputStream(bytes);
132131
InputStream decoderStream = PGPUtil.getDecoderStream(bIn);
133132
BCPGInputStream pIn = BCPGInputStream.wrap(decoderStream);
134-
PGPObjectFactory objectFactory = new BcPGPObjectFactory(pIn);
133+
PGPObjectFactory objectFactory = implementation.pgpObjectFactory(pIn);
135134
PGPPublicKeyRing keyRing = (PGPPublicKeyRing) objectFactory.nextObject();
136135
return new OpenPGPCertificate(keyRing, implementation);
137136
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.bouncycastle.openpgp.PGPSecretKey;
1313
import org.bouncycastle.openpgp.PGPSecretKeyRing;
1414
import org.bouncycastle.openpgp.PGPUtil;
15-
import org.bouncycastle.openpgp.bc.BcPGPObjectFactory;
1615
import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
1716
import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptorBuilderProvider;
1817
import org.bouncycastle.openpgp.operator.PGPContentVerifierBuilderProvider;
@@ -81,7 +80,7 @@ public static OpenPGPKey fromBytes(
8180
ByteArrayInputStream bIn = new ByteArrayInputStream(bytes);
8281
InputStream decoderStream = PGPUtil.getDecoderStream(bIn);
8382
BCPGInputStream pIn = BCPGInputStream.wrap(decoderStream);
84-
PGPObjectFactory objectFactory = new BcPGPObjectFactory(pIn);
83+
PGPObjectFactory objectFactory = implementation.pgpObjectFactory(pIn);
8584
PGPSecretKeyRing keyRing = (PGPSecretKeyRing) objectFactory.nextObject();
8685
return new OpenPGPKey(keyRing, implementation);
8786
}

0 commit comments

Comments
 (0)