public class DERParser extends 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 |
in
Constructor and Description |
---|
DERParser(byte... bytes) |
DERParser(byte[] bytes,
int offset,
int len) |
DERParser(InputStream s) |
Modifier and Type | Method and Description |
---|---|
BigInteger |
readBigInteger() |
int |
readLength()
Decode the length of the field.
|
available, close, mark, markSupported, read, read, read, reset, skip
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(InputStream s)
public int readLength() throws 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.
IOException
- If invalid format foundpublic BigInteger readBigInteger() throws IOException
IOException
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.