Package org.xipki.security.asn1
Class Asn1StreamParser
- java.lang.Object
-
- org.xipki.security.asn1.Asn1StreamParser
-
- Direct Known Subclasses:
CrlStreamParser
public class Asn1StreamParser extends Object
ASN.1 stream parser.- Author:
- Lijun Liao (xipki)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAsn1StreamParser.MyInt
-
Field Summary
Fields Modifier and Type Field Description static intTAG_CONSTRUCTED_SEQUENCEstatic intTAG_CONSTRUCTED_SET
-
Constructor Summary
Constructors Constructor Description Asn1StreamParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertTag(int expectedTag, int tag, String name)static intmarkAndReadTag(InputStream instream)static byte[]readBlock(int expectedTag, BufferedInputStream instream, String name)static byte[]readBlock(BufferedInputStream instream, String name)static intreadLength(Asn1StreamParser.MyInt lenBytesSize, InputStream instream)static InstantreadTime(org.bouncycastle.asn1.ASN1Encodable obj)static InstantreadTime(Asn1StreamParser.MyInt bytesLen, BufferedInputStream instream, String name)static byte[]readValue(int expectedTag, BufferedInputStream instream, String name)static voidskip(InputStream instream, long count)
-
-
-
Field Detail
-
TAG_CONSTRUCTED_SEQUENCE
public static final int TAG_CONSTRUCTED_SEQUENCE
- See Also:
- Constant Field Values
-
TAG_CONSTRUCTED_SET
public static final int TAG_CONSTRUCTED_SET
- See Also:
- Constant Field Values
-
-
Method Detail
-
readBlock
public static byte[] readBlock(int expectedTag, BufferedInputStream instream, String name) throws IOException- Throws:
IOException
-
readBlock
public static byte[] readBlock(BufferedInputStream instream, String name) throws IOException
- Throws:
IOException
-
readValue
public static byte[] readValue(int expectedTag, BufferedInputStream instream, String name) throws IOException- Throws:
IOException
-
markAndReadTag
public static int markAndReadTag(InputStream instream) throws IOException
- Throws:
IOException
-
readLength
public static int readLength(Asn1StreamParser.MyInt lenBytesSize, InputStream instream) throws IOException
- Throws:
IOException
-
assertTag
public static void assertTag(int expectedTag, int tag, String name)
-
readTime
public static Instant readTime(org.bouncycastle.asn1.ASN1Encodable obj)
-
readTime
public static Instant readTime(Asn1StreamParser.MyInt bytesLen, BufferedInputStream instream, String name) throws IOException
- Throws:
IOException
-
skip
public static void skip(InputStream instream, long count) throws IOException
- Throws:
IOException
-
-