01: package org.bouncycastle.x509;
02:
03: import org.bouncycastle.util.StreamParsingException;
04:
05: import java.io.InputStream;
06: import java.util.Collection;
07:
08: /**
09: * This abstract class defines the service provider interface (SPI) for
10: * X509StreamParser.
11: *
12: * @see org.bouncycastle.x509.X509StreamParser
13: *
14: */
15: public abstract class X509StreamParserSpi {
16: /**
17: * Initializes this stream parser with the input stream.
18: *
19: * @param in The input stream.
20: */
21: public abstract void engineInit(InputStream in);
22:
23: /**
24: * Returns the next X.509 object of the type of this SPI from the given
25: * input stream.
26: *
27: * @return the next X.509 object in the stream or <code>null</code> if the
28: * end of the stream is reached.
29: * @exception StreamParsingException
30: * if the object cannot be created from input stream.
31: */
32: public abstract Object engineRead() throws StreamParsingException;
33:
34: /**
35: * Returns all X.509 objects of the type of this SPI from
36: * the given input stream.
37: *
38: * @return A collection of all X.509 objects in the input stream or
39: * <code>null</code> if the end of the stream is reached.
40: * @exception StreamParsingException
41: * if an object cannot be created from input stream.
42: */
43: public abstract Collection engineReadAll()
44: throws StreamParsingException;
45: }
|