Packagecom.hurlant.util.asn1.type
Classpublic class ASN1Type
InheritanceASN1Type Inheritance Object
Subclasses AnyType, BitStringType, BooleanType, ChoiceType, GeneralizedTimeType, IntegerType, NullType, OctetStringType, OIDType, SequenceType, SetType, StringType, UTCTimeType

This class represents a chunk of ASN1 definition. This is used by parser to know what to look for.



Public Properties
 PropertyDefined By
  defaultTag : Number
ASN1Type
  defaultValue : * = null
ASN1Type
  explicitClass : int = 0
ASN1Type
  explicitTag : Number = NaN
ASN1Type
  extract : Boolean = false
ASN1Type
  implicitClass : int = 0
ASN1Type
  implicitTag : Number = NaN
ASN1Type
  optional : Boolean = false
ASN1Type
  parsedTag : Number
ASN1Type
Public Methods
 MethodDefined By
  
ASN1Type(tag:int)
ASN1Type
  
ASN1Type
  
fromDER(s:ByteArray, size:int):*
Read an ASN-1 value from a ByteArray and return it If we can't read a value that matches our type, we return null;
ASN1Type
  
matches(type:int, classValue:int, length:int):Boolean
ASN1Type
Protected Methods
 MethodDefined By
  
ASN1Type
  
fromDERContent(s:ByteArray, length:int):*
ASN1Type
  
readDERLength(s:ByteArray):int
ASN1Type
  
readDERTag(s:ByteArray, classValue:int, constructed:Boolean = false, any:Boolean = false):int
ASN1Type
Public Constants
 ConstantDefined By
  ANY : int = -1
[static]
ASN1Type
  APPLICATION : int = 1
[static]
ASN1Type
  BIT_STRING : int = 3
[static]
ASN1Type
  BMP_STRING : int = 30
[static]
ASN1Type
  BOOLEAN : int = 1
[static]
ASN1Type
  CHOICE : int = -2
[static]
ASN1Type
  CONTEXT : int = 2
[static]
ASN1Type
  EMBEDDED : int = 11
[static]
ASN1Type
  ENUMERATED : int = 10
[static]
ASN1Type
  EXTERNAL : int = 8
[static]
ASN1Type
  GENERALIZED_TIME : int = 24
[static]
ASN1Type
  GENERAL_STRING : int = 27
[static]
ASN1Type
  GRAPHIC_STRING : int = 25
[static]
ASN1Type
  IA5_STRING : int = 22
[static]
ASN1Type
  INTEGER : int = 2
[static]
ASN1Type
  NULL : int = 5
[static]
ASN1Type
  NUMERIC_STRING : int = 18
[static]
ASN1Type
  OCTET_STRING : int = 4
[static]
ASN1Type
  ODT : int = 7
[static]
ASN1Type
  OID : int = 6
[static]
ASN1Type
  PRINTABLE_STRING : int = 19
[static]
ASN1Type
  PRIVATE : int = 3
[static]
ASN1Type
  REAL : int = 9
[static]
ASN1Type
  RESERVED : int = 0
[static]
ASN1Type
  ROID : int = 13
[static]
ASN1Type
  SEQUENCE : int = 16
[static]
ASN1Type
  SET : int = 17
[static]
ASN1Type
  TELETEX_STRING : int = 20
[static]
ASN1Type
  UNIVERSAL : int = 0
[static]
ASN1Type
  UNIVERSAL_STRING : int = 28
[static]
ASN1Type
  UNSTRUCTURED_NAME : int = 31
[static]
ASN1Type
  UTC_TIME : int = 23
[static]
ASN1Type
  UTF8STRING : int = 12
[static]
ASN1Type
  VIDEOTEX_STRING : int = 21
[static]
ASN1Type
  VISIBLE_STRING : int = 26
[static]
ASN1Type
Property Detail
defaultTagproperty
public var defaultTag:Number

defaultValueproperty 
public var defaultValue:* = null

explicitClassproperty 
public var explicitClass:int = 0

explicitTagproperty 
public var explicitTag:Number = NaN

extractproperty 
public var extract:Boolean = false

