Skip to content

pemDecodeOrThrow

Throwing core for pemDecode: extracts and base64-decodes the DER content from a PEM string. Throws if the BEGIN/END markers don't match label.

ts
function pemDecodeOrThrow(
	label: string,
	pem: string,
): Uint8Array

Parameters

  • label: string — Expected PEM type label.
  • pem: string — PEM-encoded text (may contain \r).

Released under the MIT License.