|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasn.DerUtilities
| Constructor Summary | |
DerUtilities()
|
|
| Method Summary | |
static byte[] |
encodeLength(int len)
Returns an array of bytes containing the DER encoding of the specified length. |
static int |
encodeLength(int len,
byte[] buf,
int offset)
|
static byte[] |
encodeTag(int tag,
boolean constructed)
Returns an array of bytes containing the DER encoding of the specified tag. |
static int |
encodeTag(int tag,
boolean constructed,
byte[] buf,
int offset)
Stores the bytes of the DER encoding of the specified tag into buf starting at the position offset.
|
static int |
getEncodedLengthSize(int len)
Returns the number of bytes needed to store the DER encoding of the specified length. |
static int |
getEncodedTagSize(int tag)
Returns the number of bytes needed to store the BER/DER encoding of the specified tag. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DerUtilities()
| Method Detail |
public static byte[] encodeTag(int tag,
boolean constructed)
constructed is
true; otherwise it is primitive.
public static int encodeTag(int tag,
boolean constructed,
byte[] buf,
int offset)
buf starting at the position offset.
The encoding is constructed if constructed is
true; otherwise it is primitive.
tag - the ASN.1 tag to be DER encoded.constructed - true if the encoding should be
constructed; false for primitive encoding.buf - the buffer into which the bytes of DER encoding of the tag
are stored.offset - the index at which the encoded bytes are stored into
the buffer.public static byte[] encodeLength(int len)
len - the length to be encoded.
IllegalArgumentException - if the length is negative.
public static int encodeLength(int len,
byte[] buf,
int offset)
public static int getEncodedTagSize(int tag)
tag - the tag for wich the needed byte number is computed.
IllegalArgumentException - if the specified length is negative.public static int getEncodedLengthSize(int len)
len - the length for wich the needed byte number is computed.
IllegalArgumentException - if the specified length is negative.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||