asn1-pharser › "asn1" › ASN1
This will decode and build ASN.1 Currently supported tags are
- BitString
- ContextSpecific
- Integer
- ObjectIdentifier
- OctetString
- Sequence
- PrintableString
- UTF8String
- IA5String
- UTCTime
- ASN1
▸ bitString(frameTag
: bitStringFrame): BitString
Defined in asn1.ts:40
Parameters:
Name | Type |
---|---|
frameTag |
bitStringFrame |
Returns: BitString
▸ build(tagBuilder
: tagBuilderType): string
Defined in asn1.ts:28
Parameters:
Name | Type |
---|---|
tagBuilder |
tagBuilderType |
Returns: string
▸ contextSpecific(frameTag
: contextSpecificFrame): ContextSpecific
Defined in asn1.ts:52
Parameters:
Name | Type |
---|---|
frameTag |
contextSpecificFrame |
Returns: ContextSpecific
▸ decode(encoding
: Buffer): [string, Map‹string, buildMap›]
Defined in asn1.ts:23
Parameters:
Name | Type | Description |
---|---|---|
encoding |
Buffer | Buffer of DER encoded data |
Returns: [string, Map‹string, buildMap›]
formatted string of decoded, Map of decoded
▸ integer(frameTag
: integerFrame): Integer
Defined in asn1.ts:36
Parameters:
Name | Type |
---|---|
frameTag |
integerFrame |
Returns: Integer
▸ objectIdentifier(frameTag
: objectIdentifierFrame): ObjectIdentifier
Defined in asn1.ts:48
Parameters:
Name | Type |
---|---|
frameTag |
objectIdentifierFrame |
Returns: ObjectIdentifier
▸ octetString(frameTag
: octetStringFrame): OctetString
Defined in asn1.ts:44
Parameters:
Name | Type |
---|---|
frameTag |
octetStringFrame |
Returns: OctetString
▸ sequence(frameTag
: sequenceFrame): Sequence
Defined in asn1.ts:32
Parameters:
Name | Type |
---|---|
frameTag |
sequenceFrame |
Returns: Sequence
asn1-pharser › "decode" › Decode
- Decode
- bitString
- decode
- getLength
- getTag
- integerTag
- nonUniversal
- objectIdentifer
- octetStringTag
- sequenceTag
- universal
+ new Decode(): Decode
Defined in decode.ts:10
Returns: Decode
• buildMap: Map‹string, buildMap›
Defined in decode.ts:9
• decoded: string
Defined in decode.ts:7
• pre: number
Defined in decode.ts:8
• step: number
Defined in decode.ts:10
▸ bitString(encoding
: Buffer, count
: number): number
Defined in decode.ts:222
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
Returns: number
▸ decode(encoding
: Buffer): [string, Map‹string, buildMap›]
Defined in decode.ts:19
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
Returns: [string, Map‹string, buildMap›]
▸ getLength(encoding
: Buffer, count
: number): number[]
Defined in decode.ts:52
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
Returns: number[]
▸ getTag(encoding
: Buffer, count
: number): number
Defined in decode.ts:31
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
Returns: number
▸ integerTag(encoding
: Buffer, count
: number): number
Defined in decode.ts:244
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
Returns: number
▸ nonUniversal(encoding
: Buffer, count
: number, tag
: tagClassType): number
Defined in decode.ts:70
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
tag |
tagClassType |
Returns: number
▸ objectIdentifer(encoding
: Buffer, count
: number): number
Defined in decode.ts:157
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
Returns: number
▸ octetStringTag(encoding
: Buffer, count
: number): number
Defined in decode.ts:260
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
Returns: number
▸ sequenceTag(encoding
: Buffer, count
: number): number
Defined in decode.ts:124
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
Returns: number
▸ universal(encoding
: Buffer, count
: number): number
Defined in decode.ts:99
Parameters:
Name | Type |
---|---|
encoding |
Buffer |
count |
number |
Returns: number
asn1-pharser › "tagBuilders" › BitString
-
↳ BitString
+ new BitString(_frameTag
: bitStringFrame): BitString
Overrides TagBuilder.constructor
Defined in tagBuilders.ts:83
Parameters:
Name | Type |
---|---|
_frameTag |
bitStringFrame |
Returns: BitString
• _frameTag: bitStringFrame
Defined in tagBuilders.ts:86
• get coded(): Buffer
Inherited from TagBuilder.coded
Defined in tagBuilders.ts:64
Returns: Buffer
• get data(): Buffer‹›
Inherited from TagBuilder.data
Defined in tagBuilders.ts:33
Returns: Buffer‹›
• get dataLength(): number
Inherited from TagBuilder.dataLength
Defined in tagBuilders.ts:50
Returns: number
• get form(): form
Inherited from TagBuilder.form
Defined in tagBuilders.ts:45
Returns: form
• get length(): number
Inherited from TagBuilder.length
Defined in tagBuilders.ts:54
Returns: number
• get tag(): INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
Inherited from TagBuilder.tag
Defined in tagBuilders.ts:28
Returns: INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
• get tagClass(): tagClass
Inherited from TagBuilder.tagClass
Defined in tagBuilders.ts:41
Returns: tagClass
asn1-pharser › "tagBuilders" › ContextSpecific
-
↳ ContextSpecific
+ new ContextSpecific(_frameTag
: contextSpecificFrame): ContextSpecific
Overrides TagBuilder.constructor
Defined in tagBuilders.ts:168
Parameters:
Name | Type |
---|---|
_frameTag |
contextSpecificFrame |
Returns: ContextSpecific
• _frameTag: contextSpecificFrame
Defined in tagBuilders.ts:170
• get coded(): Buffer
Inherited from TagBuilder.coded
Defined in tagBuilders.ts:64
Returns: Buffer
• get data(): Buffer‹›
Inherited from TagBuilder.data
Defined in tagBuilders.ts:33
Returns: Buffer‹›
• get dataLength(): number
Inherited from TagBuilder.dataLength
Defined in tagBuilders.ts:50
Returns: number
• get form(): form
Inherited from TagBuilder.form
Defined in tagBuilders.ts:45
Returns: form
• get length(): number
Inherited from TagBuilder.length
Defined in tagBuilders.ts:54
Returns: number
• get tag(): number
Overrides TagBuilder.tag
Defined in tagBuilders.ts:176
Returns: number
• get tagClass(): tagClass
Inherited from TagBuilder.tagClass
Defined in tagBuilders.ts:41
Returns: tagClass
asn1-pharser › "tagBuilders" › Integer
-
↳ Integer
+ new Integer(_frameTag
: integerFrame): Integer
Overrides TagBuilder.constructor
Defined in tagBuilders.ts:75
Parameters:
Name | Type |
---|---|
_frameTag |
integerFrame |
Returns: Integer
• _frameTag: integerFrame
Defined in tagBuilders.ts:78
• get coded(): Buffer
Inherited from TagBuilder.coded
Defined in tagBuilders.ts:64
Returns: Buffer
• get data(): Buffer‹›
Inherited from TagBuilder.data
Defined in tagBuilders.ts:33
Returns: Buffer‹›
• get dataLength(): number
Inherited from TagBuilder.dataLength
Defined in tagBuilders.ts:50
Returns: number
• get form(): form
Inherited from TagBuilder.form
Defined in tagBuilders.ts:45
Returns: form
• get length(): number
Inherited from TagBuilder.length
Defined in tagBuilders.ts:54
Returns: number
• get tag(): INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
Inherited from TagBuilder.tag
Defined in tagBuilders.ts:28
Returns: INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
• get tagClass(): tagClass
Inherited from TagBuilder.tagClass
Defined in tagBuilders.ts:41
Returns: tagClass
asn1-pharser › "tagBuilders" › ObjectIdentifier
-
↳ ObjectIdentifier
+ new ObjectIdentifier(_frameTag
: objectIdentifierFrame): ObjectIdentifier
Overrides TagBuilder.constructor
Defined in tagBuilders.ts:98
Parameters:
Name | Type |
---|---|
_frameTag |
objectIdentifierFrame |
Returns: ObjectIdentifier
• _frameTag: objectIdentifierFrame
Defined in tagBuilders.ts:100
• get coded(): Buffer
Inherited from TagBuilder.coded
Defined in tagBuilders.ts:64
Returns: Buffer
• get data(): Buffer‹›
Inherited from TagBuilder.data
Defined in tagBuilders.ts:33
Returns: Buffer‹›
• get dataLength(): number
Inherited from TagBuilder.dataLength
Defined in tagBuilders.ts:50
Returns: number
• get form(): form
Inherited from TagBuilder.form
Defined in tagBuilders.ts:45
Returns: form
• get length(): number
Inherited from TagBuilder.length
Defined in tagBuilders.ts:54
Returns: number
• get tag(): INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
Inherited from TagBuilder.tag
Defined in tagBuilders.ts:28
Returns: INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
• get tagClass(): tagClass
Inherited from TagBuilder.tagClass
Defined in tagBuilders.ts:41
Returns: tagClass
▸ buildObjectId(): Buffer
Defined in tagBuilders.ts:105
Returns: Buffer
asn1-pharser › "tagBuilders" › OctetString
-
↳ OctetString
+ new OctetString(_frameTag
: octetStringFrame): OctetString
Overrides TagBuilder.constructor
Defined in tagBuilders.ts:91
Parameters:
Name | Type |
---|---|
_frameTag |
octetStringFrame |
Returns: OctetString
• _frameTag: octetStringFrame
Defined in tagBuilders.ts:93
• get coded(): Buffer
Inherited from TagBuilder.coded
Defined in tagBuilders.ts:64
Returns: Buffer
• get data(): Buffer‹›
Inherited from TagBuilder.data
Defined in tagBuilders.ts:33
Returns: Buffer‹›
• get dataLength(): number
Inherited from TagBuilder.dataLength
Defined in tagBuilders.ts:50
Returns: number
• get form(): form
Inherited from TagBuilder.form
Defined in tagBuilders.ts:45
Returns: form
• get length(): number
Inherited from TagBuilder.length
Defined in tagBuilders.ts:54
Returns: number
• get tag(): INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
Inherited from TagBuilder.tag
Defined in tagBuilders.ts:28
Returns: INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
• get tagClass(): tagClass
Inherited from TagBuilder.tagClass
Defined in tagBuilders.ts:41
Returns: tagClass
asn1-pharser › "tagBuilders" › Sequence
-
↳ Sequence
+ new Sequence(_frameTag
: sequenceFrame): Sequence
Overrides TagBuilder.constructor
Defined in tagBuilders.ts:150
Parameters:
Name | Type |
---|---|
_frameTag |
sequenceFrame |
Returns: Sequence
• _frameTag: sequenceFrame
Defined in tagBuilders.ts:152
• get coded(): Buffer
Inherited from TagBuilder.coded
Defined in tagBuilders.ts:64
Returns: Buffer
• get data(): Buffer‹›
Inherited from TagBuilder.data
Defined in tagBuilders.ts:33
Returns: Buffer‹›
• get dataLength(): number
Inherited from TagBuilder.dataLength
Defined in tagBuilders.ts:50
Returns: number
• get form(): form
Inherited from TagBuilder.form
Defined in tagBuilders.ts:45
Returns: form
• get length(): number
Inherited from TagBuilder.length
Defined in tagBuilders.ts:54
Returns: number
• get tag(): INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
Inherited from TagBuilder.tag
Defined in tagBuilders.ts:28
Returns: INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
• get tagClass(): tagClass
Inherited from TagBuilder.tagClass
Defined in tagBuilders.ts:41
Returns: tagClass
▸ buildData(): Buffer
Defined in tagBuilders.ts:158
Returns: Buffer
asn1-pharser › "tagBuilders" › TagBuilder
+ new TagBuilder(_frame
: tagFrameType, _tag
: tagType, _tagClass
: tagClassType): TagBuilder
Defined in tagBuilders.ts:11
Parameters:
Name | Type |
---|---|
_frame |
tagFrameType |
_tag |
tagType |
_tagClass |
tagClassType |
Returns: TagBuilder
• _frame: tagFrameType
Defined in tagBuilders.ts:13
• _tag: tagType
Defined in tagBuilders.ts:13
• _tagClass: tagClassType
Defined in tagBuilders.ts:13
• get coded(): Buffer
Defined in tagBuilders.ts:64
Returns: Buffer
• get data(): Buffer‹›
Defined in tagBuilders.ts:33
Returns: Buffer‹›
• get dataLength(): number
Defined in tagBuilders.ts:50
Returns: number
• get form(): form
Defined in tagBuilders.ts:45
Returns: form
• get length(): number
Defined in tagBuilders.ts:54
Returns: number
• get tag(): INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
Defined in tagBuilders.ts:28
Returns: INTEGER | BIT_STRING | OCTET_STRING | NULL | OBJECT_IDENTIFIER | UTF8String | SEQUENCE | SET | PrintableString | IA5String | UTCTime | GeneralizedTime | CUSTOM
• get tagClass(): tagClass
Defined in tagBuilders.ts:41
Returns: tagClass
▸ integerBuffer(int
: number): Buffer
Defined in tagBuilders.ts:18
Parameters:
Name | Type |
---|---|
int |
number |
Returns: Buffer
▸ integerHex(int
: number): string
Defined in tagBuilders.ts:22
Parameters:
Name | Type |
---|---|
int |
number |
Returns: string
asn1-pharser › "util" › form
• Constructed: = 0x1 << 5
Defined in util.ts:15
• Primitive: = 0
Defined in util.ts:14
asn1-pharser › "util" › mask
• bit8: = 0x01 << 7
Defined in util.ts:42
• form: = 0x01 << 5
Defined in util.ts:41
• tag: = 31
Defined in util.ts:39
• tagClass: = 0x03 << 6
Defined in util.ts:40
asn1-pharser › "util" › pre
• ****:
Defined in util.ts:46
• ** **:
Defined in util.ts:47
• ** **:
Defined in util.ts:48
• ** **:
Defined in util.ts:49
asn1-pharser › "util" › tag
- BIT_STRING
- CUSTOM
- GeneralizedTime
- IA5String
- INTEGER
- NULL
- OBJECT_IDENTIFIER
- OCTET_STRING
- PrintableString
- SEQUENCE
- SET
- UTCTime
- UTF8String
• BIT_STRING: = 3
Defined in util.ts:22
• CUSTOM: = 0
Defined in util.ts:33
• GeneralizedTime: = 24
Defined in util.ts:32
• IA5String: = 22
Defined in util.ts:30
• INTEGER: = 2
Defined in util.ts:21
• NULL: = 5
Defined in util.ts:24
• OBJECT_IDENTIFIER: = 6
Defined in util.ts:25
• OCTET_STRING: = 4
Defined in util.ts:23
• PrintableString: = 19
Defined in util.ts:29
• SEQUENCE: = 16
Defined in util.ts:27
• SET: = 17
Defined in util.ts:28
• UTCTime: = 23
Defined in util.ts:31
• UTF8String: = 12
Defined in util.ts:26
asn1-pharser › "util" › tagClass
• Application: = 0x1 << 6
Defined in util.ts:6
• Context_Specific: = 0x01 << 7
Defined in util.ts:7
• Private: = 0x03 << 6
Defined in util.ts:8
• Universal: = 0
Defined in util.ts:5
asn1-pharser › "util" › bitStringFrame
-
↳ bitStringFrame
• data: Buffer
Defined in util.ts:70
• form? : formType
Defined in util.ts:61
• length? : undefined | number
Inherited from tagFrame.length
Defined in util.ts:62
asn1-pharser › "util" › buildMap
-
↳ buildMap
• child? : Map‹string, buildMap›
Defined in util.ts:91
• children? : Map‹string, buildMap›
Defined in util.ts:92
• data? : Buffer
Defined in util.ts:63
• form? : formType
Defined in util.ts:61
• hex? : undefined | string
Defined in util.ts:94
• length? : undefined | number
Inherited from tagFrame.length
Defined in util.ts:62
• str? : undefined | string
Inherited from objectIdentifierFrame.str
Defined in util.ts:77
• value? : any
Defined in util.ts:93
asn1-pharser › "util" › contextSpecificFrame
-
↳ contextSpecificFrame
• child: tagBuilderType
Defined in util.ts:85
• data? : Buffer
Defined in util.ts:63
• form: formType
Defined in util.ts:86
• length? : undefined | number
Inherited from tagFrame.length
Defined in util.ts:62
• tag: number
Defined in util.ts:87
asn1-pharser › "util" › integerFrame
-
↳ integerFrame
• data: Buffer
Defined in util.ts:66
• form? : formType
Defined in util.ts:61
• length? : undefined | number
Inherited from tagFrame.length
Defined in util.ts:62
asn1-pharser › "util" › objectIdentifierFrame
• data? : Buffer
Defined in util.ts:63
• form? : formType
Defined in util.ts:61
• length? : undefined | number
Inherited from tagFrame.length
Defined in util.ts:62
• str? : undefined | string
Defined in util.ts:77
asn1-pharser › "util" › octetStringFrame
-
↳ octetStringFrame
• data: Buffer
Defined in util.ts:73
• form? : formType
Defined in util.ts:61
• length? : undefined | number
Inherited from tagFrame.length
Defined in util.ts:62
asn1-pharser › "util" › sequenceFrame
-
↳ sequenceFrame
• children: tagBuilderType[]
Defined in util.ts:81
• data? : Buffer
Defined in util.ts:63
• form: formType
Defined in util.ts:82
• length? : undefined | number
Inherited from tagFrame.length
Defined in util.ts:62
asn1-pharser › "util" › tagFrame
-
tagFrame
↳ buildMap
• data? : Buffer
Defined in util.ts:63
• form? : formType
Defined in util.ts:61
• length? : undefined | number
Defined in util.ts:62
Ƭ tagBuilderType: TagBuilder | BitString | ContextSpecific | Integer | ObjectIdentifier | OctetString | Sequence
Defined in tagBuilders.ts:3
- bitStringFrame
- buildMap
- contextSpecificFrame
- integerFrame
- objectIdentifierFrame
- octetStringFrame
- sequenceFrame
- tagFrame
Ƭ formType: keyof typeof form
Defined in util.ts:11
Ƭ maskType: keyof typeof mask
Defined in util.ts:36
Ƭ tagClassType: keyof typeof tagClass
Defined in util.ts:2
Ƭ tagFrameType: tagFrame | integerFrame | sequenceFrame | bitStringFrame | octetStringFrame | contextSpecificFrame | objectIdentifierFrame
Defined in util.ts:52
Ƭ tagType: keyof typeof tag
Defined in util.ts:18