pasn
Class ASN1Identifier

java.lang.Object
  extended by pasn.ASN1Object
      extended by pasn.ASN1SimpleObject<ASN1IdentifierValue>
          extended by pasn.ASN1Identifier
All Implemented Interfaces:
ASN1DefaultValuedObject, ASN1EncodingSpecificObject, ASN1GenericObject, ASN1PrimitiveObject<ASN1IdentifierValue>, ASN1Resetable
Direct Known Subclasses:
ASN1ObjectIdentifier, ASN1RelativeIdentifier

public abstract class ASN1Identifier
extends ASN1SimpleObject<ASN1IdentifierValue>

An ASN.1 Identifier expresses a sequence of integer components separated with dots ("."). This sequence identifies an object type which generally follows this identication.

Example: 123.234.345 (meaningless Identifier)

Author:
ncottin

Constructor Summary
ASN1Identifier(int type)
           Creates an empty Identifier of the given type
 
Method Summary
 int getMaximumSize()
           
 int getMinimumSize()
           
 java.lang.String getStringDefaultValue()
           
 java.lang.String getStringValue()
           
 boolean hasDefaultValue()
           
 boolean hasValue()
           
 boolean isValueDefault()
           
 void reset()
           Removes the value (or list or set of values) of this ASN.1 object.
 void setDecodedValue(java.lang.Object value)
           
 void setDefaultValue(java.lang.String value)
           
 void setMaximumSize(int maxSize)
           
 void setMinimumSize(int minSize)
           
 void setValue(int[] value)
           
 void setValue(java.lang.String value)
           Initializes this ASN.1 IDENTIFIER with the given string representation of a sequence of integers separated with dots
 java.lang.String toString()
           Returns the current internal IDENTIFIER value expressed as a string.
 
Methods inherited from class pasn.ASN1SimpleObject
equals, getDefaultValue, getValue, getValueOrDefault, hasValueOrDefault, setDefaultValue, setValue
 
Methods inherited from class pasn.ASN1Object
getAsnClass, getSpecificEncoding, getSpecificEncoding, getType, hasSpecificEncodings, setSpecificEncoding
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface pasn.ASN1PrimitiveObject
validateConstraints
 
Methods inherited from interface pasn.ASN1GenericObject
getASN1Name, getAsnClass, getType
 
Methods inherited from interface pasn.ASN1EncodingSpecificObject
getSpecificEncoding, hasSpecificEncodings
 

Constructor Detail

ASN1Identifier

public ASN1Identifier(int type)

Creates an empty Identifier of the given type

Parameters:
type - An ASN.1 type that represents an Identifier, such as ASN1Constants.RELATIVE_OID or ASN1Constants.OBJECT_IDENTIFIER
Method Detail

setMinimumSize

public final void setMinimumSize(int minSize)

getMinimumSize

public final int getMinimumSize()

setMaximumSize

public final void setMaximumSize(int maxSize)

getMaximumSize

public final int getMaximumSize()

setValue

public final void setValue(int[] value)
                    throws ASN1ConstraintException
Throws:
ASN1ConstraintException

setValue

public final void setValue(java.lang.String value)
                    throws ASN1ConstraintException

Initializes this ASN.1 IDENTIFIER with the given string representation of a sequence of integers separated with dots

Parameters:
value - A sequence of integers that represents an object identifier. This sequence may be null or empty (zero-lengthed): in this case, this ASN.1 object is initialized so that it holds no internal value. If this sequence holds at least one value, each integer value must be positive. If not, the initialization process fails and the current internal value is left unchanged
Throws:
ASN1ConstraintException - The provided value does not represent a valid IDENTIFIER, such as 123.234.345. In this case, the previous internal value is left unchanged

setDefaultValue

public final void setDefaultValue(java.lang.String value)
                           throws ASN1ConstraintException
Throws:
ASN1ConstraintException

getStringValue

public final java.lang.String getStringValue()

getStringDefaultValue

public final java.lang.String getStringDefaultValue()

isValueDefault

public final boolean isValueDefault()

reset

public final void reset()
Description copied from interface: ASN1Resetable

Removes the value (or list or set of values) of this ASN.1 object. This applies to simple and structured ASN.1 objects


hasValue

public final boolean hasValue()

hasDefaultValue

public final boolean hasDefaultValue()

setDecodedValue

public final void setDecodedValue(java.lang.Object value)
                           throws ASN1FormatException,
                                  ASN1ConstraintException
Throws:
ASN1FormatException
ASN1ConstraintException

toString

public final java.lang.String toString()

Returns the current internal IDENTIFIER value expressed as a string. Each value is separated with a dot (".")

Overrides:
toString in class java.lang.Object
Returns:
A string that contains at least one integer value or null if this ASN.1 IDENTIFIER object has no value