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
BOOLEAN
public static final byte BOOLEAN
IA5STRING
public static final byte IA5STRING
INTEGER
public static final byte INTEGER
OCTET_STRING
public static final byte OCTET_STRING
OID
public static final byte OID
PRINTABLE_STRING
public static final byte PRINTABLE_STRING
SEQUENCE
public static final byte SEQUENCE
SET
public static final byte SET
T61STRING
public static final byte T61STRING
UTCTIME
public static final byte UTCTIME
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