implicitClassproperty 
public var implicitClass:int = 0

implicitTagproperty 
public var implicitTag:Number = NaN

optionalproperty 
public var optional:Boolean = false

parsedTagproperty 
public var parsedTag:Number

Constructor Detail
ASN1Type()Constructor
public function ASN1Type(tag:int)



Parameters
tag:int
Method Detail
clone()method
public function clone():ASN1Type

Returns
ASN1Type
fromDefaultValue()method 
protected function fromDefaultValue():*

Returns
*
fromDER()method 
public function fromDER(s:ByteArray, size:int):*

Read an ASN-1 value from a ByteArray and return it If we can't read a value that matches our type, we return null;

Parameters

s:ByteArray — a ByteArray containing some DER-encoded ASN-1 values.
 
size:int

Returns
* — an ASN1Value object representing the value read. or null.
fromDERContent()method 
protected function fromDERContent(s:ByteArray, length:int):*

Parameters

s:ByteArray
 
length:int

Returns
*
matches()method 
public function matches(type:int, classValue:int, length:int):Boolean

Parameters

type:int
 
classValue:int
 
length:int

Returns
Boolean
readDERLength()method 
protected function readDERLength(s:ByteArray):int

Parameters

s:ByteArray

Returns
int
readDERTag()method 
protected function readDERTag(s:ByteArray, classValue:int, constructed:Boolean = false, any:Boolean = false):int

Parameters

s:ByteArray
 
classValue:int (default = NaN)
 
constructed:Boolean (default = false)
 
any:Boolean (default = false)

Returns
int
Constant Detail
ANYConstant
public static const ANY:int = -1

APPLICATIONConstant 
public static const APPLICATION:int = 1

BIT_STRINGConstant 
public static const BIT_STRING:int = 3

BMP_STRINGConstant 
public static const BMP_STRING:int = 30

BOOLEANConstant 
public static const BOOLEAN:int = 1

CHOICEConstant 
public static const CHOICE:int = -2

CONTEXTConstant 
public static const CONTEXT:int = 2

EMBEDDEDConstant 
public static const EMBEDDED:int = 11

ENUMERATEDConstant 
public static const ENUMERATED:int = 10

EXTERNALConstant 
public static const EXTERNAL:int = 8

GENERAL_STRINGConstant 
public static const GENERAL_STRING:int = 27

GENERALIZED_TIMEConstant 
public static const GENERALIZED_TIME:int = 24

GRAPHIC_STRINGConstant 
public static const GRAPHIC_STRING:int = 25

IA5_STRINGConstant 
public static const IA5_STRING:int = 22

INTEGERConstant 
public static const INTEGER:int = 2

NULLConstant 
public static const NULL:int = 5

NUMERIC_STRINGConstant 
public static const NUMERIC_STRING:int = 18

OCTET_STRINGConstant 
public static const OCTET_STRING:int = 4

ODTConstant 
public static const ODT:int = 7

OIDConstant 
public static const OID:int = 6

PRINTABLE_STRINGConstant 
public static const PRINTABLE_STRING:int = 19

PRIVATEConstant 
public static const PRIVATE:int = 3

REALConstant 
public static const REAL:int = 9

RESERVEDConstant 
public static const RESERVED:int = 0

ROIDConstant 
public static const ROID:int = 13

SEQUENCEConstant 
public static const SEQUENCE:int = 16

SETConstant 
public static const SET:int = 17

TELETEX_STRINGConstant 
public static const TELETEX_STRING:int = 20

UNIVERSALConstant 
public static const UNIVERSAL:int = 0

UNIVERSAL_STRINGConstant 
public static const UNIVERSAL_STRING:int = 28

UNSTRUCTURED_NAMEConstant 
public static const UNSTRUCTURED_NAME:int = 31

UTC_TIMEConstant 
public static const UTC_TIME:int = 23

UTF8STRINGConstant 
public static const UTF8STRING:int = 12

VIDEOTEX_STRINGConstant 
public static const VIDEOTEX_STRING:int = 21

VISIBLE_STRINGConstant 
public static const VISIBLE_STRING:int = 26