Skip to main content

ExtensionFactory

Static class to manage X509 extensions

Constructors

new ExtensionFactory()

new ExtensionFactory(): ExtensionFactory

Returns

ExtensionFactory

Methods

create()

static create(data): Extension

Returns X509 Extension based on it's identifier

Parameters

data: BufferSource

DER encoded buffer

Returns

Extension

Example

const ext = ExtensionFactory.create(asnExtRaw);

register()

static register(id, type): void

Registers a new X509 Extension class. If id already exists replaces it

Parameters

id: string

Extension identifier

type: any

Extension class

Returns

void

Example

ExtensionFactory.register(asnX509.id_ce_basicConstraints, extensions.BasicConstraintsExtension);