Methods Summary |
---|
public abstract boolean | checkTag(int identifier)Tests provided identifier.
|
public final java.lang.Object | decode(byte[] encoded)
return decode(new DerInputStream(encoded));
|
public final java.lang.Object | decode(byte[] encoded, int offset, int encodingLen)
return decode(new DerInputStream(encoded, offset, encodingLen));
|
public final java.lang.Object | decode(java.io.InputStream in)
return decode(new DerInputStream(in));
|
public abstract java.lang.Object | decode(BerInputStream in)Decodes ASN.1 type.
|
public final byte[] | encode(java.lang.Object object)
DerOutputStream out = new DerOutputStream(this, object);
return out.encoded;
|
public abstract void | encodeASN(BerOutputStream out)Encodes ASN.1 type.
|
public abstract void | encodeContent(BerOutputStream out)
|
protected java.lang.Object | getDecodedObject(BerInputStream in)Creates decoded object.
Derived classes should override this method to provide creation for a
selected class of objects during decoding.
The default implementation returns an object created by decoding stream.
return in.content;
|
public int | getEncodedLength(BerOutputStream out) //FIXME name
//tag length
int len = 1; //FIXME tag length = 1. what about long form?
//for (; tag > 0; tag = tag >> 8, len++);
// length length :-)
len++;
if (out.length > 127) {
len++;
for (int cur = out.length >> 8; cur > 0; len++) {
cur = cur >> 8;
}
}
len += out.length;
return len;
|
public abstract void | setEncodingContent(BerOutputStream out)
|
public java.lang.String | toString()
// TODO decide whether this method is necessary
//FIXME fix performance
return this.getClass().getName() + "(tag: 0x" //$NON-NLS-1$
+ Integer.toHexString(0xff & this.id) + ")"; //$NON-NLS-1$
|
public final void | verify(byte[] encoded)
DerInputStream decoder = new DerInputStream(encoded);
decoder.setVerify();
decode(decoder);
|
public final void | verify(java.io.InputStream in)
DerInputStream decoder = new DerInputStream(in);
decoder.setVerify();
decode(decoder);
|