|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.objsys.asn1j.runtime.Asn1Type
public abstract class Asn1Type
This is the base class for all ASN.1 built-in types.
Field Summary | |
---|---|
static short |
BIT_STRING
BIT_STRING type code = 3 |
static short |
BMPString
BMPString type code = 30 |
static short |
BOOLEAN
BOOLEAN type code = 1 |
static short |
DATE
DATE type code = 31 |
static short |
DATE_TIME
DATE-TIME type code = 33 |
static short |
DURATION
DURATION type code = 34 |
static short |
ENUMERATED
ENUMERATED type code = 10 |
static short |
EOC
EOC type code = 0 |
static short |
EXTERNAL
EXTERNAL type code = 8 |
static short |
GeneralString
GeneralString type code = 27 |
static short |
GeneralTime
GeneralTime type code = 24 |
static short |
GraphicString
GraphicString type code = 25 |
static short |
IA5String
IA5String type code = 22 |
static short |
INTEGER
INTEGER type code = 2 |
protected java.lang.String |
mAsn1TypeName
This type's ASN.1 name. |
static short |
NULL
NULL type code = 5 |
static short |
NumericString
NumericString type code = 18 |
static short |
OBJECT_IDENTIFIER
OBJECT_IDENTIFIER type code = 6 |
static short |
ObjectDescriptor
ObjectDescriptor type code = 7 |
static short |
OCTET_STRING
OCTET_STRING type code = 4 |
static short |
OID_IRI
OID-IRI type code = 35 |
static short |
OpenType
OpenType type code = 99 |
static short |
PrintableString
PrintableString type code = 19 |
static short |
REAL
REAL type code = 9 |
static short |
RELATIVE_OID_IRI
RELATIVE-OID-IRI type code = 35 |
static short |
RelativeOID
RELATIVE_OID type code = 13 |
static short |
SEQUENCE
SEQUENCE type code = 16 |
static short |
SET
SET type code = 17 |
static short |
T61String
T61String type code = TeletexString |
static short |
TeletexString
TeletexString type code = 20 |
static short |
TIME
TIME type code = 14 |
static short |
TIME_OF_DAY
TIME-OF-DAY type code = 32 |
static short |
UniversalString
type code= 28 |
static short |
UTCTime
UTCTime type code = 23 |
static short |
UTF8String
UTF8String type code = 12 |
static short |
VideotexString
VideotexString type code = 21 |
static short |
VisibleString
VisibleString type code = 26 |
Constructor Summary | |
---|---|
Asn1Type()
|
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
void |
decode(Asn1BerDecodeBuffer buffer)
This method is used to decode a message that is encoded in BER or DER format. |
void |
decode(Asn1BerDecodeBuffer buffer,
boolean explicit,
int implicitLength)
This method is used to decode a message that is encoded in BER or DER format. |
static Asn1Type |
decode(Asn1BerDecodeBuffer buffer,
java.lang.Object decoder,
boolean explicit,
int implicitLength)
Decode a value from the given buffer, using the given decoder. |
void |
decode(Asn1PerDecodeBuffer buffer)
This method is the base implementation of the standard Packed Encoding Rules (PER) decode method. |
static Asn1Type |
decode(Asn1PerDecodeBuffer buffer,
java.lang.Object decoder)
Decode a value from the given buffer, using the given decoder. |
void |
decode(java.lang.Object reader,
java.io.InputStream byteStream)
This method declaration is the signature of the standard XML Encoding Rules (XER) decode method. |
void |
decode(java.lang.Object reader,
java.lang.String xmlURI)
This method declaration is the signature of the standard XML Encoding Rules (XER) decode method. |
void |
decodeXML(java.lang.String buffer,
java.lang.String attrs)
This method decodes the XML content of a simple type. |
int |
encode(Asn1BerEncodeBuffer buffer)
This method is used to encode a message in BER or DER format. |
int |
encode(Asn1BerEncodeBuffer buffer,
boolean explicit)
This method is used to encode this data type in BER or DER format. |
void |
encode(Asn1BerOutputStream out,
boolean explicit)
This method writes to the stream an encoded ASN.1 type value including the UNIVERSAL tag value and length if explicit tagging is specified. |
void |
encode(Asn1PerEncodeBuffer buffer)
This method is the base implementation of the standard Packed Encoding Rules (PER) encode method. |
void |
encode(Asn1PerOutputStream out)
This method is the base implementation of the standard Packed Encoding Rules (PER) encode method using output stream. |
void |
encode(Asn1XerEncoder buffer)
This method is the base implementation of the standard XML Encoding Rules (XER) encode method. |
void |
encode(Asn1XerEncoder buffer,
java.lang.String elemName)
This method is the base implementation of the standard XML Encoding Rules (XER) encode method. |
boolean |
equals(Asn1Type obj)
Return true if the two objects are equal. |
java.lang.String |
getAsn1TypeName()
Returns the ASN.1 specification type name for this type. |
int |
getLength()
This method will return the length of types that can be bound by a size constraint (BIT STRING, OCTET STRING, character string, and SEQUENCE OF/SET OF). |
static java.lang.String |
getTypeName(short typeCode)
The static getTypeName method will convert a type code into a type name as defined in the X.680 standard.. |
int |
hashCode()
Returns the hash code of the object. |
void |
indent(java.io.PrintStream out,
int level)
This method will indent three spaces in the given print stream. |
boolean |
isOpenType()
Returns open type mode for XML encoding/decoding. |
protected static int |
matchTag(Asn1BerDecodeBuffer buffer,
Asn1Tag tag)
This method will compare the next parsed tag with the given tag value. |
protected static int |
matchTag(Asn1BerDecodeBuffer buffer,
short tagClass,
short tagForm,
int tagIDCode)
This method will compare the next parsed tag with the given tag value. |
void |
pdiag(java.lang.String s)
This is a diagnostics print method. |
void |
print(java.io.PrintStream out,
java.lang.String varName,
int level)
This method will format and output a primitive value to the given print stream. |
static void |
setKey(byte[] rtkey)
|
void |
setOpenType()
Sets open type mode for XML encoding/decoding. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short EOC
public static final short BOOLEAN
public static final short INTEGER
public static final short BIT_STRING
public static final short OCTET_STRING
public static final short NULL
public static final short OBJECT_IDENTIFIER
public static final short ObjectDescriptor
public static final short EXTERNAL
public static final short REAL
public static final short ENUMERATED
public static final short UTF8String
public static final short RelativeOID
public static final short TIME
public static final short SEQUENCE
public static final short SET
public static final short NumericString
public static final short PrintableString
public static final short TeletexString
public static final short T61String
public static final short VideotexString
public static final short IA5String
public static final short UTCTime
public static final short GeneralTime
public static final short GraphicString
public static final short VisibleString
public static final short GeneralString
public static final short UniversalString
public static final short BMPString
public static final short DATE
public static final short TIME_OF_DAY
public static final short DATE_TIME
public static final short DURATION
public static final short OID_IRI
public static final short RELATIVE_OID_IRI
public static final short OpenType
protected transient java.lang.String mAsn1TypeName
Constructor Detail |
---|
public Asn1Type()
Method Detail |
---|
public void decode(Asn1BerDecodeBuffer buffer, boolean explicit, int implicitLength) throws Asn1Exception, java.io.IOException
decode
in interface Asn1TypeIF
buffer
- Decode message buffer objectexplicit
- Flag indicating explicit tag should be parsed
from the encoded type.implicitLength
- Length of the contents field (only required
if explicit is false).
Asn1Exception
java.io.IOException
public void decode(Asn1BerDecodeBuffer buffer) throws Asn1Exception, java.io.IOException
buffer
- Decode message buffer object
Asn1Exception
java.io.IOException
public static Asn1Type decode(Asn1BerDecodeBuffer buffer, java.lang.Object decoder, boolean explicit, int implicitLength) throws Asn1Exception, java.io.IOException
buffer
- decoder
- One of the following:
Asn1BerDecoder
. In this case, decoding will be performed
using the Asn1Decoder interface.
Class
for a subclass of Asn1Type
. In this case,
the class will be instantiated and used to perform decoding.
The instantiated object is returned.
explicit
- if true
, the value to be decoded is preceded
by a tag and length, which must first be decoded. Otherwise,
implicitLength provides the length of the value to be decoded.implicitLength
- The length of the value to be decoded if explicit
was given as false
.
Asn1Exception
java.io.IOException
public int encode(Asn1BerEncodeBuffer buffer, boolean explicit) throws Asn1Exception
encode
in interface Asn1TypeIF
buffer
- Encode message buffer objectexplicit
- Flag indicating explicit tag should be added
to the encoded type.
Asn1Exception
public int encode(Asn1BerEncodeBuffer buffer) throws Asn1Exception
buffer
- Decode message buffer object
Asn1Exception
public static Asn1Type decode(Asn1PerDecodeBuffer buffer, java.lang.Object decoder) throws Asn1Exception, java.io.IOException
buffer
- decoder
- One of the following:
Asn1PerDecoder
. In this case, decoding will be performed
using the Asn1Decoder interface.
Class
for a subclass of Asn1Type
. In this case,
the class will be instantiated and used to perform decoding.
The instantiated object is returned.
Asn1Exception
java.io.IOException
public void decode(Asn1PerDecodeBuffer buffer) throws Asn1Exception, java.io.IOException
decode
in interface Asn1TypeIF
buffer
- PER Encode message buffer object
Asn1Exception
java.io.IOException
public void encode(Asn1PerEncodeBuffer buffer) throws Asn1Exception, java.io.IOException
encode
in interface Asn1TypeIF
buffer
- PER Encode message buffer object
Asn1Exception
java.io.IOException
public void encode(Asn1XerEncoder buffer) throws Asn1Exception, java.io.IOException
encode
in interface Asn1TypeIF
buffer
- XER Encode message buffer object
java.io.IOException
- Any exception thrown by the underlying stream.
Asn1Exception
- Thrown, if operation is failed.public void encode(Asn1XerEncoder buffer, java.lang.String elemName) throws Asn1Exception, java.io.IOException
encode
in interface Asn1TypeIF
buffer
- XER Encode message buffer objectelemName
- XML element name of item
java.io.IOException
- Any exception thrown by the underlying stream.
Asn1Exception
- Thrown, if operation is failed.public void decode(java.lang.Object reader, java.lang.String xmlURI) throws Asn1Exception, java.io.IOException
decode
in interface Asn1TypeIF
reader
- XML reader objectxmlURI
- URI of a source
java.io.IOException
- An IO exception from the parser, possibly from a
byte stream or character stream supplied by the
application.
Asn1Exception
- Thrown, if operation is failed.public void decode(java.lang.Object reader, java.io.InputStream byteStream) throws Asn1Exception, java.io.IOException
decode
in interface Asn1TypeIF
reader
- XML reader objectbyteStream
- Input byte stream object
java.io.IOException
- An IO exception from the parser, possibly from a
byte stream or character stream supplied by the
application.
Asn1Exception
- Thrown, if operation is failed.public void decodeXML(java.lang.String buffer, java.lang.String attrs) throws Asn1Exception
decodeXML
in interface Asn1TypeIF
buffer
- String containing data to be decodedattrs
- Attributes string from element tag
Asn1Exception
public void setOpenType()
setOpenType
in interface Asn1TypeIF
public boolean isOpenType()
isOpenType
in interface Asn1TypeIF
public int getLength() throws Asn1InvalidLengthException
Asn1InvalidLengthException
public static void setKey(byte[] rtkey)
protected static int matchTag(Asn1BerDecodeBuffer buffer, short tagClass, short tagForm, int tagIDCode) throws Asn1Exception, java.io.IOException
buffer
- Decode message buffer objecttagClass
- Tag class value (UNIV, APPL, CTXT, or PRIV)tagForm
- Tag form value (PRIM or CONS)tagIDCode
- Tag identifier code
Asn1TagMatchFailedException
- Tag is not equal to expected value
Asn1Exception
java.io.IOException
protected static int matchTag(Asn1BerDecodeBuffer buffer, Asn1Tag tag) throws Asn1Exception, java.io.IOException
buffer
- Decode message buffer objecttag
- Tag value to compare
Asn1TagMatchFailedException
- Tag is not equal to expected value
Asn1Exception
java.io.IOException
public void indent(java.io.PrintStream out, int level)
out
- Print streamlevel
- Indentation level (# of spaces is 3 x this number)public void pdiag(java.lang.String s)
s
- diagnostics message to be printed.public void print(java.io.PrintStream out, java.lang.String varName, int level)
print
in interface Asn1TypeIF
out
- Print output streamvarName
- Name of variablelevel
- Indentation levelpublic static java.lang.String getTypeName(short typeCode)
typeCode
- Type code to be convertedpublic void encode(Asn1BerOutputStream out, boolean explicit) throws Asn1Exception, java.io.IOException
encode
in interface Asn1TypeIF
out
- BER Output Stream objectexplicit
- Flag indicating explicit tagging should be done
java.io.IOException
- Any exception thrown by the underlying OutputStream.
Asn1Exception
- Thrown, if operation is failed.public void encode(Asn1PerOutputStream out) throws Asn1Exception, java.io.IOException
encode
in interface Asn1TypeIF
out
- PER Output Stream object
java.io.IOException
- Any exception thrown by the Asn1PerOutputStream.
Asn1Exception
- Thrown, if operation is failed.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the object's class does not
support the Cloneable
interface. Subclasses
that override the clone
method can also
throw this exception to indicate that an instance cannot
be cloned.Cloneable
public boolean equals(Asn1Type obj)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getAsn1TypeName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |