Skip to main content

PemConverter

Represents PEM Converter.

Constructors

new PemConverter()

new PemConverter(): PemConverter

Returns

PemConverter

Properties

CertificateRequestTag

static CertificateRequestTag: string = "CERTIFICATE REQUEST"


CertificateTag

static CertificateTag: string = "CERTIFICATE"


CrlTag

static CrlTag: string = "CRL"


PrivateKeyTag

static PrivateKeyTag: string = "PRIVATE KEY"


PublicKeyTag

static PublicKeyTag: string = "PUBLIC KEY"

Methods

decode()

static decode(pem): ArrayBuffer[]

Decodes PEM to a list of raws

Parameters

pem: string

message in PEM format

Returns

ArrayBuffer[]


decodeFirst()

static decodeFirst(pem): ArrayBuffer

Decodes PEM and returns first item from the list

Parameters

pem: string

message in PEM format

Returns

ArrayBuffer

Throw

Throws RangeError if list of decoded items is empty


decodeWithHeaders()

static decodeWithHeaders(pem): PemStruct[]

Parameters

pem: string

Returns

PemStruct[]


encode()

encode(structs)

static encode(structs): string

Encodes a list of PemStruct in PEM format

Parameters

structs: PemStructEncodeParams[]

A list of PemStruct

Returns

string

encode(rawData, tag)

static encode(rawData, tag): string

Encodes a raw data in PEM format

Parameters

rawData: BufferSource

Raw data

tag: string

PEM tag

Returns

string

encode(rawData, tag)

static encode(rawData, tag): string

Encodes a list of raws in PEM format

Parameters

rawData: BufferSource[]

tag: string

PEM tag

Returns

string


isPem()

static isPem(data): data is string

Parameters

data: any

Returns

data is string