|
XCMS Toolkit | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectschemajic.encoder.TagEncoder
public class TagEncoder
Supports ASN.1 tagged type encodings.
| Constructor Summary | |
|---|---|
TagEncoder()
Constructor for TagEncoder. |
|
| Method Summary | |
|---|---|
int |
calculateEncodedLength(Tag tag)
Determine the encoded length of a given tag. |
int |
calculateEncodedLength(TagList tags)
Calculate the total length in bytes of the tags in a TagList and check that tag values are in the expected range. |
void |
encode(TagList tags,
int pc,
java.io.OutputStream out)
Encodes a list of tags to an output stream. |
protected void |
encodeLongTag(int tag,
int tClass,
int tPC,
java.io.OutputStream out)
Throws a RuntimeException when a long tag is detected,
since this tag format is not supported. |
protected void |
encodeShortTag(int tag,
java.io.OutputStream out)
Write out an ASN.1 tag. |
void |
encodeTags(TagList tags,
int pc,
java.io.OutputStream out)
Encode a list of ASN.1 tags. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TagEncoder()
TagEncoder.
| Method Detail |
|---|
public void encode(TagList tags,
int pc,
java.io.OutputStream out)
throws EncodingException
tags - a list of ASN.1 tagspc - counterout - output stream target of encoding
EncodingException
public int calculateEncodedLength(TagList tags)
throws java.lang.RuntimeException
Note that the tags need not be recognized, since the ASN.1 standards evolve and a new tag may from time to time be assigned after a using application has been deployed.
tags - a list of ASN.1 tags
java.lang.RuntimeException
public int calculateEncodedLength(Tag tag)
throws java.lang.RuntimeException
Note that only one-byte tags are supported at this time.
tag - a tag whose length is to be measured
java.lang.RuntimeException
public void encodeTags(TagList tags,
int pc,
java.io.OutputStream out)
throws java.io.IOException
tags - a list of ASN.1 tagspc - counterout - output stream target of encoding
java.io.IOException
protected void encodeShortTag(int tag,
java.io.OutputStream out)
throws java.io.IOException
tag - a single ASN.1 tagout - output stream target of encoding
java.io.IOException
protected void encodeLongTag(int tag,
int tClass,
int tPC,
java.io.OutputStream out)
throws java.lang.RuntimeException
RuntimeException when a long tag is detected,
since this tag format is not supported. This method then is a
placeholder for future support.
A 'tag number' was > 30, and therefore must be encoded in multiple octets, each with 7 significant bits.
Convert an array of 8-bit bytes, with bit 8 being significant, to an array of 8-bit bytes with bit 7 being significant. Bit 8 will always be 1 unless the byte is the last in the array, where bit 8 will be 0.
Example 1:
11111111 11111111
100000011 11111111 01111111
Example 2:
10000001 10000001
10000001 10000001 00000001
{ 1 2 840 113549 }
06 06 2a 86 48 86 f7 0d
06062a864886f70d
java.lang.RuntimeException
|
XCMS Toolkit | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||