ActionScript 3 Cryptography Library | All Packages | All Classes | Index | Frames No Frames |
ASN1Type

Package | com.hurlant.util.asn1.type
Class | public class ASN1Type
Inheritance | ASN1Type 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

| Property | Defined 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

| Method | Defined By
--- | --- | ---
|  | ASN1Type(tag:int) | ASN1Type
|  | clone():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

| Method | Defined By
--- | --- | ---
|  | fromDefaultValue():* | 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

| Constant | Defined 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

defaultTag | property

`public var defaultTag:Number`

defaultValue | property |

`public var defaultValue:* = null`

explicitClass | property |

`public var explicitClass:int = 0`

explicitTag | property |

`public var explicitTag:Number = NaN`

extract | property |

`public var extract:Boolean = false`

implicitClass | property |

`public var implicitClass:int = 0`

implicitTag | property |

`public var implicitTag:Number = NaN`

optional | property |

`public var optional:Boolean = false`

parsedTag | property |

`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

ANY | Constant

`public static const ANY:int = -1`

APPLICATION | Constant |

`public static const APPLICATION:int = 1`

BIT_STRING | Constant |

`public static const BIT_STRING:int = 3`

BMP_STRING | Constant |

`public static const BMP_STRING:int = 30`

BOOLEAN | Constant |

`public static const BOOLEAN:int = 1`

CHOICE | Constant |

`public static const CHOICE:int = -2`

CONTEXT | Constant |

`public static const CONTEXT:int = 2`

EMBEDDED | Constant |

`public static const EMBEDDED:int = 11`

ENUMERATED | Constant |

`public static const ENUMERATED:int = 10`

EXTERNAL | Constant |

`public static const EXTERNAL:int = 8`

GENERAL_STRING | Constant |

`public static const GENERAL_STRING:int = 27`

GENERALIZED_TIME | Constant |

`public static const GENERALIZED_TIME:int = 24`

GRAPHIC_STRING | Constant |

`public static const GRAPHIC_STRING:int = 25`

IA5_STRING | Constant |

`public static const IA5_STRING:int = 22`

INTEGER | Constant |

`public static const INTEGER:int = 2`

NULL | Constant |

`public static const NULL:int = 5`

NUMERIC_STRING | Constant |

`public static const NUMERIC_STRING:int = 18`

OCTET_STRING | Constant |

`public static const OCTET_STRING:int = 4`

ODT | Constant |

`public static const ODT:int = 7`

OID | Constant |

`public static const OID:int = 6`

PRINTABLE_STRING | Constant |

`public static const PRINTABLE_STRING:int = 19`

PRIVATE | Constant |

`public static const PRIVATE:int = 3`

REAL | Constant |

`public static const REAL:int = 9`

RESERVED | Constant |

`public static const RESERVED:int = 0`

ROID | Constant |

`public static const ROID:int = 13`

SEQUENCE | Constant |

`public static const SEQUENCE:int = 16`

SET | Constant |

`public static const SET:int = 17`

TELETEX_STRING | Constant |

`public static const TELETEX_STRING:int = 20`

UNIVERSAL | Constant |

`public static const UNIVERSAL:int = 0`

UNIVERSAL_STRING | Constant |

`public static const UNIVERSAL_STRING:int = 28`

UNSTRUCTURED_NAME | Constant |

`public static const UNSTRUCTURED_NAME:int = 31`

UTC_TIME | Constant |

`public static const UTC_TIME:int = 23`

UTF8STRING | Constant |

`public static const UTF8STRING:int = 12`

VIDEOTEX_STRING | Constant |

`public static const VIDEOTEX_STRING:int = 21`

VISIBLE_STRING | Constant |

`public static const VISIBLE_STRING:int = 26`

Mon May 20 2013, 09:16 PM +02:00