Simple DER encode utilities. Eventually we'd like to use one
common ASN.1 engine for everything
BIT_STRING
public static final byte BIT_STRING
- 3
BOOLEAN
public static final byte BOOLEAN
- 1
IA5STRING
public static final byte IA5STRING
- 22
INTEGER
public static final byte INTEGER
- 2
OCTET_STRING
public static final byte OCTET_STRING
- 4
OID
public static final byte OID
- 6
PRINTABLE_STRING
public static final byte PRINTABLE_STRING
- 19
SEQUENCE
public static final byte SEQUENCE
- 48
SET
public static final byte SET
- 49
T61STRING
public static final byte T61STRING
- 20
UTCTIME
public static final byte UTCTIME
- 23
decodeAny
public static byte[] decodeAny(InputStream is)
throws IOException
decodeBitString
public static byte[] decodeBitString(InputStream is)
throws IOException
decodeBitStringX
public static BitSet decodeBitStringX(InputStream is)
throws IOException
decodeBoolean
public static boolean decodeBoolean(InputStream is)
throws IOException
decodeInteger
public static BigInteger decodeInteger(InputStream is)
throws IOException
decodeIntegerX
public static int decodeIntegerX(InputStream is)
throws IOException
decodeOID
public static byte[] decodeOID(InputStream is)
throws IOException
decodeOctetString
public static byte[] decodeOctetString(InputStream is)
throws IOException
decodeSequence
public static byte[] decodeSequence(InputStream is)
throws IOException
encodeBitString
public static void encodeBitString(byte[] in,
OutputStream os)
throws IOException
encodeIA5String
public static void encodeIA5String(String in,
OutputStream os)
throws IOException
encodeInteger
public static void encodeInteger(BigInteger i,
OutputStream os)
throws IOException
encodeOID
public static void encodeOID(String oid,
OutputStream os)
throws IOException
encodeOID
public static void encodeOID(byte[] in,
OutputStream os)
throws IOException
encodePrintableString
public static void encodePrintableString(String in,
OutputStream os)
throws IOException
encodeSequence
public static void encodeSequence(ByteArrayOutputStream is,
OutputStream os)
throws IOException
encodeSequence
public static void encodeSequence(byte[] in,
OutputStream os)
throws IOException
encodeSet
public static void encodeSet(ByteArrayOutputStream is,
OutputStream os)
throws IOException
encodeSet
public static void encodeSet(byte[] in,
OutputStream os)
throws IOException
encodeUTCTime
public static void encodeUTCTime(long time,
OutputStream os)
throws IOException
encodeUnknownString
public static void encodeUnknownString(String in,
OutputStream os)
throws IOException
isTag
public static boolean isTag(int tag,
InputStream is)
throws IOException