org.apache.commons.ssl.asn1
public class ASN1InputStream extends FilterInputStream implements DERTags
Modifier and Type | Field and Description |
---|---|
private static DERObject |
END_OF_STREAM |
(package private) boolean |
eofFound |
(package private) int |
limit |
in
APPLICATION, BIT_STRING, BMP_STRING, BOOLEAN, CONSTRUCTED, ENUMERATED, EXTERNAL, GENERAL_STRING, GENERALIZED_TIME, GRAPHIC_STRING, IA5_STRING, INTEGER, NULL, NUMERIC_STRING, OBJECT_IDENTIFIER, OCTET_STRING, PRINTABLE_STRING, SEQUENCE, SEQUENCE_OF, SET, SET_OF, T61_STRING, TAGGED, UNIVERSAL_STRING, UTC_TIME, UTF8_STRING, VIDEOTEX_STRING, VISIBLE_STRING
Constructor and Description |
---|
ASN1InputStream(byte[] input)
Create an ASN1InputStream based on the input byte array.
|
ASN1InputStream(InputStream is) |
ASN1InputStream(InputStream input,
int limit)
Create an ASN1InputStream where no DER object will be longer than limit.
|
Modifier and Type | Method and Description |
---|---|
private BERConstructedOctetString |
buildConstructedOctetString(DERObject sentinel) |
private BERConstructedOctetString |
buildDerConstructedOctetString(int length) |
private ASN1EncodableVector |
buildDerEncodableVector(int length) |
private ASN1EncodableVector |
buildEncodableVector(DERObject sentinel) |
protected DERObject |
buildObject(int tag,
int tagNo,
int length)
build an object given its tag and the number of bytes to construct it from.
|
private byte[] |
readDefiniteLengthFully(int length) |
protected void |
readFully(byte[] bytes) |
private byte[] |
readIndefiniteLengthFully()
read a string of bytes representing an indefinite length object.
|
protected int |
readLength() |
DERObject |
readObject() |
private int |
readTagNumber(int tag) |
available, close, mark, markSupported, read, read, read, reset, skip
private static final DERObject END_OF_STREAM
boolean eofFound
int limit
public ASN1InputStream(InputStream is)
public ASN1InputStream(byte[] input)
input
- array containing ASN.1 encoded data.public ASN1InputStream(InputStream input, int limit)
input
- stream containing ASN.1 encoded data.limit
- maximum size of a DER encoded object.protected int readLength() throws IOException
IOException
protected void readFully(byte[] bytes) throws IOException
IOException
protected DERObject buildObject(int tag, int tagNo, int length) throws IOException
IOException
private byte[] readDefiniteLengthFully(int length) throws IOException
IOException
private byte[] readIndefiniteLengthFully() throws IOException
IOException
private BERConstructedOctetString buildConstructedOctetString(DERObject sentinel) throws IOException
IOException
private BERConstructedOctetString buildDerConstructedOctetString(int length) throws IOException
IOException
private ASN1EncodableVector buildEncodableVector(DERObject sentinel) throws IOException
IOException
private ASN1EncodableVector buildDerEncodableVector(int length) throws IOException
IOException
public DERObject readObject() throws IOException
IOException
private int readTagNumber(int tag) throws IOException
IOException