Skip to main content

AsnData<T>

Represents an ASN.1 data

Extended by​

Type Parameters​

T​

T

Implements​

Constructors​

Constructor​

new AsnData<T>(raw, type, options?): AsnData<T>

Creates a new instance

Parameters​

raw​

BufferSource

DER encoded buffer

type​

() => T

ASN.1 convertible class for @peculiar/asn1-schema schema

options?​

any

Returns​

AsnData<T>

Constructor​

new AsnData<T>(asn, options?): AsnData<T>

ASN.1 object

Parameters​

asn​

T

options?​

any

ASN.1 parse options used for nested ASN.1 payloads

Returns​

AsnData<T>

Properties​

asn​

protected readonly asn: T

ASN.1 object


NAME​

static NAME: string = "ASN"

Accessors​

parseOptions​

Get Signature​

get protected parseOptions(): any

Gets the ASN.1 parse options the instance was created with

Returns​

any


rawData​

Get Signature​

get rawData(): ArrayBuffer

Gets a DER encoded buffer

Returns​

ArrayBuffer

Methods​

equal()​

equal(data): data is AsnData<T>

Returns true if ASN.1 data is equal to another ASN.1 data, otherwise false

Parameters​

data​

any

Any data

Returns​

data is AsnData<T>


getTextName()​

protected getTextName(): string

Returns​

string


onInit()​

abstract protected onInit(asn): void

Occurs on instance initialization

Parameters​

asn​

T

ASN.1 object

Returns​

void


toString()​

toString(format): string

Returns a string representation of an object.

Parameters​

format​

AsnDataStringFormat = "text"

Returns​

string


toTextObject()​

toTextObject(): TextObject

Returns the object in textual representation

Returns​

TextObject

Implementation of​

TextObjectConvertible.toTextObject


toTextObjectEmpty()​

protected toTextObjectEmpty(value?): TextObject

Parameters​

value?​

string

Returns​

TextObject