|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.asn1.ASN1Object | +--iaik.asn1.ConstructedType | +--iaik.asn1.UNKNOWN
This class is used to decode unknown PRIVATE or APPLICATION ASN.1 types.
This class only supports decoding facilities for properly handling any DER encoded ASN.1 objects with an unknown tag specification. No encoding mechanism are provided.
Whenever the DerCoder
parses a tag it does not
know of, it creates a UNKNOWN
object and supplies it with the
content octets read from the decoding.
In this way, an application may ask for the pure content bytes by means
of the getValue()
method.
Fields inherited from class iaik.asn1.ConstructedType |
content_count, content_data |
Fields inherited from class iaik.asn1.ASN1Object |
asnType, constructed, encode_listener, indefinite_length, isStringType, stream_mode |
Constructor Summary | |
UNKNOWN()
Creates an empty UNKNOWN ASN.1 type. |
Method Summary | |
Object |
clone()
Returns a clone of this UNKNOWN. |
protected void |
decode(int length,
InputStream is)
Decodes the value of an UMKNOWN ASN.1 object from the given input stream. |
protected void |
encode(OutputStream os)
Not implemented. |
ASN |
getBaseAsnType()
Returns the base ASN.1 type of this UNKNOWN ASN.1 object. |
Object |
getValue()
Returns the value of this UNKNOWN ASN.1 object as a byte array. |
void |
setValue(Object object)
Sets the value of this object to value. |
String |
toString()
Returns a string that represents the contents of this UNKNOWN ASN.1 type. |
Methods inherited from class iaik.asn1.ConstructedType |
addComponent, addComponent, addEncodeListener, countComponents, getComponentAt, getComponents, removeComponent, removeComponent, setComponent |
Methods inherited from class iaik.asn1.ASN1Object |
addEncodeListener, encodeObject, getAsnType, indefiniteLength, isA, isConstructed, isStringType, setIndefiniteLength |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public UNKNOWN()
Method Detail |
public Object clone()
clone
in class ConstructedType
public void setValue(Object object)
setValue
in class ConstructedType
value
- the new value as a byte arraypublic Object getValue()
getValue
in class ConstructedType
public ASN getBaseAsnType()
This method may be used to query for the ASN.1 type (tag class
and tag value) of the base ASN1Object this UNKNOWN represents.
Note that the DerCoder creates an UNKNOWN object for any ASN.1 object
it does not know of (i.e. has no registered implementation for
the corresponding ASN.1 type). An UNKNOWN object is allocated the tag
value 0 since it is not used in ASN.1 at all. Therefoe, when calling method
getAsnType
of an UNKNOWN
object you anytime will get an ASN1 type representing tag class
UNIVERSAL with tag number 0 (since this is the ASN.1 type of the
UNKNOWN implementation). To get the ASN.1 type of the base ASN.1
object you may call this getBaseAsnType
method.
ASN
protected void encode(OutputStream os)
encode
in class ConstructedType
iaik.asn1.ConstructedType
os
- the output stream to which to write the dataIOException
- if an error occurs while reading from the streamprotected void decode(int length, InputStream is) throws IOException
DerCoder
parses
a tag it does not know of, it creates an UNKNOWN
object
and uses this decode
method for reading the raw content
octets from the decoding stream.decode
in class ConstructedType
length
- the already decoded length, i.e. number of the bytes occupied
by the value of the UNKNOWN ASN.1 object to be decodedis
- the input stream from which the der encoded data is read inIOException
- if there is a problem with the InputStreampublic String toString()
toString
in class ASN1Object
ASN1Object.toString()
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |