blob: f1cf9791a973d56987f3a27784cbfa885441d446 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package org.spongycastle.openpgp.jcajce;
import java.io.IOException;
import java.io.InputStream;
import org.spongycastle.openpgp.PGPMarker;
/** This class wraps the regular PGPObjectFactory, changing its behavior to
* ignore all PGPMarker packets it encounters while reading. These packets
* carry no semantics of their own, and should be ignored according to
* RFC 4880.
*
* @see https://tools.ietf.org/html/rfc4880#section-5.8
* @see org.spongycastle.openpgp.PGPMarker
*
*/
public class JcaSkipMarkerPGPObjectFactory extends JcaPGPObjectFactory {
public JcaSkipMarkerPGPObjectFactory(InputStream in) {
super(in);
}
@Override
public Object nextObject() throws IOException {
Object o = super.nextObject();
while (o instanceof PGPMarker) {
o = super.nextObject();
}
return o;
}
}
|