XCMS Toolkit

schemajic.model
Class ASN1OpenType

java.lang.Object
  extended by schemajic.model.ASN1Value
      extended by schemajic.model.ASN1OpenType
Direct Known Subclasses:
DEROpenType, XEROpenType

public abstract class ASN1OpenType
extends ASN1Value

Models the abstract concept of a value of an ASN.1 "open type".

The open type represents the valid ASN.1 encoding of any ASN.1 type. It is important to remember that values of this class hold a complete ASN.1 *encoding* - the complete encoding of a value of some ASN.1 type.

If a value of ASN1OpenType is contained within another ASN.1 value ( SEQUENCE, SET OF, etc ) and that value is encoded, the encoding contained in the ASN1OpenType is simply inserted into the current encoding as is. Therefore, it is possible to create an encoding that contains values of differing encoding rules, which may or may not be legal with respect to the protocol being implemented.

Version:
1.00 - 2006/02/09
Author:
support@phillipgriffin.com

Constructor Summary
ASN1OpenType()
          Constructor for ASN1OpenType.
ASN1OpenType(ASN1Value decodedValue)
          SConstructor for ASN1OpenType with initialization value parameter.
 
Method Summary
 java.lang.Object accept(ValueVisitor visitor, java.lang.Object object)
          Accepts a visit from the ValueVisitor
abstract  boolean compareEncodingTo(ASN1ObjectIdentifier oid)
          Defines how a method would compare the encoding of an open type value to the encoding of the type of a specified ASN.1 information object identifier.
 Type getAsn1Type()
          Returns some ASN.1 type in its encoded form (an open type).
 ASN1Value getDecodedValue()
          Returns the current decoded value of an ASN.1 type.
abstract  byte[] getEncodedValue()
          Defines how a method would get the encoded value of an open type, the value of an ASN.1 type in its encoded form.
abstract  java.lang.String getEncodingAsString()
          Defines how a method would get the encoded value of an open type, the value of an ASN.1 type in its encoded form, as a string.
abstract  byte[] getRawBinaryValue()
          Defines how a method would get the 'value' of a TLV encoding of an ASN.1 type as an unstructured (opaque) binary value.
 boolean isDecoded()
          Returns boolean true if the current value is not null, otherwise returns false.
 void setDecodedValue(ASN1Value value)
          Sets the current decoded value of an ASN.1 type to the provided value.
abstract  void setEncodedValue(byte[] encoding)
          Defines how a method would set the encoded value of an open type, the value of an ASN.1 type in its encoded form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASN1OpenType

public ASN1OpenType()
Constructor for ASN1OpenType.


ASN1OpenType

public ASN1OpenType(ASN1Value decodedValue)
SConstructor for ASN1OpenType with initialization value parameter.

Parameters:
decodedValue - a decoded value that becomes the current value
Method Detail

isDecoded

public boolean isDecoded()
Returns boolean true if the current value is not null, otherwise returns false.


getDecodedValue

public ASN1Value getDecodedValue()
Returns the current decoded value of an ASN.1 type.


setDecodedValue

public void setDecodedValue(ASN1Value value)
Sets the current decoded value of an ASN.1 type to the provided value.

Parameters:
value - provided value to be set as the current value

getEncodedValue

public abstract byte[] getEncodedValue()
Defines how a method would get the encoded value of an open type, the value of an ASN.1 type in its encoded form.


setEncodedValue

public abstract void setEncodedValue(byte[] encoding)
Defines how a method would set the encoded value of an open type, the value of an ASN.1 type in its encoded form.


getEncodingAsString

public abstract java.lang.String getEncodingAsString()
Defines how a method would get the encoded value of an open type, the value of an ASN.1 type in its encoded form, as a string.


compareEncodingTo

public abstract boolean compareEncodingTo(ASN1ObjectIdentifier oid)
                                   throws java.io.IOException
Defines how a method would compare the encoding of an open type value to the encoding of the type of a specified ASN.1 information object identifier.

If the encoded value in this open type is NOT the expected value of ASN.1 type OBJECT IDENTIFIER, throws an illegal argument exception.

Parameters:
oid - an ASN.1 information object identifier value
Throws:
java.io.IOException

getRawBinaryValue

public abstract byte[] getRawBinaryValue()
                                  throws DecodingException,
                                         java.io.IOException
Defines how a method would get the 'value' of a TLV encoding of an ASN.1 type as an unstructured (opaque) binary value.

Throws:
DecodingException
java.io.IOException

accept

public java.lang.Object accept(ValueVisitor visitor,
                               java.lang.Object object)
                        throws VisitorException
Accepts a visit from the ValueVisitor

Specified by:
accept in class ASN1Value
Parameters:
visitor - the function applicator (mapper), which knows how to process the given object type and apply appropriate operations to the elements of this type of object
object - an object to be visited
Returns:
a visit to the provided object
Throws:
VisitorException

getAsn1Type

public Type getAsn1Type()
Returns some ASN.1 type in its encoded form (an open type).

Overrides:
getAsn1Type in class ASN1Value

XCMS Toolkit


Copyright © 2005-2006 GRIFFIN Consulting. All Rights Reserved.