1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-10 18:59:39 +02:00

SOP: Ignore marker packets in certificates

This commit is contained in:
Paul Schaub 2021-06-10 16:56:36 +02:00
parent 6b99f0aadc
commit e587fc46b8
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 8 additions and 1 deletions

View file

@ -15,6 +15,7 @@
*/
package org.pgpainless.key.collection;
import org.bouncycastle.bcpg.MarkerPacket;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPKeyRing;
import org.bouncycastle.openpgp.PGPObjectFactory;
@ -64,6 +65,10 @@ public class PGPKeyRingCollection {
List<PGPPublicKeyRing> publicKeyRings = new ArrayList<>();
while ((obj = pgpFact.nextObject()) != null) {
if (obj instanceof MarkerPacket) {
// Skip marker packets
continue;
}
if (obj instanceof PGPSecretKeyRing) {
secretKeyRings.add((PGPSecretKeyRing) obj);
} else if (obj instanceof PGPPublicKeyRing) {