Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'prov/src/main/java/org/spongycastle/x509/X509StreamParserSpi.java')
-rw-r--r--prov/src/main/java/org/spongycastle/x509/X509StreamParserSpi.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/prov/src/main/java/org/spongycastle/x509/X509StreamParserSpi.java b/prov/src/main/java/org/spongycastle/x509/X509StreamParserSpi.java
new file mode 100644
index 00000000..814a65f9
--- /dev/null
+++ b/prov/src/main/java/org/spongycastle/x509/X509StreamParserSpi.java
@@ -0,0 +1,45 @@
+package org.spongycastle.x509;
+
+import org.spongycastle.x509.util.StreamParsingException;
+
+import java.io.InputStream;
+import java.util.Collection;
+
+/**
+ * This abstract class defines the service provider interface (SPI) for
+ * X509StreamParser.
+ *
+ * @see org.spongycastle.x509.X509StreamParser
+ *
+ */
+public abstract class X509StreamParserSpi
+{
+ /**
+ * Initializes this stream parser with the input stream.
+ *
+ * @param in The input stream.
+ */
+ public abstract void engineInit(InputStream in);
+
+ /**
+ * Returns the next X.509 object of the type of this SPI from the given
+ * input stream.
+ *
+ * @return the next X.509 object in the stream or <code>null</code> if the
+ * end of the stream is reached.
+ * @exception StreamParsingException
+ * if the object cannot be created from input stream.
+ */
+ public abstract Object engineRead() throws StreamParsingException;
+
+ /**
+ * Returns all X.509 objects of the type of this SPI from
+ * the given input stream.
+ *
+ * @return A collection of all X.509 objects in the input stream or
+ * <code>null</code> if the end of the stream is reached.
+ * @exception StreamParsingException
+ * if an object cannot be created from input stream.
+ */
+ public abstract Collection engineReadAll() throws StreamParsingException;
+}