This class is for the tagged object type. A nested tag is
allowed. A tagged element contains another BER element.
ANY
public static final int ANY
- -3
APPLICATION
public static final int APPLICATION
- 64
BITSTRING
public static final int BITSTRING
- 3
BOOLEAN
public static final int BOOLEAN
Possible element types.
- 1
CHOICE
public static final int CHOICE
- -2
CONSTRUCTED
public static final int CONSTRUCTED
- 32
CONTEXT
public static final int CONTEXT
- 128
ENUMERATED
public static final int ENUMERATED
- 10
EOC
public static final int EOC
Possible tags.
- 0
EXOP_REQ_OID
public static final int EXOP_REQ_OID
- 0
EXOP_REQ_VALUE
public static final int EXOP_REQ_VALUE
- 1
EXOP_RES_OID
public static final int EXOP_RES_OID
- 10
EXOP_RES_VALUE
public static final int EXOP_RES_VALUE
- 11
GENERALSTRING
public static final int GENERALSTRING
- 27
GRAPHICSTRING
public static final int GRAPHICSTRING
- 25
IA5STRING
public static final int IA5STRING
- 22
INTEGER
public static final int INTEGER
- 2
MRA_DNATTRS
public static final int MRA_DNATTRS
- 4
MRA_OID
public static final int MRA_OID
- 1
MRA_TYPE
public static final int MRA_TYPE
- 2
MRA_VALUE
public static final int MRA_VALUE
- 3
NULL
public static final int NULL
- 5
NUMERICSTRING
public static final int NUMERICSTRING
- 18
OBJECTID
public static final int OBJECTID
- 6
OCTETSTRING
public static final int OCTETSTRING
- 4
PRIMITIVE
public static final int PRIMITIVE
- 0
PRINTABLESTRING
public static final int PRINTABLESTRING
- 19
PRIVATE
public static final int PRIVATE
- 192
REAL
public static final int REAL
- 9
SASLCONTEXT
public static final int SASLCONTEXT
- 160
SEQUENCE
public static final int SEQUENCE
- 48
SET
public static final int SET
- 49
SK_MATCHRULE
public static final int SK_MATCHRULE
- 0
SK_REVERSE
public static final int SK_REVERSE
- 1
SR_ATTRTYPE
public static final int SR_ATTRTYPE
- 0
TAG
public static final int TAG
Internal (non-transmitted) tags.
- -1
TELETEXSTRING
public static final int TELETEXSTRING
- 20
UNIVERSAL
public static final int UNIVERSAL
- 0
UTCTIME
public static final int UTCTIME
- 23
VIDEOTEXSTRING
public static final int VIDEOTEXSTRING
- 21
VISIBLESTRING
public static final int VISIBLESTRING
- 26
byteToHexString
public String byteToHexString(byte value)
Converts byte to hex string.
value
- byte value
- string representation of Hex String
getElement
public static BERElement getElement(BERTagDecoder decoder,
InputStream stream,
int[] bytes_read)
throws IOException
Gets a ber element from the input stream.
decoder
- decoder for application specific BERstream
- source of ber encodingbytes_read
- array of 1 int; value incremented by
number of bytes read from stream
getType
public int getType()
Gets the element type.
- element type.
readLengthOctets
public static int readLengthOctets(InputStream stream,
int[] bytes_read)
throws IOException
Reads and decodes a length byte and then that many octets
from the input stream.
stream
- input stream from which to readbytes_read
- array of 1 int; value incremented by
number of bytes read from stream
- length of contents or -1 if indefinite length.
readTwosComplement
protected int readTwosComplement(InputStream stream,
int[] bytes_read,
int length)
throws IOException
Reads the two's complement representation of an integer from
an input stream.
stream
- source of databytes_read
- number of bytes readlength
- number of bytes to be read
- the integer value as two's complement.
readUnsignedBinary
protected int readUnsignedBinary(InputStream stream,
int[] bytes_read,
int length)
throws IOException
Reads a number of bytes from an input stream and form
an integer..
stream
- source of databytes_read
- number of bytes readlength
- number of bytes to be read (1 to 4)
- the value of the data as two's complement.
sendDefiniteLength
public static void sendDefiniteLength(OutputStream stream,
int num_content_octets)
throws IOException
Writes length octets (definite length only) to stream.
Uses shortform whenever possible.
stream
- output stream to write tonum_content_octets
- value to be encode into length octets
toString
public String toString()
Gets the string representation.
- string representation of an element.
write
public void write(OutputStream stream)
throws IOException
Sends the BER encoding directly to a stream.
stream
- output stream