iaik.utils
Class ASN1InputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.FilterInputStream
              |
              +--iaik.utils.Base64InputStream
                    |
                    +--iaik.utils.ASN1InputStream

public class ASN1InputStream
extends Base64InputStream

This Filter-InputStream can be used to read a lot of different formats for ASN.1 objects. The data which can be read from this stream is always binary DER encoded ASN.1!

The following formats have been tested:

Version:
File Revision 12

Fields inherited from class iaik.utils.Base64InputStream
decoding, ERROR, IGNORE, NOTIFY
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
ASN1InputStream(InputStream is)
          Creates a new ASN1InputStream to read data from the specified input stream.
 
Method Summary
 int available()
          Returns the number of bytes that can be read from this input stream without blocking.
protected  void notify(byte[] buffer)
          Called by super class if a '-' shall be decoded.
 int read()
          Reads the next byte of data from this input stream.
 int read(byte[] b, int off, int len)
          Reads up to len bytes of data from this input stream into an array of bytes.
 
Methods inherited from class iaik.utils.Base64InputStream
setIgnoreInvalidCharacters
 
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASN1InputStream

public ASN1InputStream(InputStream is)
                throws IOException
Creates a new ASN1InputStream to read data from the specified input stream.
Parameters:
is - the underlying input stream
Throws:
IOException - if an I/O error occurs during reading from the stream
Method Detail

notify

protected void notify(byte[] buffer)
               throws IOException
Called by super class if a '-' shall be decoded.
Overrides:
notify in class Base64InputStream
Following copied from class: iaik.utils.Base64InputStream
Parameters:
buffer - the characters already read from the input stream; and the first one was marked with NOTIFY
Throws:
IOException - allows the subclass to throw an Exception if an error occurs

read

public int read()
         throws IOException
Reads the next byte of data from this input stream.
Overrides:
read in class Base64InputStream
Returns:
the next byte of data, or -1 if the end of the stream is reached
Throws:
IOException - if an I/O error occurs

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Reads up to len bytes of data from this input stream into an array of bytes.
Overrides:
read in class Base64InputStream
Parameters:
b - the buffer into which the data is read
off - the start offset of the data
len - the maximum number of bytes read
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached
Throws:
IOException - if an I/O error occurs

available

public int available()
              throws IOException
Returns the number of bytes that can be read from this input stream without blocking.
Overrides:
available in class FilterInputStream
Returns:
the number of bytes that can be read from the input stream without blocking
Throws:
IOException - if an I/O error occurs

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK