com.mindbright.asn1
public class ASN1DER extends java.lang.Object implements ASN1Encoder, ASN1Decoder
Modifier and Type | Field and Description |
---|---|
protected static byte[] |
BOOL_FALSE |
protected static byte[] |
BOOL_TRUE |
protected static int |
INDEFINITE_LEN |
Constructor and Description |
---|
ASN1DER() |
Modifier and Type | Method and Description |
---|---|
int |
decode(java.io.InputStream in,
ASN1Object object) |
boolean |
decodeBoolean(java.io.InputStream in,
int len) |
java.math.BigInteger |
decodeInteger(java.io.InputStream in,
int len) |
int[] |
decodeLength(java.io.InputStream in) |
void |
decodeNull(java.io.InputStream in,
int len) |
int[] |
decodeOID(java.io.InputStream in,
int len) |
byte[] |
decodeString(java.io.InputStream in,
int len,
ASN1String obj) |
void |
decodeStructure(java.io.InputStream in,
int len,
ASN1Structure struct) |
int |
decodeTag(java.io.InputStream in) |
void |
decodeValue(java.io.InputStream in,
int tag,
int len,
ASN1Object object) |
int |
encode(java.io.OutputStream out,
ASN1Object object) |
int |
encodeBoolean(java.io.OutputStream out,
boolean b) |
int |
encodeInteger(java.io.OutputStream out,
java.math.BigInteger i) |
int |
encodeLength(java.io.OutputStream out,
int len) |
int |
encodeNull(java.io.OutputStream out) |
int |
encodeOID(java.io.OutputStream out,
int[] oid) |
int |
encodeString(java.io.OutputStream out,
byte[] string) |
int |
encodeStructure(java.io.OutputStream out,
ASN1Structure struct) |
static void |
main(java.lang.String[] argv) |
protected static final byte[] BOOL_TRUE
protected static final byte[] BOOL_FALSE
protected static final int INDEFINITE_LEN
public int encode(java.io.OutputStream out, ASN1Object object) throws java.io.IOException
encode
in interface ASN1Encoder
java.io.IOException
public int encodeLength(java.io.OutputStream out, int len) throws java.io.IOException
java.io.IOException
public int encodeBoolean(java.io.OutputStream out, boolean b) throws java.io.IOException
encodeBoolean
in interface ASN1Encoder
java.io.IOException
public int encodeInteger(java.io.OutputStream out, java.math.BigInteger i) throws java.io.IOException
encodeInteger
in interface ASN1Encoder
java.io.IOException
public int encodeNull(java.io.OutputStream out) throws java.io.IOException
encodeNull
in interface ASN1Encoder
java.io.IOException
public int encodeOID(java.io.OutputStream out, int[] oid) throws java.io.IOException
encodeOID
in interface ASN1Encoder
java.io.IOException
public int encodeString(java.io.OutputStream out, byte[] string) throws java.io.IOException
encodeString
in interface ASN1Encoder
java.io.IOException
public int encodeStructure(java.io.OutputStream out, ASN1Structure struct) throws java.io.IOException
encodeStructure
in interface ASN1Encoder
java.io.IOException
public int decode(java.io.InputStream in, ASN1Object object) throws java.io.IOException
decode
in interface ASN1Decoder
java.io.IOException
public int decodeTag(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public int[] decodeLength(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public void decodeValue(java.io.InputStream in, int tag, int len, ASN1Object object) throws java.io.IOException
decodeValue
in interface ASN1Decoder
java.io.IOException
public boolean decodeBoolean(java.io.InputStream in, int len) throws java.io.IOException
decodeBoolean
in interface ASN1Decoder
java.io.IOException
public java.math.BigInteger decodeInteger(java.io.InputStream in, int len) throws java.io.IOException
decodeInteger
in interface ASN1Decoder
java.io.IOException
public void decodeNull(java.io.InputStream in, int len) throws java.io.IOException
decodeNull
in interface ASN1Decoder
java.io.IOException
public int[] decodeOID(java.io.InputStream in, int len) throws java.io.IOException
decodeOID
in interface ASN1Decoder
java.io.IOException
public byte[] decodeString(java.io.InputStream in, int len, ASN1String obj) throws java.io.IOException
decodeString
in interface ASN1Decoder
java.io.IOException
public void decodeStructure(java.io.InputStream in, int len, ASN1Structure struct) throws java.io.IOException
decodeStructure
in interface ASN1Decoder
java.io.IOException
public static void main(java.lang.String[] argv)