diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-11-19 14:00:17 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-11-19 14:00:17 +0100 |
commit | 2fe508c60e51693b383481d6e626ccada85313f5 (patch) | |
tree | 9182ab2a5ecf272c02659bd5bd2dc999470e6b2a /OpenKeychain/src/main/java/org/spongycastle/openpgp/jcajce/JcaSkipMarkerPGPObjectFactory.java | |
parent | 62918c571899855bc4a16a77c9f423ff24c7d036 (diff) | |
parent | d4c121c2aff58fc193c4d715f4475d388b6de91e (diff) | |
download | open-keychain-2fe508c60e51693b383481d6e626ccada85313f5.tar.gz open-keychain-2fe508c60e51693b383481d6e626ccada85313f5.tar.bz2 open-keychain-2fe508c60e51693b383481d6e626ccada85313f5.zip |
Merge branch 'master' of github.com:open-keychain/open-keychain
Diffstat (limited to 'OpenKeychain/src/main/java/org/spongycastle/openpgp/jcajce/JcaSkipMarkerPGPObjectFactory.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/spongycastle/openpgp/jcajce/JcaSkipMarkerPGPObjectFactory.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/spongycastle/openpgp/jcajce/JcaSkipMarkerPGPObjectFactory.java b/OpenKeychain/src/main/java/org/spongycastle/openpgp/jcajce/JcaSkipMarkerPGPObjectFactory.java new file mode 100644 index 000000000..f1cf9791a --- /dev/null +++ b/OpenKeychain/src/main/java/org/spongycastle/openpgp/jcajce/JcaSkipMarkerPGPObjectFactory.java @@ -0,0 +1,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; + } +} |