|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--de.bb.security.Asn1
Some helpfull static functions to handle ASN.1 with BER/DER
| Field Summary | |
static byte |
BIT_STRING
|
static byte |
IA5String
|
static byte |
INTEGER
|
static byte[] |
newSeq
|
static byte[] |
newSet
|
static byte[] |
nul
|
static byte |
NULL
|
static byte |
OBJECT_IDENTIFIER
|
static byte |
OCTET_STRING
|
static byte |
PrintableString
|
static byte |
SEQUENCE
|
static byte |
SET
|
static byte |
T61String
|
static byte |
UTCTime
|
| Constructor Summary | |
Asn1()
|
|
| Method Summary | |
static byte[] |
addTo(byte[] b,
byte[] a)
Add an ASN.1 element to a sequence or a set. |
static byte[] |
copy(byte[] b)
Get a copy of the current object |
static byte[] |
copy(byte[] b,
int off)
Get a copy of the current object |
protected static boolean |
equals(byte[] a,
int ai,
byte[] b,
int bi,
int len)
|
static byte[] |
getData(byte[] b)
Get the content of the current object |
static byte[] |
getData(byte[] b,
int off)
Get the content of the current object |
static int |
getInt(byte[] b,
int[] s)
Get an Integer from a sequence. |
static int |
getLen(byte[] b)
Get the total length of an object incl. header |
static int |
getLen(byte[] b,
int off)
Get the total length of an object incl. header |
static byte[] |
getSeq(byte[] b,
int[] s,
int off)
Get some ASN.1 data from a sequence. |
static byte[] |
makeASN1(byte[] b,
int typ)
Creates a new byte array containing an ASN.1 element. |
static byte[] |
makeASN1(int i,
int typ)
creates a new byte array containing an ASN.1 element |
static byte[] |
makeASN1(java.lang.String s,
int typ)
Creates a new byte array containing an ASN.1 element. |
static byte[] |
nullEncode(byte[] b)
|
static int |
searchSequence(byte[] b,
byte[] what)
search the sequence containing the searched element |
static int |
searchSequence(byte[] b,
int[] off,
byte[] what,
int end)
search the sequence containing the searched element |
static int |
searchSequence(byte[] b,
int off,
byte[] what)
search the sequence containing the searched element |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final byte INTEGER
public static final byte BIT_STRING
public static final byte OCTET_STRING
public static final byte NULL
public static final byte OBJECT_IDENTIFIER
public static final byte SEQUENCE
public static final byte SET
public static final byte PrintableString
public static final byte T61String
public static final byte IA5String
public static final byte UTCTime
public static final byte[] newSeq
public static final byte[] newSet
public static final byte[] nul
| Constructor Detail |
public Asn1()
| Method Detail |
public static byte[] makeASN1(java.lang.String s,
int typ)
s - the content of the new ASN.1 element.typ - the kind of the new ASN.1 element.
public static byte[] makeASN1(int i,
int typ)
i - the value of the new ASN.1 elementtyp - the kind of the new ASN.1 element
public static byte[] makeASN1(byte[] b,
int typ)
b - the bytes of the new ASN.1 element.typ - the kind of the new ASN.1 element.
public static byte[] addTo(byte[] b,
byte[] a)
b - the bytes of the sequence or set.a - the bytes which are added.public static int getLen(byte[] b)
b - the bytes of the object.
public static int getLen(byte[] b,
int off)
b - the bytes of the object.off - - offset into the byte arraypublic static byte[] getData(byte[] b)
b - the bytes of the object.
public static byte[] getData(byte[] b,
int off)
b - the bytes of the object.off - - offset into the byte arraypublic static byte[] copy(byte[] b)
b - the bytes of the object.
public static byte[] copy(byte[] b,
int off)
b - the bytes of the object.off - - offset into the byte array
public static final byte[] getSeq(byte[] b,
int[] s,
int off)
b - the sequence which is searched.s - the path to the searched element.off - an offset into b.
public static final int getInt(byte[] b,
int[] s)
b - the sequence which is searched.s - the path to the searched element.
public static final int searchSequence(byte[] b,
byte[] what)
b - a byte array containing the sequencewhat - the element which is searched
public static final int searchSequence(byte[] b,
int off,
byte[] what)
b - a byte array containing the sequencewhat - the element which is searched
public static final int searchSequence(byte[] b,
int[] off,
byte[] what,
int end)
b - - a byte array containing the sequenceoff - - an offest into the byte arraywhat - - the element which is searchedend - - end of range in b to usepublic static byte[] nullEncode(byte[] b)
protected static final boolean equals(byte[] a,
int ai,
byte[] b,
int bi,
int len)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||