public abstract class Asn1Type extends java.lang.Object implements Asn1TypeIF, java.io.Serializable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
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 |
mNonParameterizedTypeName
This type's NonParameterizedTypeName.
|
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 and Description |
---|
Asn1Type() |
Modifier and Type | Method and Description |
---|---|
static void |
_setKey(byte[] rtkey) |
static void |
_setLicLocation(java.lang.String path) |
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.
|
static Asn1Type |
decode(Asn1BerDecodeBuffer buffer,
Asn1OpenTypeField openTypeField,
boolean explicit,
int implicitLength)
Decode an open type field value from the given buffer.
|
void |
decode(Asn1BerDecodeBuffer buffer,
boolean explicit,
int implicitLength)
This method is used to decode a message that is encoded in
BER or DER format.
|
void |
decode(Asn1JsonDecodeBuffer buffer)
Decode this type from the given buffer.
|
static Asn1Type |
decode(Asn1JsonDecodeBuffer buffer,
Asn1OpenTypeField openTypeField)
Decode an open type field value from the given buffer.
|
void |
decode(Asn1MderDecodeBuffer buffer)
This method decodes this object's data from an MDER encoding.
|
void |
decode(Asn1NasDecodeBuffer buffer)
This method is the base implementation of the NAS decode method.
|
static Asn1Type |
decode(Asn1NasDecodeBuffer buffer,
Asn1OpenTypeField openTypeField)
Decode an open type field value from the given buffer.
|
void |
decode(Asn1OerDecodeBuffer buffer)
This method decodes an ASN.1 value into this object, following the
Octet Encoding Rules (OER).
|
static Asn1Type |
decode(Asn1OerDecodeBuffer buffer,
Asn1OpenTypeField openTypeField)
Decode an open type field value from the given buffer.
|
void |
decode(Asn1PerDecodeBuffer buffer)
This method is the base implementation of the standard Packed
Encoding Rules (PER) decode method.
|
static Asn1Type |
decode(Asn1PerDecodeBuffer buffer,
Asn1OpenTypeField openTypeField)
Decode an open type field value from the given buffer.
|
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(Asn1JsonOutputStream outstream)
Encode this type to the given output stream.
|
void |
encode(Asn1MderOutputStream buffer)
This method encodes this object's data to an MDER encoding.
|
void |
encode(Asn1MderOutputStream buffer,
boolean useCachedLength)
This method encodes this object's data to an MDER encoding.
|
void |
encode(Asn1NasEncodeBuffer buffer)
This method is the base implementation of the NAS encode method.
|
void |
encode(Asn1OerEncodeBuffer buffer)
This method encodes the ASN.1 value represented by this object, following
the Octet Encoding Rules (OER).
|
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.
|
void |
encode(Asn1XmlEncoder buffer,
java.lang.String elemName,
java.lang.String nsPrefix)
This method is the base implementation of the standard XML
Encoding as specified in the XML schema standard(asn2xsd).
|
void |
encodeAsOpenType(Asn1OerEncodeBuffer buffer)
This method encodes the ASN.1 value represented by this object, following
the Octet Encoding Rules (OER), as the value for the actual type of an
open type (i.e., it precedes its encoding with a length).
|
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).
|
java.lang.String |
getNonParameterizedTypeName()
Return this type's NonParameterizedTypeName, if set.
|
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.PrintWriter out,
int level)
This method will indent three spaces in the given print stream.
|
void |
indent(java.lang.StringBuilder sb,
int level)
This method will indent three spaces in the given string builder.
|
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) |
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.
|
void |
print(java.io.PrintWriter out,
java.lang.String varName,
int level)
This method will format and output a primitive value to the
given print writer.
|
void |
print(java.lang.StringBuilder sb,
java.lang.String varName,
int level)
This method will format and output a primitive value to the given
string builder.
|
void |
setNonParameterizedTypeName(java.lang.String value)
Set this type's NonParameterizedTypeName.
|
void |
setOpenType()
Sets open type mode for XML encoding/decoding.
|
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 mNonParameterizedTypeName
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 objectAsn1Exception
java.io.IOException
public static Asn1Type decode(Asn1BerDecodeBuffer buffer, Asn1OpenTypeField openTypeField, boolean explicit, int implicitLength) throws Asn1Exception, java.io.IOException
buffer
- openTypeField
- Describes the open type being decoded.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 objectAsn1Exception
public static Asn1Type decode(Asn1OerDecodeBuffer buffer, Asn1OpenTypeField openTypeField) throws Asn1Exception, java.io.IOException
buffer
- openTypeField
- Describes the open type being decoded.Asn1Exception
java.io.IOException
public void decode(Asn1OerDecodeBuffer buffer) throws java.io.IOException
java.io.IOException
public void encode(Asn1OerEncodeBuffer buffer) throws java.io.IOException
buffer
- Encode message buffer objectjava.io.IOException
public final void encodeAsOpenType(Asn1OerEncodeBuffer buffer) throws java.io.IOException
buffer
- Encode message buffer objectjava.io.IOException
public static Asn1Type decode(Asn1NasDecodeBuffer buffer, Asn1OpenTypeField openTypeField) throws java.io.IOException
buffer
- openTypeField
- Describes the actual type for the open type.java.io.IOException
public void decode(Asn1NasDecodeBuffer buffer) throws java.io.IOException
buffer
- NAS decode buffer objectjava.io.IOException
public static Asn1Type decode(Asn1PerDecodeBuffer buffer, Asn1OpenTypeField openTypeField) throws Asn1Exception, java.io.IOException
buffer
- openTypeField
- Describes the actual type for the open type.Asn1Exception
java.io.IOException
public void decode(Asn1PerDecodeBuffer buffer) throws Asn1Exception, java.io.IOException
decode
in interface Asn1TypeIF
buffer
- PER Encode message buffer objectAsn1Exception
java.io.IOException
public void encode(Asn1PerEncodeBuffer buffer) throws Asn1Exception, java.io.IOException
encode
in interface Asn1TypeIF
buffer
- PER Encode message buffer objectAsn1Exception
java.io.IOException
public void encode(Asn1NasEncodeBuffer buffer) throws java.io.IOException
buffer
- NAS Encode message buffer objectjava.io.IOException
public void encode(Asn1XmlEncoder buffer, java.lang.String elemName, java.lang.String nsPrefix) throws Asn1Exception, java.io.IOException
buffer
- XML Encode message buffer objectelemName
- XML element name of itemnsPrefix
- Element namespace prefix valuejava.io.IOException
- Any exception thrown by the underlying stream.Asn1Exception
- Thrown, if operation is failed.public void encode(Asn1XerEncoder buffer) throws Asn1Exception, java.io.IOException
encode
in interface Asn1TypeIF
buffer
- XER Encode message buffer objectjava.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 itemjava.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 sourcejava.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 objectjava.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 tagAsn1Exception
public void setOpenType()
setOpenType
in interface Asn1TypeIF
public boolean isOpenType()
isOpenType
in interface Asn1TypeIF
public void decode(Asn1MderDecodeBuffer buffer) throws Asn1Exception, java.io.IOException
decode
in interface Asn1TypeIF
buffer
- MDER Decode message buffer objectjava.io.IOException
- Any exception thrown by the underlying stream.Asn1Exception
- Thrown, if operation is failed.public void encode(Asn1MderOutputStream buffer) throws Asn1Exception, java.io.IOException
encode
in interface Asn1TypeIF
buffer
- MDER Encode message buffer objectjava.io.IOException
- Any exception thrown by the underlying stream.Asn1Exception
- Thrown, if operation is failed.public void encode(Asn1MderOutputStream buffer, boolean useCachedLength) throws Asn1Exception, java.io.IOException
buffer
- MDER Encode message buffer objectuseCachedLength
- Indicates whether cached length of encoding
should be used. In general, only generated code should pass
true.java.io.IOException
- Any exception thrown by the underlying stream.Asn1Exception
- Thrown, if operation is failed.public void decode(Asn1JsonDecodeBuffer buffer) throws java.io.IOException
buffer
- JSON decode bufferjava.io.IOException
public void encode(Asn1JsonOutputStream outstream) throws java.io.IOException
outstream
- JSON output streamjava.io.IOException
public static Asn1Type decode(Asn1JsonDecodeBuffer buffer, Asn1OpenTypeField openTypeField) throws Asn1Exception, java.io.IOException
buffer
- openTypeField
- Describes the open type being decoded.Asn1Exception
java.io.IOException
public int getLength() throws Asn1InvalidLengthException
Asn1InvalidLengthException
public static void _setKey(byte[] rtkey)
public static void _setLicLocation(java.lang.String path)
public java.lang.String getNonParameterizedTypeName()
public void setNonParameterizedTypeName(java.lang.String value)
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 codeAsn1TagMatchFailedException
- Tag is not equal to expected valueAsn1Exception
java.io.IOException
protected static int matchTag(Asn1BerDecodeBuffer buffer, Asn1Tag tag) throws Asn1Exception, java.io.IOException
buffer
- Decode message buffer objecttag
- Tag value to compareAsn1TagMatchFailedException
- Tag is not equal to expected valueAsn1Exception
java.io.IOException
public void indent(java.io.PrintWriter out, int level)
out
- Print streamlevel
- Indentation level (# of spaces is 3 x this number)public void indent(java.lang.StringBuilder sb, int level)
sb
- The output string builder.level
- The indentation level; the number of spaces is three
times this number.public void pdiag(java.lang.String s)
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 void print(java.io.PrintWriter out, java.lang.String varName, int level)
print
in interface Asn1TypeIF
out
- Print writer for outputvarName
- Name of variablelevel
- Indentation levelpublic void print(java.lang.StringBuilder sb, java.lang.String varName, int level)
print
in interface Asn1TypeIF
sb
- The String Builder used for output.varName
- The variable name.level
- The indentation level.public 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 donejava.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 objectjava.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()