mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 10:49:39 +02:00
SOP: Ignore marker packets in certificates
This commit is contained in:
parent
6b99f0aadc
commit
e587fc46b8
2 changed files with 8 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue