Skip to content

Commit 3e4adbd

Browse files
committed
Adapt KeyIdentifier changes
1 parent e51b2f1 commit 3e4adbd

10 files changed

+13
-17
lines changed

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

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,20 @@
44
import org.bouncycastle.bcpg.BCPGInputStream;
55
import org.bouncycastle.bcpg.BCPGOutputStream;
66
import org.bouncycastle.bcpg.FingerprintUtil;
7+
import org.bouncycastle.bcpg.KeyIdentifier;
78
import org.bouncycastle.bcpg.PacketFormat;
89
import org.bouncycastle.bcpg.PublicKeyAlgorithmTags;
9-
import org.bouncycastle.bcpg.SignaturePacket;
1010
import org.bouncycastle.bcpg.SignatureSubpacket;
1111
import org.bouncycastle.bcpg.SignatureSubpacketTags;
1212
import org.bouncycastle.bcpg.sig.Features;
1313
import org.bouncycastle.bcpg.sig.KeyFlags;
14-
import org.bouncycastle.bcpg.sig.NotationData;
1514
import org.bouncycastle.bcpg.sig.PreferredAEADCiphersuites;
1615
import org.bouncycastle.bcpg.sig.PreferredAlgorithms;
1716
import org.bouncycastle.openpgp.*;
1817
import org.bouncycastle.openpgp.api.exception.IncorrectPGPSignatureException;
19-
import org.bouncycastle.openpgp.api.exception.MalformedPGPSignatureException;
2018
import org.bouncycastle.openpgp.api.exception.MissingIssuerCertException;
2119
import org.bouncycastle.openpgp.api.util.UTCUtil;
2220
import org.bouncycastle.openpgp.operator.PGPContentVerifierBuilderProvider;
23-
import org.bouncycastle.util.Iterable;
24-
import org.bouncycastle.util.encoders.Hex;
2521

