COM.claymoresystems.cert

Class DERUtils


public class DERUtils
extends java.lang.Object

Simple DER encode utilities. Eventually we'd like to use one common ASN.1 engine for everything

Field Summary

static byte
BIT_STRING
static byte
BOOLEAN
static byte
IA5STRING
static byte
INTEGER
static byte
OCTET_STRING
static byte
OID
static byte
PRINTABLE_STRING
static byte
SEQUENCE
static byte
SET
static byte
T61STRING
static byte
UTCTIME

Method Summary

static byte[]
decodeAny(InputStream is)
static byte[]
decodeBitString(InputStream is)
static BitSet
decodeBitStringX(InputStream is)
static boolean
decodeBoolean(InputStream is)
static BigInteger
decodeInteger(InputStream is)
static int
decodeIntegerX(InputStream is)
static byte[]
decodeOID(InputStream is)
static byte[]
decodeOctetString(InputStream is)
static byte[]
decodeSequence(InputStream is)
static void
encodeBitString(byte[] in, OutputStream os)
static void
encodeIA5String(String in, OutputStream os)
static void
encodeInteger(BigInteger i, OutputStream os)
static void
encodeOID(String oid, OutputStream os)
static void
encodeOID(byte[] in, OutputStream os)
static void
encodePrintableString(String in, OutputStream os)
static void
encodeSequence(ByteArrayOutputStream is, OutputStream os)
static void
encodeSequence(byte[] in, OutputStream os)
static void
encodeSet(ByteArrayOutputStream is, OutputStream os)
static void
encodeSet(byte[] in, OutputStream os)
static void
encodeUTCTime(long time, OutputStream os)
static void
encodeUnknownString(String in, OutputStream os)
static boolean
isTag(int tag, InputStream is)

Field Details

BIT_STRING

public static final byte BIT_STRING

Field Value:
3


BOOLEAN

public static final byte BOOLEAN

Field Value:
1


IA5STRING

public static final byte IA5STRING

Field Value:
22


INTEGER

public static final byte INTEGER

Field Value:
2


OCTET_STRING

public static final byte OCTET_STRING

Field Value:
4


OID

public static final byte OID

Field Value:
6


PRINTABLE_STRING

public static final byte PRINTABLE_STRING

Field Value:
19


SEQUENCE

public static final byte SEQUENCE

Field Value:
48


SET

public static final byte SET

Field Value:
49


T61STRING

public static final byte T61STRING

Field Value:
20


UTCTIME

public static final byte UTCTIME

Field Value:
23

Method Details

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


Copyright (c) 1999-2001 Claymore Systems, Inc., All Rights Reserved.