public class DerParser
extends java.io.FilterInputStream
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_DER_VALUE_LENGTH
Maximum size of data allowed by
readLength() - it is a bit arbitrary since one can encode 32-bit length
data, but it is good enough for the keys |
| Constructor and Description |
|---|
DerParser(byte... bytes) |
DerParser(byte[] bytes,
int offset,
int len) |
DerParser(java.io.InputStream s) |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigInteger |
readBigInteger() |
int |
readLength()
Decode the length of the field.
|
Asn1Object |
readObject() |
DerParser |
readSequence() |
public static final int MAX_DER_VALUE_LENGTH
readLength() - it is a bit arbitrary since one can encode 32-bit length
data, but it is good enough for the keyspublic DerParser(byte... bytes)
public DerParser(byte[] bytes,
int offset,
int len)
public DerParser(java.io.InputStream s)
public int readLength()
throws java.io.IOException
Short form - One octet. Bit 8 has value "0" and bits 7-1 give the length.
Long form - Two to 127 octets (only 4 is supported here). Bit 8 of first octet has value "1" and bits 7-1 give the number of additional length octets. Second and following octets give the length, base 256, most significant digit first.
java.io.IOException - If invalid format foundpublic DerParser readSequence() throws java.io.IOException
java.io.IOExceptionpublic Asn1Object readObject() throws java.io.IOException
java.io.IOExceptionpublic java.math.BigInteger readBigInteger()
throws java.io.IOException
java.io.IOExceptionCopyright © 2014-2021 Tomitribe Corporation. All Rights Reserved.