Skip to main content
Home

Built and signed on GitHub Actions

Encoding, decoding, and validation of Privacy-Enhanced Mail (PEM) objects per IETF RFC 7468.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a week ago (4.0.1)
class PEMObject

A PEM object.

Constructors

new
PEMObject(
label?: string,
data?: string | Uint8Array,
)

Create a new PEM object.

Properties

The binary data of the PEM object.

writeonly
label: string

Set the label of the PEM object.

readonly
encoded: string

Get the encoded string of the PEM object.

readonly
label: string

Get the label of the PEM object.

Get the post-encapsulation boundary of the PEM object.

Get the pre-encapsulation boundary of the PEM object.

private
_label: string

The label of the PEM object.

Methods

decode(encoded: string): void

Decode a single PEM object from a string.

Get the string representation of the PEM object.

Static Properties

The regular expression to match a base64 line.

The regular expression to match a PEM object.

The regular expression to match the post-encapsulation boundary.

The regular expression to match the pre-encapsulation boundary.

Static Methods

Parse one or more PEM object from a string.

validateLabel(label: string): void

From RFC 7468: "Labels are formally case-sensitive, uppercase, and comprised of zero or more characters; they do not contain consecutive spaces or hyphen-minuses, nor do they contain spaces or hyphen-minuses at either end."

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@wildboar/pem

Import symbol

import { PEMObject } from "@wildboar/pem";
or

Import directly with a jsr specifier

import { PEMObject } from "jsr:@wildboar/pem";

Add Package

pnpm i jsr:@wildboar/pem
or (using pnpm 10.8 or older)
pnpm dlx jsr add @wildboar/pem

Import symbol

import { PEMObject } from "@wildboar/pem";

Add Package

yarn add jsr:@wildboar/pem
or (using Yarn 4.8 or older)
yarn dlx jsr add @wildboar/pem

Import symbol

import { PEMObject } from "@wildboar/pem";

Add Package

vlt install jsr:@wildboar/pem

Import symbol

import { PEMObject } from "@wildboar/pem";

Add Package

npx jsr add @wildboar/pem

Import symbol

import { PEMObject } from "@wildboar/pem";

Add Package

bunx jsr add @wildboar/pem

Import symbol

import { PEMObject } from "@wildboar/pem";