2622
import java.io.ByteArrayInputStream;
2723
import java.io.ByteArrayOutputStream;
@@ -96,7 +92,7 @@ public OpenPGPCertificate(PGPKeyRing keyRing, OpenPGPImplementation implementati
9692
{
9793
PGPPublicKey rawSubkey = rawKeys.next();
9894
OpenPGPSubkey subkey = new OpenPGPSubkey(rawSubkey, this);
99-
subkeys.put(new KeyIdentifier(rawSubkey), subkey);
95+
subkeys.put(rawSubkey.getKeyIdentifier(), subkey);
10096
processSubkey(subkey);
10197
}
10298
}
@@ -215,7 +211,7 @@ public List<OpenPGPComponentKey> getKeys()
215211
*/
216212
public OpenPGPComponentKey getKey(KeyIdentifier identifier)
217213
{
218-
if (identifier.matches(getPrimaryKey().getPGPPublicKey()))
214+
if (identifier.matches(getPrimaryKey().getPGPPublicKey().getKeyIdentifier()))
219215
{
220216
return primaryKey;
221217
}
@@ -1028,7 +1024,7 @@ public PGPPublicKey getPGPPublicKey()
10281024
*/
10291025
public KeyIdentifier getKeyIdentifier()
10301026
{
1031-
return new KeyIdentifier(rawPubkey);
1027+
return rawPubkey.getKeyIdentifier();
10321028
}
10331029

10341030
/**

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import org.bouncycastle.bcpg.ArmoredOutputStream;
44
import org.bouncycastle.bcpg.BCPGInputStream;
55
import org.bouncycastle.bcpg.BCPGOutputStream;
6+
import org.bouncycastle.bcpg.KeyIdentifier;
67
import org.bouncycastle.bcpg.PacketFormat;
78
import org.bouncycastle.bcpg.SecretKeyPacket;
8-
import org.bouncycastle.openpgp.KeyIdentifier;
99
import org.bouncycastle.openpgp.PGPException;
1010
import org.bouncycastle.openpgp.PGPObjectFactory;
1111
import org.bouncycastle.openpgp.PGPPrivateKey;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.bouncycastle.openpgp.api;
22

3-
import org.bouncycastle.openpgp.KeyIdentifier;
3+
import org.bouncycastle.bcpg.KeyIdentifier;
44

55
import java.util.Collection;
66
import java.util.HashMap;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.bouncycastle.openpgp.api;
22

3-
import org.bouncycastle.openpgp.KeyIdentifier;
3+
import org.bouncycastle.bcpg.KeyIdentifier;
44

55
/**
66
* Interface for providing OpenPGP keys or certificates.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
import org.bouncycastle.bcpg.ArmoredOutputStream;
55
import org.bouncycastle.bcpg.CompressionAlgorithmTags;
66
import org.bouncycastle.bcpg.HashAlgorithmTags;
7+
import org.bouncycastle.bcpg.KeyIdentifier;
78
import org.bouncycastle.bcpg.S2K;
89
import org.bouncycastle.bcpg.SignatureSubpacketTags;
910
import org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags;
1011
import org.bouncycastle.bcpg.sig.Features;
1112
import org.bouncycastle.bcpg.sig.PreferredAEADCiphersuites;
1213
import org.bouncycastle.bcpg.sig.PreferredAlgorithms;
1314
import org.bouncycastle.crypto.CryptoServicesRegistrar;
14-
import org.bouncycastle.openpgp.KeyIdentifier;
1515
import org.bouncycastle.openpgp.PGPCompressedDataGenerator;
1616
import org.bouncycastle.openpgp.PGPEncryptedDataGenerator;
1717
import org.bouncycastle.openpgp.PGPException;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.bouncycastle.bcpg.AEADEncDataPacket;
44
import org.bouncycastle.bcpg.BCPGInputStream;
55
import org.bouncycastle.bcpg.SymmetricEncIntegrityPacket;
6-
import org.bouncycastle.openpgp.KeyIdentifier;
6+
import org.bouncycastle.bcpg.KeyIdentifier;
77
import org.bouncycastle.openpgp.PGPCompressedData;
88
import org.bouncycastle.openpgp.PGPEncryptedDataList;
99
import org.bouncycastle.openpgp.PGPException;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.bouncycastle.openpgp.api;
22

33
import org.bouncycastle.bcpg.InputStreamPacket;
4-
import org.bouncycastle.openpgp.KeyIdentifier;
4+
import org.bouncycastle.bcpg.KeyIdentifier;
55
import org.bouncycastle.openpgp.PGPEncryptedData;
66
import org.bouncycastle.openpgp.PGPEncryptedDataList;
77
import org.bouncycastle.openpgp.PGPException;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package org.bouncycastle.openpgp.api;
22

3+
import org.bouncycastle.bcpg.KeyIdentifier;
34
import org.bouncycastle.bcpg.SignaturePacket;
45
import org.bouncycastle.bcpg.SignatureSubpacket;
56
import org.bouncycastle.bcpg.SignatureSubpacketTags;
67
import org.bouncycastle.bcpg.sig.NotationData;
7-
import org.bouncycastle.openpgp.KeyIdentifier;
88
import org.bouncycastle.openpgp.PGPException;
99
import org.bouncycastle.openpgp.PGPOnePassSignature;
1010
import org.bouncycastle.openpgp.PGPSignature;

pg/src/test/java/org/bouncycastle/openpgp/api/test/OpenPGPCertificateTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import org.bouncycastle.bcpg.ArmoredInputStream;
44
import org.bouncycastle.bcpg.BCPGInputStream;
5+
import org.bouncycastle.bcpg.KeyIdentifier;
56
import org.bouncycastle.bcpg.sig.Features;
67
import org.bouncycastle.bcpg.sig.KeyFlags;
78
import org.bouncycastle.bcpg.test.AbstractPacketTest;
8-
import org.bouncycastle.openpgp.KeyIdentifier;
99
import org.bouncycastle.openpgp.OpenPGPTestKeys;
1010
import org.bouncycastle.openpgp.PGPObjectFactory;
1111
import org.bouncycastle.openpgp.PGPSignature;

pg/src/test/java/org/bouncycastle/openpgp/api/test/StaticV6OpenPGPMessageGeneratorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.bouncycastle.openpgp.api.test;
22

3+
import org.bouncycastle.bcpg.KeyIdentifier;
34
import org.bouncycastle.bcpg.test.AbstractPacketTest;
4-
import org.bouncycastle.openpgp.KeyIdentifier;
55
import org.bouncycastle.openpgp.OpenPGPTestKeys;
66
import org.bouncycastle.openpgp.PGPException;
77
import org.bouncycastle.openpgp.api.OpenPGPKey;

0 commit comments

Comments
 (0)